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

[RTR] integration rule tested in collocation #546

Merged
merged 4 commits into from
Oct 20, 2022

Conversation

Ipuch
Copy link
Collaborator

@Ipuch Ipuch commented Oct 4, 2022

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

@Ipuch Ipuch changed the title integration rule tested in collocation [RTR] integration rule tested in collocation Oct 4, 2022
@Ipuch Ipuch added bug Something isn't working enhancement New feature or request labels Oct 4, 2022
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.

GG so far

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @Ipuch)


bioptim/optimization/solution.py line 1302 at r1 (raw file):

                        or penalty.integration_rule == IntegralApproximation.TRAPEZOIDAL
                    ):
                        col_x_idx.append((idx + 1) * steps) if nlp.ode_solver.is_direct_shooting else col_x_idx.append(

I feel that it is not what you expect. See suggestion

Suggestion:

                        col_x_idx.append((idx + 1) * (steps if nlp.ode_solver.is_direct_shooting else 1))

tests/test_cost_function_integration.py line 118 at r1 (raw file):

    Sum the cost function output from sol.print_cost()
    """
    capturedOutput = io.StringIO()  # Create StringIO object

Please change that to camel_casing

Code quote:

capturedOutput 

tests/test_cost_function_integration.py line 217 at r1 (raw file):

    "objective",
    [
        # "torque",

Why is this commented?

Code quote:

 # "torque",

tests/test_cost_function_integration.py line 228 at r1 (raw file):

    "integration_rule",
    [
        # IntegralApproximation.RECTANGLE,

Why is this commented?

Code quote:

        # IntegralApproximation.RECTANGLE,
        IntegralApproximation.TRAPEZOIDAL,
        # IntegralApproximation.TRUE_TRAPEZOIDAL,

@pariterre pariterre changed the title [RTR] integration rule tested in collocation integration rule tested in collocation Oct 6, 2022
@Ipuch Ipuch changed the title integration rule tested in collocation [RTR] integration rule tested in collocation Oct 20, 2022
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 r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Ipuch)

@pariterre pariterre merged commit a0a51c6 into pyomeca:master Oct 20, 2022
@Ipuch Ipuch deleted the collocation_costs branch July 6, 2023 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants