Skip to content

Conversation

@colleenjg
Copy link
Contributor

Since creating animations can take a long time (tens of minutes), it can be helpful to know how long it's going to take/whether the animation is almost complete.

So I added a keyword argument (progress_bar) that adds a progress bar when creating animations with ratinabox. I only added it to the modules (not to the notebooks) that call matplotlib.animation.FuncAnimation: Neurons.animate_rate_timeseries() and Agent.animate_trajectory().

I set the default to False to avoid changing existing behaviour. The progress bar is created through tqdm which is imported only if progress_bar is True. Here is an example from a notebook. It shows what frame you're at, and estimates the total time too.

progress_bar

@colleenjg
Copy link
Contributor Author

Ok, I should mention though, it stalls at the last frame when doing the saving, which can take quite a long time, somewhat defeating the purpose. Not sure how to fix that.

@TomGeorge1234
Copy link
Collaborator

Wonderful!! The stall isn't a problem, at least it's better than nothing and it will be valid if users turn the saving function off.

Thanks so much!

@TomGeorge1234 TomGeorge1234 merged commit 1ec591a into RatInABox-Lab:main May 27, 2025
3 checks passed
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.

2 participants