Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Removed deprecations up to `v0.13.0` (#2390)

Laith Bahodid66d2b646e11
diff --git a/manim/animation/growing.py b/manim/animation/growing.py
index 35aa51701..f99b72470 100644
--- a/manim/animation/growing.py
+++ b/manim/animation/growing.py
@@ -35,7 +35,6 @@ import numpy as np
from ..animation.transform import Transform
from ..constants import PI
-from ..utils.deprecation import deprecated_params
from ..utils.paths import spiral_path
if typing.TYPE_CHECKING:
@@ -221,10 +220,6 @@ class SpinInFromNothing(GrowFromCenter):
"""
- @deprecated_params(
- params="path_arc",
- message="Parameter angle is more robust, supporting angles greater than PI.",
- )
def __init__(
self,
mobject: "Mobject",
@@ -232,10 +227,7 @@ class SpinInFromNothing(GrowFromCenter):
point_color: str = None,
**kwargs
) -> None:
- if "path_arc" in kwargs:
- super().__init__(mobject, point_color=point_color, **kwargs)
- else:
- self.angle = angle
- super().__init__(
- mobject, path_func=spiral_path(angle), point_color=point_color, **kwargs
- )
+ self.angle = angle
+ super().__init__(
+ mobject, path_func=spiral_path(angle), point_color=point_color, **kwargs
+ )
diff --git a/manim/mobject/coordinate_systems.py b/manim/mobject/coordinate_systems.py
index 18b4c0995..aafb718fc 100644
--- a/manim/mobject/coordinate_systems.py
+++ b/manim/mobject/coordinate_systems.py
@@ -54,7 +54,6 @@ from ..utils.color import (
invert_color,
)
from ..utils.config_ops import merge_dicts_recursively, update_dict_recursively
-from ..utils.deprecation import deprecated, deprecated_params
from ..utils.simple_functions import binary_search
from ..utils.space_ops import angle_of_vector
@@ -754,19 +753,6 @@ class CoordinateSystem:
graph.underlying_function = function
return graph
- @deprecated(
- since="v0.11.0",
- until="v0.13.0",
- replacement="plot",
- )
- def get_graph(
- self,
- function: Callable[[float], float],
- x_range: Optional[Sequence[float]] = None,
- **kwargs,
- ) -> ParametricFunction:
- return self.plot(function, x_range, **kwargs)
-
def plot_implicit_curve(
self,
func: Callable,
@@ -815,20 +801,6 @@ class CoordinateSystem:
)
return graph
- @deprecated(
- since="v0.11.0",
- until="v0.13.0",
- replacement="plot_implicit_curve",
- )
- def get_implicit_curve(
- self,
- func: Callable,
- min_depth: int = 5,
- max_quads: int = 1500,
- **kwargs,
- ) -> ImplicitFunction:
- return self.plot_implicit_curve(func, min_depth, max_quads, **kwargs)
-
def plot_parametric_curve(self, function, **kwargs):
dim = self.dimension
graph = ParametricFunction(
@@ -837,14 +809,6 @@ class CoordinateSystem:
graph.underlying_function = function
return graph
- @deprecated(
- since="v0.11.0",
- until="v0.13.0",
- replacement="plot_parametric_curve",
- )
- def get_parametric_curve(self, function, **kwargs):
- return self.plot_parametric_curve(function, **kwargs)
-
def plot_polar_graph(
self,
r_func: Callable[[float], float],
@@ -1437,16 +1401,6 @@ class CoordinateSystem:
return self.plot(deriv, color=color, **kwargs)
- @deprecated(
- since="v0.11.0",
- until="v0.13.0",
- replacement="plot_derivative_graph",
- )
- def get_derivative_graph(
- self, graph: "ParametricFunction", color: Color = GREEN, **kwargs
- ) -> ParametricFunction:
- return self.plot_derivative_graph(graph, color, **kwargs)
-
def plot_antiderivative_graph(
self,
graph: ParametricFunction,
@@ -2106,33 +2060,6 @@ class Axes(VGroup, CoordinateSystem, metaclass=ConvertToOpenGL):
return line_graph
- @deprecated(
- since="v0.11.0",
- until="v0.13.0",
- replacement="plot_line_graph",
- )
- def get_line_graph(
- self,
- x_values: Iterable[float],
- y_values: Iterable[float],
- z_values: Optional[Iterable[float]] = None,
- line_color: Color = YELLOW,
- add_vertex_dots: bool = True,
- vertex_dot_radius: float = DEFAULT_DOT_RADIUS,
- vertex_dot_style: Optional[dict] = None,
- **kwargs,
- ) -> VDict:
- return self.plot_line_graph(
- x_values,
- y_values,
- z_values,
- line_color,
- add_vertex_dots,
- vertex_dot_radius,
- vertex_dot_style,
- **kwargs,
- )
-
@staticmethod
def _origin_shift(axis_range: Sequence[float]) -> float:
"""Determines how to shift graph mobjects to compensate when 0 is not on the axis.
diff --git a/manim/mobject/frame.py b/manim/mobject/frame.py
index 1654088e5..bdc794bbe 100644
--- a/manim/mobject/frame.py
+++ b/manim/mobject/frame.py
@@ -3,17 +3,12 @@
__all__ = [
"ScreenRectangle",
"FullScreenRectangle",
- "FullScreenFadeRectangle",
- "PictureInPictureFrame",
]
-from manim.utils.deprecation import deprecated
-
from .. import config
from ..constants import *
from ..mobject.geometry import Rectangle
-from ..utils.color import BLACK
class ScreenRectangle(Rectangle):
@@ -39,43 +34,3 @@ class FullScreenRectangle(ScreenRectangle):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.height = config["frame_height"]
-
-
-@deprecated(
- since="v0.12.0",
- until="v0.13.0",
- message="This method is deprecated due to decluttering purpose.",
- replacement="FullScreenRectangle(stroke_width=0, fill_color=BLACK, fill_opacity=0.7)",
-)
-class FullScreenFadeRectangle(FullScreenRectangle):
- def __init__(self, stroke_width=0, fill_color=BLACK, fill_opacity=0.7, **kwargs):
- super().__init__(
- stroke_width=stroke_width,
- fill_color=fill_color,
- fill_opacity=fill_opacity,
- **kwargs
- )
-
-
-@deprecated(
- since="v0.12.0",
- until="v0.13.0",
- message="This method is deprecated due to decluttering purpose.",
-)
-class PictureInPictureFrame(Rectangle):
- def __init__(self, height=3, aspect_ratio=16.0 / 9.0, **kwargs):
- super().__init__(width=aspect_ratio * height, height=height, **kwargs)
-
- @property
- def aspect_ratio(self):
- """The aspect ratio.
-
- When set, the width is stretched to accommodate
- the new aspect ratio.
- """
-
- return self.width / self.height
-
- @aspect_ratio.setter
- def aspect_ratio(self, value):
- self.stretch_to_fit_width(value * self.height)
diff --git a/manim/mobject/number_line.py b/manim/mobject/number_line.py
index 7e144ea1b..17c4dddf9 100644
--- a/manim/mobject/number_line.py
+++ b/manim/mobject/number_line.py
@@ -17,7 +17,6 @@ from ..mobject.numbers import DecimalNumber
from ..mobject.types.vectorized_mobject import VGroup
from ..utils.bezier import interpolate
from ..utils.config_ops import merge_dicts_recursively
-from ..utils.deprecation import deprecated_params
from ..utils.simple_functions import fdiv
from ..utils.space_ops import normalize
diff --git a/manim/mobject/opengl_mobject.py b/manim/mobject/opengl_mobject.py
index 175554612..cfc305857 100644
--- a/manim/mobject/opengl_mobject.py
+++ b/manim/mobject/opengl_mobject.py
@@ -16,7 +16,6 @@ from ..utils.bezier import integer_interpolate, interpolate
from ..utils.color import *
from ..utils.color import Colors
from ..utils.config_ops import _Data, _Uniforms
-from ..utils.deprecation import deprecated
# from ..utils.iterables import batch_by_property
from ..utils.iterables import (
@@ -822,17 +821,6 @@ class OpenGLMobject:
self.assemble_family()
return self
- @deprecated(
- since="v0.12.0",
- until="v0.13.0",
- replacement="self.submobjects",
- message="Switching to using properties for submobjects",
- )
- def set_submobjects(self, submobject_list):
- self.remove(*self.submobjects)
- self.add(*submobject_list)
- return self
-
def invert(self, recursive=False):
"""Inverts the list of :attr:`submobjects`.
diff --git a/manim/mobject/svg/brace.py b/manim/mobject/svg/brace.py
index e378fc9df..a68dd909a 100644
--- a/manim/mobject/svg/brace.py
+++ b/manim/mobject/svg/brace.py
@@ -18,7 +18,6 @@ from ...mobject.svg.svg_path import SVGPathMobject
from ...mobject.svg.tex_mobject import MathTex, Tex
from ...mobject.types.vectorized_mobject import VMobject
from ...utils.color import BLACK
-from ...utils.deprecation import deprecated_params
class Brace(SVGPathMobject):
diff --git a/manim/mobject/svg/code_mobject.py b/manim/mobject/svg/code_mobject.py
index 41d946737..3986c1f7d 100644
--- a/manim/mobject/svg/code_mobject.py
+++ b/manim/mobject/svg/code_mobject.py
@@ -20,7 +20,6 @@ from ...mobject.shape_matchers import SurroundingRectangle
from ...mobject.svg.text_mobject import Paragraph
from ...mobject.types.vectorized_mobject import VGroup
from ...utils.color import WHITE
-from ...utils.deprecation import deprecated_params
class Code(VGroup):
diff --git a/manim/mobject/svg/tex_mobject.py b/manim/mobject/svg/tex_mobject.py
index acabada05..07017ad1c 100644
--- a/manim/mobject/svg/tex_mobject.py
+++ b/manim/mobject/svg/tex_mobject.py
@@ -35,7 +35,6 @@ from ...mobject.svg.svg_mobject import SVGMobject
from ...mobject.svg.svg_path import SVGPathMobject
from ...mobject.types.vectorized_mobject import VectorizedPoint, VGroup
from ...utils.color import BLACK, WHITE
-from ...utils.deprecation import deprecated_params
from ...utils.tex_file_writing import tex_to_svg_file
from .style_utils import parse_style
diff --git a/manim/mobject/svg/text_mobject.py b/manim/mobject/svg/text_mobject.py
index 373cf6451..e8c362d04 100644
--- a/manim/mobject/svg/text_mobject.py
+++ b/manim/mobject/svg/text_mobject.py
@@ -69,7 +69,6 @@ from ...mobject.geometry import Dot
from ...mobject.svg.svg_mobject import SVGMobject
from ...mobject.types.vectorized_mobject import VGroup
from ...utils.color import WHITE, Colors
-from ...utils.deprecation import deprecated_params
TEXT_MOB_SCALE_FACTOR = 0.05
DEFAULT_LINE_SPACING_SCALE = 0.3
diff --git a/manim/mobject/three_dimensions.py b/manim/mobject/three_dimensions.py
index c1f52fd5f..5b2679963 100644
--- a/manim/mobject/three_dimensions.py
+++ b/manim/mobject/three_dimensions.py
@@ -30,7 +30,7 @@ from ..mobject.mobject import *
from ..mobject.opengl_mobject import OpenGLMobject
from ..mobject.types.vectorized_mobject import VGroup, VMobject
from ..utils.color import *
-from ..utils.deprecation import deprecated, deprecated_params
+from ..utils.deprecation import deprecated
from ..utils.iterables import tuplify
from ..utils.space_ops import normalize, perpendicular_bisector, z_to_vector
diff --git a/manim/mobject/vector_field.py b/manim/mobject/vector_field.py
index b92be50c9..f8d511b93 100644
--- a/manim/mobject/vector_field.py
+++ b/manim/mobject/vector_field.py
@@ -26,7 +26,6 @@ from ..mobject.mobject import Mobject
from ..mobject.types.vectorized_mobject import VGroup, VMobject
from ..utils.bezier import interpolate, inverse_interpolate
from ..utils.color import BLUE_E, GREEN, RED, YELLOW, color_to_rgb, rgb_to_color
-from ..utils.deprecation import deprecated_params
from ..utils.rate_functions import ease_out_sine, linear
from ..utils.simple_functions import sigmoid
from .types.opengl_vectorized_mobject import OpenGLVMobject