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

Skip to content

Document that TimedAnimation should not be used#31512

Merged
timhoffm merged 1 commit intomatplotlib:mainfrom
QuLogic:no-timed-anim
Apr 18, 2026
Merged

Document that TimedAnimation should not be used#31512
timhoffm merged 1 commit intomatplotlib:mainfrom
QuLogic:no-timed-anim

Conversation

@QuLogic
Copy link
Copy Markdown
Member

@QuLogic QuLogic commented Apr 17, 2026

PR summary

This copies the text from Animation.

Fixes #30831

AI Disclosure

None

PR checklist

Comment thread lib/matplotlib/animation.py Outdated
Comment on lines +1428 to +1429
This class is not usable as is, and should be subclassed to provide needed
behavior.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dunno which admonition it should get but I feel like this should be an admonition at the very top of the docstring
https://pydata-sphinx-theme.readthedocs.io/en/stable/examples/kitchen-sink/admonitions.html

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just went with a normal .. warning::.

Comment thread lib/matplotlib/animation.py Outdated
behavior.
.. warning::

This class is not usable as is, and should be subclassed to provide needed
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message is a bit vague. Let’s instead just say

Abstract base class for Animations.

in the summary line.

Precedent: https://matplotlib.org/devdocs/api/artist_api.html#artist-class

Copy link
Copy Markdown
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accidentally clicked approve instead of request changes.

Comment thread lib/matplotlib/animation.py Outdated
Comment on lines +1421 to +1428
@@ -1425,6 +1422,11 @@ class TimedAnimation(Animation):

A new frame is drawn every *interval* milliseconds.

.. warning::

This class is not usable as is, and should be subclassed to provide needed
behavior.
Copy link
Copy Markdown
Member

@timhoffm timhoffm Apr 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
behavior.
Abstract `Animation` subclass for time-based animation.
A new frame is drawn every *interval* milliseconds.

Edit:

GitHub suggestion scope is buggy. What I meant here is: Do not use a warning either but change the summary line

Animation subclass for time-based animation.

->

Abstract Animation subclass for time-based animation.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you meant to delete the warning on this one as well?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

And also similarly change `Animation`.

Fixes matplotlib#30831
@timhoffm timhoffm merged commit dde0763 into matplotlib:main Apr 18, 2026
37 of 38 checks passed
@QuLogic QuLogic deleted the no-timed-anim branch April 19, 2026 05:12
@QuLogic QuLogic added this to the v3.11.0 milestone Apr 19, 2026
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.

[Bug]: AttributeError: 'TimedAnimation' object has no attribute '_framedata'

3 participants