Thanks to visit codestin.com
Credit goes to github.com

Skip to content

animation.py: Stop event sources instead of nulling them on animation stop - #32296

Open
DavidVadnais wants to merge 1 commit into
matplotlib:mainfrom
DavidVadnais:fix-issue-#30622
Open

animation.py: Stop event sources instead of nulling them on animation stop#32296
DavidVadnais wants to merge 1 commit into
matplotlib:mainfrom
DavidVadnais:fix-issue-#30622

Conversation

@DavidVadnais

@DavidVadnais DavidVadnais commented Sep 4, 2026

Copy link
Copy Markdown

PR summary

Closes: #30622
Followed issue link to #30590. Then followed suggestions made there.

code to exercise this change

import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation

fig, ax = plt.subplots()
anim = FuncAnimation(fig, lambda f: [], frames=3, repeat=False)
anim._start()
while anim._step():
    pass
anim.event_source 

Output before change

None

Output after change

print(anim.event_source)
<matplotlib.backend_bases.TimerBase at 0x...>

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

  • Use an expressive title, e.g. "Fix title font property precedence"
  • New and changed code is tested
  • Plotting related features are demonstrated in an example
  • New features and API changes have release notes
  • Documentation complies with general and docstring guidelines

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

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.
Please let us know if (and how) you use AI, it will help us give you better feedback on your PR.

We strive to be a welcoming and open project. Please follow our Code of Conduct.

@DavidVadnais

Copy link
Copy Markdown
Author

I think i need to add a file to doc/api/next_api_changes/behavior/ named something like animation_stop_event_stop_not_null.rst explaining this change.

@DavidVadnais

Copy link
Copy Markdown
Author

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

@DavidVadnais

Copy link
Copy Markdown
Author

Aloha,

I am following up after a week as instructed by the github bot. Let me know what I am missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MNT]: Stop event sources rather than setting them to None in Animation._stop()

1 participant