Skip to content

Commit

Permalink
Remove deprecated parameters and animations (#3688)
Browse files Browse the repository at this point in the history
* Remove deprecated parameters/animations

* Remove test

* Remove test data
  • Loading branch information
JasonGrace2282 committed Apr 11, 2024
1 parent a6da37b commit 294313d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 38 deletions.
11 changes: 0 additions & 11 deletions manim/animation/indication.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def construct(self):
"Flash",
"ShowPassingFlash",
"ShowPassingFlashWithThinningStrokeWidth",
"ShowCreationThenFadeOut",
"ApplyWave",
"Circumscribe",
"Wiggle",
Expand Down Expand Up @@ -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.
Expand Down
32 changes: 12 additions & 20 deletions manim/utils/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Binary file not shown.
7 changes: 0 additions & 7 deletions tests/test_graphical_units/test_indication.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ def test_ShowPassingFlash(scene):
scene.play(ShowPassingFlash(square.copy()))


@frames_comparison(last_frame=False)
def test_ShowCreationThenFadeOut(scene):
square = Square()
scene.add(square)
scene.play(ShowCreationThenFadeOut(square.copy()))


@frames_comparison(last_frame=False)
def test_ApplyWave(scene):
square = Square()
Expand Down

0 comments on commit 294313d

Please sign in to comment.