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

custom_plotting example error #766

Closed
tiagocoelhoma opened this issue Sep 27, 2023 · 4 comments
Closed

custom_plotting example error #766

tiagocoelhoma opened this issue Sep 27, 2023 · 4 comments

Comments

@tiagocoelhoma
Copy link

Hello!

I am trying to implement something with the custom plot functions but now there is a mismatch with the number of arguments given to the plot functions in this newer version of bioptim. Here is the error:

  File "/home/Documents/develop/bioptim/bioptim/gui/plot.py", line 270, in __init__
    self.__create_plots()
  File "/home/Documents/develop/bioptim/bioptim/gui/plot.py", line 375, in __create_plots
    nlp.plot[key]
TypeError: prepare_ocp.<locals>.<lambda>() takes 4 positional arguments but 5 were given

I was wondering if there will be an update on this?

Thank you very much!

@pariterre
Copy link
Member

Dear @tiagocoelhoma

The parameters recently changed in the API, therefore, you may have to change the number of parameters received by your lambda function.

Could you provide us with the custom lambda function you used?

@tiagocoelhoma
Copy link
Author

Hello @pariterre

You can just run the "custom_plotting.py". The error came from there.

@pariterre
Copy link
Member

See #767

@tiagocoelhoma
Copy link
Author

Thank you @pariterre
It is working now!

@Ipuch Ipuch closed this as completed Nov 8, 2023
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

3 participants