animation.py: Stop event sources instead of nulling them on animation stop - #32296
DavidVadnais wants to merge 1 commit into
Conversation
|
Thank you for opening your first PR into Matplotlib! If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks. We also ask that you please finish addressing any review comments on this PR and wait for it to be merged (or closed) before opening a new one, as it can be a valuable learning experience to go through the review process. You can also join us on discourse chat for real-time discussion. For details on testing, writing docs, and our review process, please see the developer guide. We strive to be a welcoming and open project. Please follow our Code of Conduct. |
I think i need to add a file to |
f4457a1 to
0d2a337
Compare
|
To my understanding, if all the actions pass this PR is ready for review. Please let me know if I’ve missed any pre-review steps |
a4793c2 to
30da2c4
Compare
|
Aloha, I am following up after a week as instructed by the github bot. Let me know what I am missing. |
30da2c4 to
25d78ac
Compare
|
rebasing since this getting out of sync |
|
Hi @DavidVadnais - I am flagging this for review, but our maintainers are currently pretty busy so apologies if it's taking longer than expected. Thanks for the patience! |
|
Sounds good. Thank you for all the work you all do. |
| ``TimedAnimation``/``Animation`` now perform .stop() on mpl_disconnect | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| Previously these classes set ``self.event_source = None`` when | ||
| ``self._fig.canvas.mpl_disconnect`` was called. Now they run | ||
| ``self.event_source.stop()``. |
There was a problem hiding this comment.
This is a very internal description of what changed. Users aren't calling mpl_disconnect on a private _fig attribute.
There was a problem hiding this comment.
I did my best here but let me know if you want further changes.
| Tests that animations now stop the event source instead | ||
| of destroying it on animation completion. |
There was a problem hiding this comment.
Don't really need to mention what happened before.
There was a problem hiding this comment.
Removed reference to previous behavior.
| fig, ax = plt.subplots() | ||
| anim = FuncAnimation(fig, lambda f: [], frames=3) | ||
| anim._start() | ||
| plt.close(fig) |
There was a problem hiding this comment.
This isn't necessary for testing in general, so you should add a comment that it's intentionally there.
25d78ac to
56456bf
Compare
PR summary
Closes: #30622
Followed issue link to #30590. Then followed suggestions made there.
code to exercise this change
Output before change
Output after change
AI Disclosure
Used ai to help me find an easy issue to try and dip my toe in the water. Then had it write the exercising code.
PR quality check