-
Notifications
You must be signed in to change notification settings - Fork 21
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
Changes ConstraintCollocator attributes to read only properties. Replaces PR #315 #337
Conversation
import sympy.physics.mechanics as mech | ||
from opty.direct_collocation import Problem, ConstraintCollocator | ||
|
||
import pytest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All imports should be at the top of the file with the other imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed it.
Thanks!
I always make such mistakes, when I copy the test function which I write to test it (and where I need these imports) to test_direct_collocation.py
The time_symbol
is optional, but as we saw recently, it is a good idea to explicitly add it here and also in create_objective_function
. Would it make sense to make it required? (might break old code, so maybe not a good idea?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In hindsight, time symbol should be required, but it really only fails on CI. I'm not quite sure why but something with the hashing of python objects changes. Not sure...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(might break old code, so maybe not a good idea?)
Best we don't break old code.
There were two arange calls, deleted the second. |
:-) |
Read only attributes:
Corrected the mistakes of previous ignorance: leading underscore only when the attribute is set.
Removed the printing in the test.