forked from ManimCommunity/manim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: set_default for Animation class (ManimCommunity#3876)
* feat: Animation.set_default Adds set_default class method to Animation class based on existing implementation for Mobject class. Addresses issue ManimCommunity#3142 * test: added missing test * fix: docstring formatting --------- Co-authored-by: Benjamin Hackl <[email protected]>
- Loading branch information
1 parent
c8fe4d9
commit 0843632
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from manim import * | ||
from manim.animation.animation import DEFAULT_ANIMATION_RUN_TIME | ||
|
||
__module_test__ = "animation" | ||
|
||
|
||
def test_animation_set_default(): | ||
s = Square() | ||
Rotate.set_default(run_time=100) | ||
anim = Rotate(s) | ||
assert anim.run_time == 100 | ||
anim = Rotate(s, run_time=5) | ||
assert anim.run_time == 5 | ||
Rotate.set_default() | ||
anim = Rotate(s) | ||
assert anim.run_time == DEFAULT_ANIMATION_RUN_TIME |