Skip to content

Instantly share code, notes, and snippets.

@thomaslima
Last active January 20, 2022 10:53
Show Gist options
  • Save thomaslima/d8e795c908f334931354da95acb97e54 to your computer and use it in GitHub Desktop.
Save thomaslima/d8e795c908f334931354da95acb97e54 to your computer and use it in GitHub Desktop.
Progress bar of scipy ode solver with tqdm
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thomaslima
Copy link
Author

Thank you for pointing this out. The issue is that tqdm doesn't offer a native manual update operation where you can go back in time. They only offer this .update method which is supposed to be used with "increments". If I may ask, what is the behavior of the progress bar in your ODE? How bit is that first step compared to the T1-T0 range?

A workaround you can use is to catch the desired behavior using if statements and only call pbar.update when you know for sure that t is increasing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment