From 47326d2f00b72637dc890a4a70b54cbab68028c6 Mon Sep 17 00:00:00 2001 From: JasonGrace2282 Date: Tue, 26 Dec 2023 13:54:15 -0500 Subject: [PATCH 1/2] Fix Deprecation warnings in cairo tests --- manim/animation/transform_matching_parts.py | 2 +- manim/mobject/graphing/number_line.py | 2 +- manim/mobject/svg/svg_mobject.py | 4 ++-- manim/mobject/text/text_mobject.py | 2 +- manim/mobject/value_tracker.py | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/manim/animation/transform_matching_parts.py b/manim/animation/transform_matching_parts.py index 8c97643860..dbf5dd294e 100644 --- a/manim/animation/transform_matching_parts.py +++ b/manim/animation/transform_matching_parts.py @@ -225,7 +225,7 @@ def get_mobject_parts(mobject: Mobject) -> list[Mobject]: def get_mobject_key(mobject: Mobject) -> int: mobject.save_state() mobject.center() - mobject.set_height(1) + mobject.set(height=1) result = hash(np.round(mobject.points, 3).tobytes()) mobject.restore() return result diff --git a/manim/mobject/graphing/number_line.py b/manim/mobject/graphing/number_line.py index aec3bfb533..3d70ca530b 100644 --- a/manim/mobject/graphing/number_line.py +++ b/manim/mobject/graphing/number_line.py @@ -475,7 +475,7 @@ def get_number_mobject( num_mob.next_to(self.number_to_point(x), direction=direction, buff=buff) if x < 0 and self.label_direction[0] == 0: # Align without the minus sign - num_mob.shift(num_mob[0].get_width() * LEFT / 2) + num_mob.shift(num_mob[0].width * LEFT / 2) return num_mob def get_number_mobjects(self, *numbers, **kwargs) -> VGroup: diff --git a/manim/mobject/svg/svg_mobject.py b/manim/mobject/svg/svg_mobject.py index 18d0a54aa9..87cad3bda0 100644 --- a/manim/mobject/svg/svg_mobject.py +++ b/manim/mobject/svg/svg_mobject.py @@ -441,9 +441,9 @@ def move_into_position(self) -> None: if self.should_center: self.center() if self.svg_height is not None: - self.set_height(self.svg_height) + self.set(height=self.svg_height) if self.svg_width is not None: - self.set_width(self.svg_width) + self.set(width=self.svg_width) class VMobjectFromSVGPath(VMobject, metaclass=ConvertToOpenGL): diff --git a/manim/mobject/text/text_mobject.py b/manim/mobject/text/text_mobject.py index 1110258c4e..a0b32bfaeb 100644 --- a/manim/mobject/text/text_mobject.py +++ b/manim/mobject/text/text_mobject.py @@ -352,7 +352,7 @@ def construct(self): ) text6.scale(1.3).shift(DOWN) self.add(text1, text2, text3, text4, text5 , text6) - Group(*self.mobjects).arrange(DOWN, buff=.8).set_height(config.frame_height-LARGE_BUFF) + Group(*self.mobjects).arrange(DOWN, buff=.8).set(height=config.frame_height-LARGE_BUFF) .. manim:: TextMoreCustomization :save_last_frame: diff --git a/manim/mobject/value_tracker.py b/manim/mobject/value_tracker.py index b60d89887e..9941698e90 100644 --- a/manim/mobject/value_tracker.py +++ b/manim/mobject/value_tracker.py @@ -71,7 +71,7 @@ def construct(self): def __init__(self, value=0, **kwargs): super().__init__(**kwargs) - self.set_points(np.zeros((1, 3))) + self.set(points=np.zeros((1, 3))) self.set_value(value) def get_value(self) -> float: @@ -132,7 +132,7 @@ def interpolate(self, mobject1, mobject2, alpha, path_func=straight_path()): Turns self into an interpolation between mobject1 and mobject2. """ - self.set_points(path_func(mobject1.points, mobject2.points, alpha)) + self.set(points=path_func(mobject1.points, mobject2.points, alpha)) return self From 67924b66ed61ba0cc4de0f926ea73eb6a0c3b771 Mon Sep 17 00:00:00 2001 From: JasonGrace2282 Date: Tue, 26 Dec 2023 14:22:56 -0500 Subject: [PATCH 2/2] Fix animation/specialized.py --- manim/animation/specialized.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manim/animation/specialized.py b/manim/animation/specialized.py index 2c9ed5c617..adc44ea1f1 100644 --- a/manim/animation/specialized.py +++ b/manim/animation/specialized.py @@ -84,7 +84,7 @@ def __init__( mob.move_to(self.focal_point) mob.save_state() - mob.set_width(self.initial_width) + mob.set(width=self.initial_width) if fill_o: mob.set_opacity(self.initial_opacity)