-
Notifications
You must be signed in to change notification settings - Fork 114
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
Use vectorized operations to compute transformations #266
Use vectorized operations to compute transformations #266
Conversation
c89e7bf
to
ccc6478
Compare
Are there any tests for this code? |
Please update with master. |
ccc6478
to
d8c273b
Compare
Use vectorized Numpy operation to compute visualization frame transformation matrices as this is much faster than using a for loop. Each element of the transformation matrix is lambdified and stored in a list of numerical transformations. Individual element transforms that do not contain dynamic variables nor constant variables are not returned as functions by lambdify and subsequent evaluation for these elements is skipped. Element transforms that contain constant variables but not dynamic variables are lambdified with only the constant variables as arguments. These are only evaluated once and then repeated for create of the visualization matrix trajectory. This commit resolves issue pydy#32.
It looks like there are no tests for the calculation of the transform matrices. |
Would you be willing to create a regression test? You could run the code from master on an example and pull out some values and then make the test against them. |
No problem I'm already doing that now. |
Actually, there is already a regression test: pydy/pydy/viz/tests/test_visualization_frame_scene.py Lines 177 to 212 in d57dac0
so I think we can merge this unless you have any other issues. |
Sweet. Merging. |
Use vectorized operations to compute transformations
Use vectorized Numpy operation to compute visualization frame
transformation matrices as this is much faster than using a for loop.
Each element of the transformation matrix is lambdified and stored in a
list of numerical transformations.
Individual element transforms that do not contain dynamic variables nor
constant variables are not returned as functions by lambdify and
subsequent evaluation for these elements is skipped. Element transforms
that contain constant variables but not dynamic variables are lambdified
with only the constant variables as arguments. These are only evaluated
once and then repeated for create of the visualization matrix
trajectory.
This commit resolves issue #32