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

small fix manage unit target #467

Merged
merged 3 commits into from
May 13, 2022
Merged

small fix manage unit target #467

merged 3 commits into from
May 13, 2022

Conversation

Ipuch
Copy link
Collaborator

@Ipuch Ipuch commented May 10, 2022

very small fix to handle the plot when there is a target with only one value.


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 all commit messages.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @Ipuch and @pariterre)


bioptim/optimization/optimal_control_program.py line 726 at r1 (raw file):

            if penalty.target is not None and isinstance(t, int):
                _target = (
                    penalty.target[..., penalty.node_idx.index(t)]

There is a for loop missing for "all the targets"

Code quote:

                    penalty.target[..., penalty.node_idx.index(t)]
                    if len(penalty.target) > 1
                    else penalty.target[penalty.node_idx.index(t)]

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 r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Ipuch)

@pariterre pariterre merged commit 85793d8 into pyomeca:master May 13, 2022
@Ipuch Ipuch deleted the unit_target branch May 13, 2022 18:50
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.

None yet

2 participants