symforce icon indicating copy to clipboard operation
symforce copied to clipboard

Changing log level affects output

Open ThomasGreenhill opened this issue 11 months ago • 1 comments

Description: When changing the log level, i.e. symforce.set_log_level("error") from the default ("info"), the codegen output changes. We do a number of operations that require conversion to/from sympy, and with the "info" log level, produces a lot of warnings such as:

symbolic.integrate():607 WARNING -- Converting to sympy to use .integrate
symbolic.simplify():563 WARNING -- Converting to sympy to use .simplify

Which is known and accepted, so we wanted to suppress those warnings. However, after adding symforce.set_log_level("error") to the code that produces those warnings, the generated C++ code is also changed, which I did not expect. We have some minor customizations on top of CppCodePrinter but nothing that would affect this.

I would expect the functionality to be identical regardless of the log level, but maybe I'm missing something?

Happy to put together minimum steps to reproduce/minimum example as needed, but I think doing an integrate/simplify and then codegen should do the trick.

Environment (please complete the following information):

  • OS and version: Reproduced on Ubuntu 20.04 and 22.04
  • Python version 3.10.15
  • SymForce version 0.9.0
  • Symengine version 0.11.0
  • sympy version 1.13.3

ThomasGreenhill avatar Jan 08 '25 23:01 ThomasGreenhill

This is super weird, I'm planning to look at this when I get a chance but haven't had time yet. If you can put together a minimal example that would be helpful?

aaron-skydio avatar Jan 14 '25 19:01 aaron-skydio