-
Notifications
You must be signed in to change notification settings - Fork 144
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
Pass modules to PythonExpression #655
Conversation
66f3be8
to
cf9c660
Compare
Any feedback on this? |
Could you add tests? |
Sure thing! I'll get to it shortly. |
Done. I also fixed a couple tiny issues that I found while creating and running the tests. |
b319c16
to
82bf3cc
Compare
Got it working with Substitutions in the constructor. Updated tests and added new ones for the XML. I'll now look into the matter of keying the definitions to their modules, with backwards compatibility. As for naming, maybe |
…tion. Allows eval of more expressions. Signed-off-by: Blake Anderson Signed-off-by: Blake Anderson <blakeanderson@utexas.edu>
Signed-off-by: Blake Anderson <blakeanderson@utexas.edu>
It is now easier to pass multiple modules. Also simpler syntax. Signed-off-by: Blake Anderson <blakeanderson@utexas.edu>
Signed-off-by: Blake Anderson <blakeanderson@utexas.edu>
Signed-off-by: Blake Anderson <blakeanderson@utexas.edu>
Looks like a copy/paste error from another test. Signed-off-by: Blake Anderson <blakeanderson@utexas.edu>
Signed-off-by: Blake Anderson <blakeanderson@utexas.edu>
Add more tests for describe() Signed-off-by: Blake Anderson <blakeanderson@utexas.edu>
Signed-off-by: Blake Anderson <blakeanderson@utexas.edu>
Definitions from modules must be prepended by the module name. Ex: 'sys.getrefcount' instead of just 'getrefcount'. The math module is an exception for backwards compatibility. Signed-off-by: Blake Anderson <blakeanderson@utexas.edu>
a36e2b8
to
93d7d00
Compare
Signed-off-by: Blake Anderson <blakeanderson@utexas.edu>
Done. The expressions will now require the module names before the definitions you use. For backwards compatibility, math definitions will work with or without the module name, and the tests include cases for both. If you wish, the implicit references could be considered deprecated for removal at a future date. I think this PR is ready to go now. |
Signed-off-by: Blake Anderson <blakeanderson@utexas.edu>
Flake 8 issues :o https://ci.ros2.org/job/ci_linux-aarch64/12418/testReport/launch.test/test_flake8/test_flake8/ I think just change the name |
Signed-off-by: Blake Anderson <blakeanderson@utexas.edu>
Added ability to pass Python modules to the PythonExpression substitution.
Allows eval of more expressions.
For example, my motivating use case was:
robot_desc = PythonExpression(["process_file('", filepath, "').toprettyxml(indent=' ')"], xacro.__dict__)