Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update example and docstring to encourage the use of functools.partial in FuncAnimation #24238

Merged
merged 4 commits into from Nov 1, 2022

Conversation

oscargus
Copy link
Contributor

PR Summary

Fixes #20326
Closes #20358
Closes #24139

Merged contents from #20358 and #24139 with comments. Probably have missed something...

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

doc/api/animation_api.rst Outdated Show resolved Hide resolved
@tacaswell
Copy link
Member

I would prefer to show passing the artist in via the partial rather than the data. The goal is to be able to write (or import) your update function in a way that does not require it to be able to capture the artist to be updated in the closure.

Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
@oscargus
Copy link
Contributor Author

Am I right in believing that the example is now doing that? (I fixed a few things to make it work...)

doc/api/animation_api.rst Outdated Show resolved Hide resolved
doc/api/animation_api.rst Outdated Show resolved Hide resolved
@oscargus
Copy link
Contributor Author

oscargus commented Nov 1, 2022

Can someone please have a final look at this?

@ksunden ksunden added this to the v3.6.2 milestone Nov 1, 2022
@ksunden ksunden merged commit 185a421 into matplotlib:main Nov 1, 2022
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Nov 1, 2022
…ge the use of functools.partial in FuncAnimation
timhoffm added a commit that referenced this pull request Nov 1, 2022
…238-on-v3.6.x

Backport PR #24238 on branch v3.6.x (Update example and docstring to encourage the use of functools.partial in FuncAnimation)
@oscargus oscargus deleted the mpl-20326 branch November 2, 2022 07:44
@ksunden ksunden mentioned this pull request Feb 20, 2023
6 tasks
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.

FuncAnimation Named Arguments
6 participants