Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use collections.deque to store animation cache data.#30206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jkseppan merged 1 commit intomatplotlib:mainfromanntzer:ad
Jun 24, 2025

Conversation

anntzer
Copy link
Contributor

deques are exactly suited for the task at hand, and should be (here, marginally) more efficient than repeatedly slicing off the start of the list.

Also drop unneeded reference to old_frame_seq (the iterator already keeps that data alive).

PR summary

PR checklist

Copy link
Member

@QuLogicQuLogic left a comment

Choose a reason for hiding this comment

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

There is aself._save_seq = [] in_init_draw that was missed.


super().__init__(fig, **kwargs)

# Need to reset the saved seq, since right now it will contain data
# for a single frame from init, which is not what we want.
self._save_seq =[]
self._save_seq =collections.deque([], self._save_count)
Copy link
Member

Choose a reason for hiding this comment

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

Can't just clear it?

Suggested change
self._save_seq=collections.deque([],self._save_count)
self._save_seq.clear()

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

sure, even better.

deques are exactly suited for the task at hand, and should be (here,marginally) more efficient than repeatedly slicing off the start of thelist.Also drop unneeded reference to old_frame_seq (the iterator alreadykeeps that data alive).
@anntzer
Copy link
ContributorAuthor

thanks, fixed

@jkseppanjkseppan added this to thev3.11.0 milestoneJun 24, 2025
@jkseppanjkseppan merged commit0dcd06f intomatplotlib:mainJun 24, 2025
40 checks passed
@anntzeranntzer deleted the ad branchJune 24, 2025 15:55
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jkseppanjkseppanjkseppan approved these changes

@QuLogicQuLogicQuLogic approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.11.0
Development

Successfully merging this pull request may close these issues.

3 participants
@anntzer@jkseppan@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp