Skip to content

Make Animation._start() public? #27571

@doronbehar

Description

@doronbehar

Hello,

This is not exactly a bug report, nor a feature request, but rather more of a development dilemma that I'd like to discuss with you. I hope it's OK to discuss it here and not on discourse, as I feel here much more comfortable with code snippets and attachments, and I think that after a discussion this issue will be actionable as a feature request or a bug report.

I managed to create the following "poor man's GUI" to view results of many simulations in 1 figure:

matplotlib-_start-issue-demonstration.-.trimmed.-.without.issue.webm

Where the black vertical line in the lower right plot shows the progress of the simulation. This seems to behave great right? Apparently, I had to call an animation's _start() function to achieve this. Here are details of the progress:

I used the Data browser code as a starting point. Basically, when self.update is called (every time a simulation is picked), an animation is created using self.anim = animation.FuncAnimation(...). The weird behavior I experienced before using self.anim._start(), is demonstrated in the following video:

matplotlib-_start-issue-demonstration.-.trimmed.-.with.issue.webm

As you can see, the animation never restarts it self, although the self.anim object is assigned a new value every time a simulation is changed - the black time marker in the lower-right plot demonstrates this. Sometimes I experienced that pressing n or p (events handled by the class), in a certain timing, does make the simulation restart, but this is not well defined.

Here is the commit in my code that reproduces the issue I'm describing:

https://gitlab.com/doronbehar/lab-ion-trap-simulations/-/commit/2edc2abbe874ebd2af458f1d4f80710754d8625a

If you really want to reproduce the issue with my data, you will have to trust me with the pickle data I uploaded to this repository, to the branch matplotlib-_start-issue-reproducing.

Sorry for not creating a minimal working example 😬, but I hope you'd be able to discuss the issue although the code that reproduces it is involved in many irrelevant details.

Thanks for your attention!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions