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

Plot errors in multi-phase #781

Open
EveCharbie opened this issue Oct 19, 2023 · 8 comments
Open

Plot errors in multi-phase #781

EveCharbie opened this issue Oct 19, 2023 · 8 comments

Comments

@EveCharbie
Copy link
Collaborator

I get the following error message:

Traceback (most recent call last):
  File "/home/charbie/miniconda3/envs/dev_bioptim/lib/python3.11/site-packages/matplotlib/backend_bases.py", line 1226, in _on_timer
    ret = func(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^
  File "/home/charbie/Documents/Programmation/BiorbdOptim/bioptim/gui/plot.py", line 1363, in callback
    self.plot.update_data(v)
  File "/home/charbie/Documents/Programmation/BiorbdOptim/bioptim/gui/plot.py", line 946, in update_data
    y[i_node] = val[i_var]
                ~~~^^^^^^^
IndexError: index 4 is out of bounds for axis 0 with size 4

when running the code TechOpt831 from https://github.com/EveCharbie/VisionOCP with solver = Solver.IPOPT(show_online_optim=True, show_options=dict(show_bounds=True))

When I have time, I will look more deeply in what seems to be the issue.

@EveCharbie
Copy link
Collaborator Author

This problem seems to happen when there is a target in minimize_state/minimize_control and index is specified.
I think define_target_mapping (currently l.891 from penalty option) could be upgraded to consider this mapping.

@tiagocoelhoma
Copy link

Hello! I also have the same problem. It should be great to have it working! :)
And yes, I am using minimize_state/minimize_control and index is specified.

@EveCharbie
Copy link
Collaborator Author

Thank you for you confirmation of what seems to be the issue.
There is a major refarctor/improvement going on right now. It should fix a lot of graph issues, but I am not sure it will fix this one. When it gets merged, I will have a look at it.

@fbailly
Copy link
Member

fbailly commented Feb 6, 2024

@EveCharbie @pariterre Do you know if the major refactor fixed this issue ?
Thanks !

@pariterre
Copy link
Member

I am not sure since plot.py is a bit capricious, but I fix some problems with this specific line during the refactor, definitely worth retrying

@EveCharbie
Copy link
Collaborator Author

  1. On my side it does not even show the plots anymore with show_online_optim=True :(

  2. But the original error is still there.
    By adding a ObjectiveFcn.Mayer.MINIMIZE_STATE, key="q", target=1, index=0 I get a similar error as before

Screenshot 2024-02-06 at 10 36 26 AM

@EveCharbie
Copy link
Collaborator Author

I do not have time to fix this right now. @pariterre or @tiagocoelhoma would you have time?

@EveCharbie
Copy link
Collaborator Author

@tiagocoelhoma I think I fixed it in PR #851 :)
Could you test it ?

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

No branches or pull requests

4 participants