-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Added Docstring/Example for :meth:always_redraw
#3312
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
always_redraw
jsonvillanueva
left a comment
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.
Thanks for the doc snippet! The TangentAnimation gives two good examples of always_redraw. I would only shorten the run_time to make the animation render quicker during our Read the Docs (RTD) builds and also make the video size a bit smaller (most docs animations are short for this reason).
Co-authored-by: Jason Villanueva <[email protected]>
|
@jsonvillanueva I took your suggestion. Any other commends or todo's? |
behackl
left a comment
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.
Looking good, thank you for your efforts! I've left some more comments, please have a look.
| return mobject | ||
|
|
||
|
|
||
| def always_redraw(func): |
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.
while we are at it, we could probably also add a type hint for func, it should be something like Callable[[], Mobject] (with Callable from collections.abc) I guess.
Co-authored-by: Benjamin Hackl <[email protected]>
for more information, see https://pre-commit.ci
|
@behackl I updated my PR to reflect your suggestions. |
behackl
left a comment
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.
Sorry, it seems I failed to comment one final suggestion that I had that added an explicit parameter description -- and while fixing that, I also saw that the return type of the function was missing.
After this, I'm happy and ready to merge though; thank you!
Co-authored-by: Benjamin Hackl <[email protected]>
Co-authored-by: Benjamin Hackl <[email protected]>
|
@behackl Implemented your suggestions! |
behackl
left a comment
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.
Thanks again!
Overview: What does this pull request change?
always_redrawlambda m: mob.become(func())tolambda _: mob.become(func())for clarityMotivation and Explanation: Why and how do your changes improve the library?
There wasn't much of an example for
always_redraw, which might've helped with learning how to use updators and such.Links to added or changed documentation pages
https://manimce--3312.org.readthedocs.build/en/3312/reference/manim.animation.updaters.mobject_update_utils.html
Reviewer Checklist