-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Distinguish AbstractMovieWriter and MovieWriter in docs. #21948
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
Conversation
doc/api/animation_api.rst
Outdated
Fundamentally, an `AbstractMovieWriter` provides a way to grab sequential | ||
frames from the same underlying `~matplotlib.figure.Figure` object. The | ||
base `AbstractMovieWriter` class implements 3 methods and a context manager. | ||
The only difference between the pipe-based and file-based writers is in the | ||
arguments to their respective ``setup`` methods. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fundamentally, an `AbstractMovieWriter` provides a way to grab sequential | |
frames from the same underlying `~matplotlib.figure.Figure` object. The | |
base `AbstractMovieWriter` class implements 3 methods and a context manager. | |
The only difference between the pipe-based and file-based writers is in the | |
arguments to their respective ``setup`` methods. | |
The writer classes provide a way to grab sequential frames from the same | |
underlying `~matplotlib.figure.Figure` object. They all provide 3 methods | |
that must be called in sequence: | |
- `~-AbstractMovieWriter.setu 8000 p` prepares the writer (e.g. opening a pipe). | |
Pipe-based and file-based writers take different arguments to ``setup()``. | |
- `~.AbstractMovieWriter.grab_frame` can then be called as often as | |
needed to capture a single frame at a time | |
- `~.AbstractMovieWriter.finish` finalizes the movie and writes the output | |
file to disk. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO it doesn't make sense to specifically mention AbstractMovieWriter
because nobody will use that class. Instead, we can more informally say "all writer classes".
Note also that #21954 moves the ineritance diagram here and adds missing classes, which should make the relations more clear.
doc/api/animation_api.rst
Outdated
The `~AbstractMovieWriter.setup` method is used to prepare the writer (possibly | ||
opening a pipe), successive calls to `~.AbstractMovieWriter.grab_frame` capture | ||
a single frame at a time and `~.AbstractMovieWriter.finish` finalizes the movie | ||
and writes the output file to disk. For example :: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The `~AbstractMovieWriter.setup` method is used to prepare the writer (possibly | |
opening a pipe), successive calls to `~.AbstractMovieWriter.grab_frame` capture | |
a single frame at a time and `~.AbstractMovieWriter.finish` finalizes the movie | |
and writes the output file to disk. For example :: | |
Example:: |
Thanks @timhoffm, I've integrated your changes, they look great. I also updated an example a bit earlier in the text to use 4-space indents. |
Some docs of AbstractMovieWriter are still written as if referring to MovieWriter (which could be better named PipeMovieWriter, i.e. writers that pipe frame data to a running subprocess). This probably dates back to when AbstractMovieWriter was not a thing yet. Fix that.
…ieWriter in docs.
…948-on-v3.5.x Backport PR #21948 on branch v3.5.x (Distinguish AbstractMovieWriter and MovieWriter in docs.)
Some docs of AbstractMovieWriter are still written as if referring to
MovieWriter (which could be better named PipeMovieWriter, i.e. writers
that pipe frame data to a running subprocess). This probably dates
back to when AbstractMovieWriter was not a thing yet.
Fix that.
PR Summary
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).