Skip to content
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 after next push] SOCP: Making the noise dependant on the states + controls #809

Merged
merged 73 commits into from
Feb 2, 2024

Conversation

EveCharbie
Copy link
Collaborator

@EveCharbie EveCharbie commented Nov 22, 2023

All Submissions:

  • Have you followed the guidelines in our Contributing document [docs/contribution.md]?
  • Have you checked to ensure there aren't other open [Pull Requests] for the same update/change?
  • Have you opened/linked the issue related to your pull request?
  • Have you used the tag [WIP] for on-going changes, and removed it when the pull request was ready?
  • When ready to merge, have you sent a comment pinging @pariterre in it?

New Feature Submissions:

  1. Does your submission pass the tests (if not please explain why this is intended)?
  2. Did you write a proper documentation (docstrings and ReadMe)
  3. Have you linted your code locally prior to submission (using the command: black . -l120 --exclude "external/*")?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new examples for your core changes, as applicable?
  • Have you written new tests for your core changes, as applicable?

This change is Reviewable

Copy link
Member

@pariterre pariterre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5 of 36 files at r1, 1 of 7 files at r2, 21 of 34 files at r3, 13 of 13 files at r4, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @EveCharbie)


bioptim/dynamics/dynamics_functions.py line 645 at r4 (raw file):

        """

        q = nlp.get_var_from_states_or_controls("q", states, controls)

add the capability to send algebraic too


bioptim/examples/stochastic_optimal_control/arm_reaching_muscle_driven.py line 711 at r4 (raw file):

        nlp = socp.nlp[0]
        out = stochastic_forward_dynamics(
            None,

None?


bioptim/examples/torque_driven_ocp/minimize_maximum_torque_by_extra_parameter.py line 133 at r4 (raw file):

    x_init = InitialGuessList()
    x_init.add(key="q_roots", initial_guess=[0] * n_root, phase=0)
    x_init.add(key="q_jointss", initial_guess=[0] * n_tau, phase=0)

Typo? Remove the capability to declare unused variable?


bioptim/models/protocols/biomodel.py line 88 at r4 (raw file):

        return ()

    def biorbd_homogeneous_matrices_in_global(self, q, segment_id, inverse=False) -> tuple:

This should not be in the Protocol

nlp.model: BiorbdModel


bioptim/optimization/non_linear_program.py line 521 at r4 (raw file):

        return self.tf / self.ns * node_idx

    def get_var_from_states_or_controls(self, key: str, states: MX.sym, controls: MX.sym) -> MX:

Add the capability to send algebraic

Copy link
Collaborator Author

@EveCharbie EveCharbie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 36 of 47 files reviewed, 4 unresolved discussions (waiting on @pariterre)


bioptim/dynamics/dynamics_functions.py line 645 at r4 (raw file):

Previously, pariterre (Pariterre) wrote…

add the capability to send algebraic too

Done.


bioptim/examples/stochastic_optimal_control/arm_reaching_muscle_driven.py line 711 at r4 (raw file):

Previously, pariterre (Pariterre) wrote…

None?

Done.


bioptim/models/protocols/biomodel.py line 88 at r4 (raw file):

Previously, pariterre (Pariterre) wrote…

This should not be in the Protocol

nlp.model: BiorbdModel

Done.


bioptim/optimization/non_linear_program.py line 521 at r4 (raw file):

Previously, pariterre (Pariterre) wrote…

Add the capability to send algebraic

Done.

Copy link
Member

@pariterre pariterre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 58 of 58 files at r5, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @EveCharbie)


bioptim/gui/plot.py line 388 at r5 (raw file):

                            )
                            if variable in nlp.plot
                            else 0

Verify that


tests/shard5/test_global_stochastic_collocation.py line 384 at r5 (raw file):

    # First collocation state is equal to the states at node
    const = socp.nlp[0].g_internal[1]

constraint

@pariterre pariterre changed the title [WIP] SOCP: Making the noise dependant on the states + controls [RTM after next push] SOCP: Making the noise dependant on the states + controls Feb 1, 2024
Copy link
Collaborator Author

@EveCharbie EveCharbie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @pariterre)


bioptim/gui/plot.py line 388 at r5 (raw file):

Previously, pariterre (Pariterre) wrote…

Verify that

reverted deleted lines


tests/shard5/test_global_stochastic_collocation.py line 384 at r5 (raw file):

Previously, pariterre (Pariterre) wrote…

constraint

Done.

pariterre
pariterre previously approved these changes Feb 2, 2024
Copy link
Member

@pariterre pariterre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r6, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @EveCharbie)

@EveCharbie
Copy link
Collaborator Author

@pariterre should be fine

pariterre
pariterre previously approved these changes Feb 2, 2024
Copy link
Member

@pariterre pariterre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 7 of 7 files at r7, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @EveCharbie)

Copy link

codecov bot commented Feb 2, 2024

Codecov Report

Attention: 241 lines in your changes are missing coverage. Please review.

Comparison is base (d2e6dad) 78.90% compared to head (c02d206) 78.39%.
Report is 75 commits behind head on master.

Files Patch % Lines
...optimization/stochastic_optimal_control_program.py 8.08% 91 Missing ⚠️
bioptim/dynamics/dynamics_functions.py 70.37% 24 Missing ⚠️
bioptim/dynamics/configure_problem.py 54.16% 22 Missing ⚠️
bioptim/limits/constraints.py 37.93% 18 Missing ⚠️
bioptim/models/biorbd/biorbd_model.py 57.50% 17 Missing ⚠️
bioptim/models/biorbd/stochastic_biorbd_model.py 14.28% 12 Missing ⚠️
bioptim/models/utils.py 64.28% 10 Missing ⚠️
bioptim/limits/penalty_controller.py 66.66% 9 Missing ⚠️
bioptim/models/protocols/stochastic_biomodel.py 25.00% 9 Missing ⚠️
bioptim/optimization/non_linear_program.py 74.07% 7 Missing ⚠️
... and 8 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #809      +/-   ##
==========================================
- Coverage   78.90%   78.39%   -0.51%     
==========================================
  Files         139      140       +1     
  Lines       15721    16081     +360     
==========================================
+ Hits        12404    12607     +203     
- Misses       3317     3474     +157     
Flag Coverage Δ
unittests 78.39% <60.09%> (-0.51%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@pariterre pariterre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 1 files at r9, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @EveCharbie)

@pariterre pariterre merged commit bbc1180 into pyomeca:master Feb 2, 2024
20 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants