Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing log level affects output #419

Open
ThomasGreenhill opened this issue Jan 8, 2025 · 1 comment
Open

Changing log level affects output #419

ThomasGreenhill opened this issue Jan 8, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@ThomasGreenhill
Copy link

ThomasGreenhill commented Jan 8, 2025

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 ThomasGreenhill added the bug Something isn't working label Jan 8, 2025
@aaron-skydio
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants