Closed YBCS closed 1 month ago
Can we also add saving of animations? Looks simple enough?
https://matplotlib.org/stable/users/explain/animations/animations.html#funcanimation
Saving animation is simple. But after some testing with the plots in the codebase I have identified some issues.
Animation is actually very expensive and so it takes lots of time. I have encountered plots with >= 10000 (link) In my machine saving animation plot with data length 1000 can take more almost a minute. Plot is a generic function, it is probably not a good idea if the plot will have lots of data.
On the other hand the script can choose not to save animation if the provided data point is too long. 1000 is a good threshold as it can save the animation within 1 minute.
Can we also add saving of animations? Looks simple enough? https://matplotlib.org/stable/users/explain/animations/animations.html#funcanimation
Saving animation is simple. But after some testing with the plots in the codebase I have identified some issues.
Animation is actually very expensive and so it takes lots of time. I have encountered plots with >= 10000 (link) In my machine saving animation plot with data length 1000 can take more almost a minute. Plot is a generic function, it is probably not a good idea if the plot will have lots of data.
On the other hand the script can choose not to save animation if the provided data point is too long. 1000 is a good threshold as it can save the animation within 1 minute.
We can probably just document this in the method docstring and leave it for the user to decide. Often people in research labs have quite good computers, with lots of memory + good cores + gpus and all that. So, in such cases, they may be able to generate animations with more data points. So, it's best to include the functionality and document it. That way users can play around with a few parameters like "duration" and generate what works for them. What do you think?
LGTM, merging. I'll make a few tweaks in my branch and merge to development :+1:
@all-contributors please add @YBCS for code, test
@sanjayankur31
I've put up a pull request to add @YBCS! :tada:
279 wip fix
we can only use this feature if
show_plot_already
is set toTrue