-
Notifications
You must be signed in to change notification settings - Fork 55
[RTR] adressing node specific dynamics #624
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
Conversation
pariterre
left a comment
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.
Reviewed 6 of 6 files at r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @Ipuch)
bioptim/dynamics/ode_solver.py line 74 at r1 (raw file):
if len(nlp.dynamics) != 1 and ocp.n_threads != 1: raise NotImplementedError("n_threads > 1 with external_forces is not implemented yet") # if len(nlp.dynamics) == 1:
This should be kept
Code quote:
# if len(nlp.dynamics) == 1:
# nlp.dynamics = nlp.dynamics * nlp.nsbioptim/examples/getting_started/example_external_forces.py line 78 at r1 (raw file):
external_forces = [[np.array([[0, 0, 0, 0, 0, -2], [0, 0, 0, 0, 0, 5]]).T for _ in range(n_shooting)]] external_forces[0][2] = np.array([[0, 0, 0, 0, 0, -22], [0, 0, 0, 0, 0, 52]]).T # external_forces[0][5] = np.array([[0, 0, 500, 0, 0, -2], [0, 0, 500, 0, 0, 5]]).T
Don't forget to clean up
Code quote:
external_forces[0][2] = np.array([[0, 0, 0, 0, 0, -22], [0, 0, 0, 0, 0, 52]]).T
# external_forces[0][5] = np.array([[0, 0, 500, 0, 0, -2], [0, 0, 500, 0, 0, 5]]).T
# external_forces[0][8] = np.array([[0, 0, 500, 0, 0, -2], [0, 0, 500, 0, -1000, 5]]).T
# external_forces[0][11] = np.array([[0, 0, 500, 0, 0, -2], [0, 0, 500, 0, 0, 5]]).T
external_forces[0][14] = np.array([[0, 0, 0, 0, 0, 100], [0, 0, 0, 0, 0, -6]]).T
# external_forces[0][17] = np.array([[0, 0, 500, 0, 0, -2], [0, 0, 500, 0, 0, 5]]).T
# external_forces[0][20] = np.array([[0, 0, 500, 0, 0, -2], [0, 0, 500, 0, -1000, 5]]).Tbioptim/limits/objective_functions.py line 297 at r1 (raw file):
# Dynamics must be sound within phases for nlp in ocp.nlp: if len(nlp.dynamics) > 1:
This will always be the case
Code quote:
if len(nlp.dynamics) > 1:bioptim/optimization/solution.py line 1032 at r1 (raw file):
else: dynamics_func = nlp.dynamics * nlp.ns if len(nlp.dynamics) == 1 else nlp.dynamics
This will not be necessary
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #624 +/- ##
==========================================
+ Coverage 81.67% 81.70% +0.02%
==========================================
Files 106 106
Lines 11804 11817 +13
==========================================
+ Hits 9641 9655 +14
+ Misses 2163 2162 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Ipuch
left a comment
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.
Reviewable status: 1 of 7 files reviewed, 4 unresolved discussions (waiting on @pariterre)
bioptim/dynamics/ode_solver.py line 74 at r1 (raw file):
Previously, pariterre (Pariterre) wrote…
This should be kept
Done
bioptim/examples/getting_started/example_external_forces.py line 78 at r1 (raw file):
Previously, pariterre (Pariterre) wrote…
Don't forget to clean up
Done
bioptim/limits/objective_functions.py line 297 at r1 (raw file):
Previously, pariterre (Pariterre) wrote…
This will always be the case
Done
bioptim/optimization/solution.py line 1032 at r1 (raw file):
Previously, pariterre (Pariterre) wrote…
This will not be necessary
Done
linted
|
@pariterre PR ready to merge to me. |
print it alll, now continuity is printed for all nodes
test again
hello daft punk ?
praying the god of ci
|
rk8 didn't fail but test_cyclic_nmpc failed this time . |
try to patch
pariterre
left a comment
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.
Reviewed 3 of 5 files at r2, 2 of 3 files at r3, 1 of 1 files at r4, 1 of 1 files at r5, 2 of 2 files at r6, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Ipuch)
tests/test_global_getting_started.py line 860 at r6 (raw file):
f = np.array(sol.cost) np.testing.assert_equal(f.shape, (1, 1)) np.testing.assert_almost_equal(f[0, 0], 7067.851604540213)
Is this expected?
Code quote:
7067.851604540213balck and extra comments
pariterre
left a comment
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.
Reviewed 3 of 3 files at r7, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @Ipuch)
All Submissions:
New Feature Submissions:
black . -l120 --exclude "external/*")?Changes to Core Features:
This change is