-
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
[RTM] Mayer on first node with acados #501
Conversation
Codecov Report
@@ Coverage Diff @@
## master #501 +/- ##
==========================================
+ Coverage 80.39% 80.49% +0.10%
==========================================
Files 86 86
Lines 9482 9537 +55
==========================================
+ Hits 7623 7677 +54
- Misses 1859 1860 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @aceglia)
bioptim/interfaces/acados_interface.py
line 399 at r1 (raw file):
) def add_linear_ls_mayer(acados, objectives, node=None):
I don't understand why (and how) you need node
as it is
bioptim/interfaces/acados_interface.py
line 402 at r1 (raw file):
def add_objective(n_variables, is_state): v_var = np.zeros(n_variables) var_type = acados.ocp.nlp[0].states if is_state else acados.ocp.nlp[0].controls
Put this in a embedded function
Code quote:
v_var = np.zeros(n_variables)
var_type = acados.ocp.nlp[0].states if is_state else acados.ocp.nlp[0].controls
rows = objectives.rows + var_type[objectives.params["key"]].index[0]
v_var[rows] = 1.0
bioptim/interfaces/acados_interface.py
line 406 at r1 (raw file):
v_var[rows] = 1.0 if objectives.node[0] == Node.START or node == "start":
Move the call down here as such
if objectives.node[0] == Node.START or objectives.node[0] == Node.ALL:
Code quote:
node == "start"
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 2 files reviewed, 3 unresolved discussions (waiting on @pariterre)
bioptim/interfaces/acados_interface.py
line 399 at r1 (raw file):
Previously, pariterre (Pariterre) wrote…
I don't understand why (and how) you need
node
as it is
Done.
bioptim/interfaces/acados_interface.py
line 402 at r1 (raw file):
Previously, pariterre (Pariterre) wrote…
Put this in a embedded function
Done.
bioptim/interfaces/acados_interface.py
line 406 at r1 (raw file):
Previously, pariterre (Pariterre) wrote…
Move the call down here as such
if objectives.node[0] == Node.START or objectives.node[0] == Node.ALL:
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.
I much prefer this :)
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @aceglia)
All Submissions:
New Feature Submissions:
black . -l120 --exclude "external/*"
)?Changes to Core Features:
This change is