-
Notifications
You must be signed in to change notification settings - Fork 46
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
[RTR] Fixed add_penalty_plot index #665
Conversation
@lsechoir I think you had problems with add_plot_penalty too, can you try this fix to see if it helps in your case? |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #665 +/- ##
==========================================
- Coverage 81.82% 81.81% -0.01%
==========================================
Files 112 112
Lines 12919 12953 +34
==========================================
+ Hits 10571 10598 +27
- Misses 2348 2355 +7
☔ View full report in Codecov by Sentry. |
@pariterre I changed the behavior of the plots. Now it shows all plots even if there is a mapping. I find it easier to understand and it fixes the issue with indexing the plots. What do you think? (If it is ok, I will clean it, ex the legend) |
I understand how it simplifies things... but not sure I like creating useless graphs... @Ipuch ? |
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 1 of 1 files at r1, 3 of 3 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @EveCharbie)
bioptim/dynamics/configure_problem.py
line 1113 at r2 (raw file):
as_controls, as_states_dot, axes_idx=axes_idx # nlp.variable_mappings[name].to_first,
Remove if not necessary
bioptim/gui/plot.py
line 99 at r2 (raw file):
self.phase_mappings = None # Will be set later elif isinstance(axes_idx, (tuple, list)): self.phase_mappings = BiMapping(axes_idx) # ?
What is the question here?
Please have a look why tests fail |
Test does not pass because it is not a final version, I just wanted your insights before cleaning the code. |
I don't care about having extra graphs if it eases the code. Anyways we don't use them for publication but only to check our results. |
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: 0 of 5 files reviewed, 2 unresolved discussions (waiting on @pariterre)
bioptim/dynamics/configure_problem.py
line 1113 at r2 (raw file):
Previously, pariterre (Pariterre) wrote…
Remove if not necessary
Done.
bioptim/gui/plot.py
line 99 at r2 (raw file):
Previously, pariterre (Pariterre) wrote…
What is the question here?
Done.
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 1 of 5 files at r3, 4 of 4 files at r4, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @EveCharbie)
bioptim/limits/penalty_option.py
line 571 at r4 (raw file):
else: target_mapping = BiMapping( to_first=list(range(controller.get_nlp.controls[key].cx_start.shape[0])),
congtroller.controls[key].cx.shape
bioptim/limits/penalty_option.py
line 572 at r4 (raw file):
target_mapping = BiMapping( to_first=list(range(controller.get_nlp.controls[key].cx_start.shape[0])), to_second=list(range(controller.get_nlp.controls[key].cx_start.shape[0])),
congtroller.controls[key].cx.shape
bioptim/limits/penalty_option.py
line 593 at r4 (raw file):
self.target_plot_name = combine_to # if the target is n x ns, we need to add a dimension (n x ns + 1) to make it compatible with the plot if self.target[0].shape[1] == controller.get_nlp.ns:
congtroller.ns?
bioptim/optimization/optimal_control_program.py
line 1034 at r4 (raw file):
x_scaling = np.vstack([self.nlp[penalty.phase].x_scaling["all"].scaling for _ in range(x_shape)]).T x /= x_scaling
check this?
bioptim/optimization/optimal_control_program.py
line 1035 at r4 (raw file):
x /= x_scaling if u.size != 0:
wait for me?
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 5 files reviewed, 5 unresolved discussions (waiting on @pariterre)
bioptim/limits/penalty_option.py
line 571 at r4 (raw file):
Previously, pariterre (Pariterre) wrote…
congtroller.controls[key].cx.shape
Done.
bioptim/limits/penalty_option.py
line 572 at r4 (raw file):
Previously, pariterre (Pariterre) wrote…
congtroller.controls[key].cx.shape
Done.
bioptim/limits/penalty_option.py
line 593 at r4 (raw file):
Previously, pariterre (Pariterre) wrote…
congtroller.ns?
Done.
bioptim/optimization/optimal_control_program.py
line 1034 at r4 (raw file):
Previously, pariterre (Pariterre) wrote…
check this?
did not disapear, dont know why ?
bioptim/optimization/optimal_control_program.py
line 1035 at r4 (raw file):
Previously, pariterre (Pariterre) wrote…
wait for me?
Merged you PR
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 4 of 4 files at r5, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @EveCharbie)
Tries to fix issue #641
This change is