You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a decorator that wraps a function in a progress bar when you expect a specific number of calls to that function.
Use case
As a specific example I'd like to look at creating animations with matplotlib. The workflow is roughly to create a figure and then providing a method to update the figure each frame. When creating the animation matplotlib repeatedly calls the update method. Matplotlib does not support a progress bar as far as I know, however, if we wrap the update method ourselves we could still provide the user with feedback on the progress of their animation.
Matplotlib will call update exactly len(X) times causing tqdm to update the progress bar accordingly. In this example X and Y are some fictional data arrays.
The text was updated successfully, but these errors were encountered:
Proposed enhancement
Add a decorator that wraps a function in a progress bar when you expect a specific number of calls to that function.
Use case
As a specific example I'd like to look at creating animations with matplotlib. The workflow is roughly to create a figure and then providing a method to update the figure each frame. When creating the animation matplotlib repeatedly calls the update method. Matplotlib does not support a progress bar as far as I know, however, if we wrap the update method ourselves we could still provide the user with feedback on the progress of their animation.
Proposed implementation
In the example of the matplotlib animation it can then be used as such:
Matplotlib will call
update
exactlylen(X)
times causingtqdm
to update the progress bar accordingly. In this exampleX
andY
are some fictional data arrays.The text was updated successfully, but these errors were encountered: