symforce-org / symforce

Fast symbolic computation, code generation, and nonlinear optimization for robotics
https://symforce.org
Apache License 2.0
1.41k stars 145 forks source link

Handle nested namespace when generating functions #285

Closed chao-qu-skydio closed 1 year ago

chao-qu-skydio commented 1 year ago

I tried to call generate_function with a nested namespace A::B in my codegen_test.py. The script finished without error but nothing was generated. A quick look into the code shows that we currently assume only one namespace level. However, it would be nice to either

  1. be able to handle nested namespaces
  2. If we don't want to support this, raise an error.
aaron-skydio commented 1 year ago

We can certainly do 2, we should just go ahead and do that. We don't have any plans to do 1 anytime soon, but I don't have a fundamental objection to it - it's not a trivial change, but if it's something people want at some point we can do it