From 294313d683567b4960063c45ab15d5c465e0cc75 Mon Sep 17 00:00:00 2001 From: adeshpande <110117391+JasonGrace2282@users.noreply.github.com> Date: Thu, 11 Apr 2024 13:49:02 -0400 Subject: [PATCH] Remove deprecated parameters and animations (#3688) * Remove deprecated parameters/animations * Remove test * Remove test data --- manim/animation/indication.py | 11 ------ manim/utils/paths.py | 32 +++++++----------- .../indication/ShowCreationThenFadeOut.npz | Bin 9879 -> 0 bytes tests/test_graphical_units/test_indication.py | 7 ---- 4 files changed, 12 insertions(+), 38 deletions(-) delete mode 100644 tests/test_graphical_units/control_data/indication/ShowCreationThenFadeOut.npz diff --git a/manim/animation/indication.py b/manim/animation/indication.py index db2640d5a5..01a0e619a5 100644 --- a/manim/animation/indication.py +++ b/manim/animation/indication.py @@ -31,7 +31,6 @@ def construct(self): "Flash", "ShowPassingFlash", "ShowPassingFlashWithThinningStrokeWidth", - "ShowCreationThenFadeOut", "ApplyWave", "Circumscribe", "Wiggle", @@ -342,16 +341,6 @@ def __init__(self, vmobject, n_segments=10, time_width=0.1, remover=True, **kwar ) -@deprecated( - since="v0.15.0", - until="v0.16.0", - message="Use Create then FadeOut to achieve this effect.", -) -class ShowCreationThenFadeOut(Succession): - def __init__(self, mobject: Mobject, remover: bool = True, **kwargs) -> None: - super().__init__(Create(mobject), FadeOut(mobject), remover=remover, **kwargs) - - class ApplyWave(Homotopy): """Send a wave through the Mobject distorting it temporarily. diff --git a/manim/utils/paths.py b/manim/utils/paths.py index 9d7ec10d73..4cf867b428 100644 --- a/manim/utils/paths.py +++ b/manim/utils/paths.py @@ -10,28 +10,22 @@ ] -from typing import Callable +from typing import TYPE_CHECKING import numpy as np from ..constants import OUT from ..utils.bezier import interpolate -from ..utils.deprecation import deprecated_params from ..utils.space_ops import rotation_matrix -STRAIGHT_PATH_THRESHOLD = 0.01 +if TYPE_CHECKING: + from manim.typing import PathFuncType, Vector3D + -PATH_FUNC_TYPE = Callable[[np.ndarray, np.ndarray, float], np.ndarray] +STRAIGHT_PATH_THRESHOLD = 0.01 -# Remove `*args` and the `if` inside the functions when removing deprecation -@deprecated_params( - params="start_points, end_points, alpha", - since="v0.14", - until="v0.15", - message="Straight path is now returning interpolating function to make it consistent with other path functions. Use straight_path()(a,b,c) instead of straight_path(a,b,c).", -) -def straight_path(*args) -> PATH_FUNC_TYPE: +def straight_path(): """Simplest path function. Each point in a set goes in a straight path toward its destination. Examples @@ -74,14 +68,12 @@ def construct(self): self.wait() """ - if len(args) > 0: - return interpolate(*args) return interpolate def path_along_circles( - arc_angle: float, circles_centers: np.ndarray, axis: np.ndarray = OUT -) -> PATH_FUNC_TYPE: + arc_angle: float, circles_centers: np.ndarray, axis: Vector3D = OUT +) -> PathFuncType: """This function transforms each point by moving it roughly along a circle, each with its own specified center. The path may be seen as each point smoothly changing its orbit from its starting position to its destination. @@ -158,7 +150,7 @@ def path(start_points: np.ndarray, end_points: np.ndarray, alpha: float): return path -def path_along_arc(arc_angle: float, axis: np.ndarray = OUT) -> PATH_FUNC_TYPE: +def path_along_arc(arc_angle: float, axis: Vector3D = OUT) -> PathFuncType: """This function transforms each point by moving it along a circular arc. Parameters @@ -225,7 +217,7 @@ def path(start_points: np.ndarray, end_points: np.ndarray, alpha: float): return path -def clockwise_path() -> PATH_FUNC_TYPE: +def clockwise_path() -> PathFuncType: """This function transforms each point by moving clockwise around a half circle. Examples @@ -271,7 +263,7 @@ def construct(self): return path_along_arc(-np.pi) -def counterclockwise_path() -> PATH_FUNC_TYPE: +def counterclockwise_path() -> PathFuncType: """This function transforms each point by moving counterclockwise around a half circle. Examples @@ -317,7 +309,7 @@ def construct(self): return path_along_arc(np.pi) -def spiral_path(angle: float, axis: np.ndarray = OUT) -> PATH_FUNC_TYPE: +def spiral_path(angle: float, axis: Vector3D = OUT) -> PathFuncType: """This function transforms each point by moving along a spiral to its destination. Parameters diff --git a/tests/test_graphical_units/control_data/indication/ShowCreationThenFadeOut.npz b/tests/test_graphical_units/control_data/indication/ShowCreationThenFadeOut.npz deleted file mode 100644 index ecd0ebf1b436424be18bd04d877498d42bfddda1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9879 zcmeHNe{33M7(Uw7DT~8t)x^ybW1`uzl|MALv;1(0v(d&CXSN!lutr^z)xt{MCw!vOzpSPG9r4>O@3mA*4k~EC z1Hc&nHL527R6Ld60rQjRBwr?*kNE}$WR{NyP8%*CsoYsdyYG1U+43uV{%0R<{rrVB z?V5XP>08{A-M<5UGR8hvM~hLlg_(RwR^LLOQwOZ(ri(v5)@09Kils3))eC2WFmaSc z5+|~WR1Zp~FgTr>K-GjkyGRE0_H>E~#t|6APe7zitj1kZGn_pk&RjLa1c5<>4o>t) zp=_4doqd|8#$!BU&VZ2%0cbG|kqN39M6#i@gJnuq z9{J^h?bmhRoV|byi8K{MAyd3;>sRfiQ~tvf6Is$epHBusJZ$QZy)>0bB9W|znf1f@ zm=qO^igqw#is|WTVHm>#nYkL+%I0tga}|@x`xo5B+)Ku85G1cDL)=t|*4674?73co z_wv5oBNE)R#TNs|yKhwOSWJ5F>2{ zK}AGC1#Wu=+~mv0q^M9;yn_jJ$mKbZzoJm7@_a$&bW9q@SZ>Vk_eVBHH?w&>Xnu5b zl#{td?1u=&0vg>cl%C2x^p3BA+Byqe^KIwqY}nj_xCbQ{^FqVt`<~+6pGv&DWWZCr zYqQxXfib}5a`RFRQUcyNB8~S1@n}?*xIbChuh;Vyy0wq) zO^r4u4`L*dcEyzn#rDiG6@6l2f~k~BrHnk3<9nN-D#D_oyEpoC>B#gJV0_$IHZ%Ws z_$hF_5~#ylh5!OJCAV|h)TnL{?Q zNL1a}*cdaNkvu#W@KeExq&wcv$7I!Fc4;@>=R^?1@6a-~yTf0gRT@iju2)*^#+*!u zodGH89uLY(2FHromz2Sww>wvdJ9;^n}c8%%kt^=<<~{~oxT6v|vNQ3~wHn#}htAhSug*+wC_mKL&`Pr$?Y`UBERO$+C`TysPGS*^Ur{fj z<&jTyI-T>T9fliWCeL?+?JXP*lolzMeZjTgL)q8FFd~Va%%!DLg;H5ZfPKCj+%!fj z4)_%NC^YD-%*r;o+it@f$8ieYcKfapyjQxOfP!~C9v>E&3-GoIs|~2`nN3J*mQ(Dw zDw6R