From 673e16e9c8007496d6a416c57ea32f7cbadf2a66 Mon Sep 17 00:00:00 2001 From: JasonGrace2282 Date: Sun, 1 Sep 2024 08:48:52 -0400 Subject: [PATCH 1/4] Bump readthedocs python version and fix SyntaxWarnings --- .readthedocs.yml | 2 +- docs/source/examples.rst | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index c102102858..bff9cc65d2 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -3,7 +3,7 @@ build: os: ubuntu-22.04 tools: - python: "3.11" + python: "3.12" apt_packages: - libpango1.0-dev diff --git a/docs/source/examples.rst b/docs/source/examples.rst index 6d39027bfc..01ff1c9470 100644 --- a/docs/source/examples.rst +++ b/docs/source/examples.rst @@ -341,7 +341,7 @@ Plotting with Manim axes.i2gp(TAU, cos_graph), color=YELLOW, line_func=Line ) line_label = axes.get_graph_label( - cos_graph, "x=2\pi", x_val=TAU, direction=UR, color=WHITE + cos_graph, r"x=2\pi", x_val=TAU, direction=UR, color=WHITE ) plot = VGroup(axes, sin_graph, cos_graph, vert_line) @@ -482,7 +482,7 @@ Plotting with Manim tips=False, ) labels = ax.get_axis_labels( - x_label=Tex("$\Delta Q$"), y_label=Tex("T[$^\circ C$]") + x_label=Tex(r"$\Delta Q$"), y_label=Tex(r"T[$^\circ C$]") ) x_vals = [0, 8, 38, 39] @@ -785,8 +785,8 @@ Advanced Projects def add_x_labels(self): x_labels = [ - MathTex("\pi"), MathTex("2 \pi"), - MathTex("3 \pi"), MathTex("4 \pi"), + MathTex(r"\pi"), MathTex(r"2 \pi"), + MathTex(r"3 \pi"), MathTex(r"4 \pi"), ] for i in range(len(x_labels)): From 97759bca0610bb29236692011d8f498b23b8d35e Mon Sep 17 00:00:00 2001 From: JasonGrace2282 Date: Sun, 1 Sep 2024 12:56:42 -0400 Subject: [PATCH 2/4] Fix some more stuff --- manim/animation/fading.py | 8 ++++---- manim/mobject/geometry/line.py | 4 ++-- manim/mobject/matrix.py | 26 +++++++++++++------------- manim/mobject/table.py | 16 ++++++++-------- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/manim/animation/fading.py b/manim/animation/fading.py index c09d8bac64..79cd41a516 100644 --- a/manim/animation/fading.py +++ b/manim/animation/fading.py @@ -94,7 +94,7 @@ def _create_faded_mobject(self, fadeIn: bool) -> Mobject: class FadeIn(_Fade): - """Fade in :class:`~.Mobject` s. + r"""Fade in :class:`~.Mobject` s. Parameters ---------- @@ -119,7 +119,7 @@ def construct(self): dot = Dot(UP * 2 + LEFT) self.add(dot) tex = Tex( - "FadeIn with ", "shift ", " or target\\_position", " and scale" + "FadeIn with ", "shift ", r" or target\_position", " and scale" ).scale(1) animations = [ FadeIn(tex[0]), @@ -142,7 +142,7 @@ def create_starting_mobject(self): class FadeOut(_Fade): - """Fade out :class:`~.Mobject` s. + r"""Fade out :class:`~.Mobject` s. Parameters ---------- @@ -166,7 +166,7 @@ def construct(self): dot = Dot(UP * 2 + LEFT) self.add(dot) tex = Tex( - "FadeOut with ", "shift ", " or target\\_position", " and scale" + "FadeOut with ", "shift ", r" or target\_position", " and scale" ).scale(1) animations = [ FadeOut(tex[0]), diff --git a/manim/mobject/geometry/line.py b/manim/mobject/geometry/line.py index 7009dd5b31..ee36df8509 100644 --- a/manim/mobject/geometry/line.py +++ b/manim/mobject/geometry/line.py @@ -1029,7 +1029,7 @@ def get_lines(self) -> VGroup: return VGroup(*self.lines) def get_value(self, degrees: bool = False) -> float: - """Get the value of an angle of the :class:`Angle` class. + r"""Get the value of an angle of the :class:`Angle` class. Parameters ---------- @@ -1054,7 +1054,7 @@ def construct(self): angle = Angle(line1, line2, radius=0.4) - value = DecimalNumber(angle.get_value(degrees=True), unit="^{\\circ}") + value = DecimalNumber(angle.get_value(degrees=True), unit=r"^{\circ}") value.next_to(angle, UR) self.add(line1, line2, angle, value) diff --git a/manim/mobject/matrix.py b/manim/mobject/matrix.py index 0921416383..417f91eff6 100644 --- a/manim/mobject/matrix.py +++ b/manim/mobject/matrix.py @@ -15,8 +15,8 @@ def construct(self): m2 = DecimalMatrix( [[3.456, 2.122], [33.2244, 12.33]], element_to_mobject_config={"num_decimal_places": 2}, - left_bracket="\\{", - right_bracket="\\}") + left_bracket=r"\{", + right_bracket=r"\}") m3 = MobjectMatrix( [[Circle().scale(0.3), Square().scale(0.3)], [MathTex("\\pi").scale(2), Star().scale(0.3)]], @@ -72,7 +72,7 @@ def matrix_to_mobject(matrix): class Matrix(VMobject, metaclass=ConvertToOpenGL): - """A mobject that displays a matrix on the screen. + r"""A mobject that displays a matrix on the screen. Parameters ---------- @@ -118,7 +118,7 @@ class Matrix(VMobject, metaclass=ConvertToOpenGL): class MatrixExamples(Scene): def construct(self): - m0 = Matrix([[2, "\\pi"], [-1, 1]]) + m0 = Matrix([[2, r"\pi"], [-1, 1]]) m1 = Matrix([[2, 0, 4], [-1, 1, 5]], v_buff=1.3, h_buff=0.8, @@ -132,8 +132,8 @@ def construct(self): left_bracket="(", right_bracket=")") m3 = Matrix([[2, 1], [-1, 3]], - left_bracket="\\\\langle", - right_bracket="\\\\rangle") + left_bracket=r"\\langle", + right_bracket=r"\\rangle") m4 = Matrix([[2, 1], [-1, 3]], ).set_column_colors(RED, GREEN) m5 = Matrix([[2, 1], [-1, 3]], @@ -280,7 +280,7 @@ def _add_brackets(self, left: str = "[", right: str = "]", **kwargs): return self def get_columns(self): - """Return columns of the matrix as VGroups. + r"""Return columns of the matrix as VGroups. Returns -------- @@ -295,7 +295,7 @@ def get_columns(self): class GetColumnsExample(Scene): def construct(self): - m0 = Matrix([["\\pi", 3], [1, 5]]) + m0 = Matrix([[r"\pi", 3], [1, 5]]) m0.add(SurroundingRectangle(m0.get_columns()[1])) self.add(m0) """ @@ -308,7 +308,7 @@ def construct(self): ) def set_column_colors(self, *colors: str): - """Set individual colors for each columns of the matrix. + r"""Set individual colors for each columns of the matrix. Parameters ---------- @@ -338,7 +338,7 @@ def construct(self): return self def get_rows(self): - """Return rows of the matrix as VGroups. + r"""Return rows of the matrix as VGroups. Returns -------- @@ -360,7 +360,7 @@ def construct(self): return VGroup(*(VGroup(*row) for row in self.mob_matrix)) def set_row_colors(self, *colors: str): - """Set individual colors for each row of the matrix. + r"""Set individual colors for each row of the matrix. Parameters ---------- @@ -438,7 +438,7 @@ def construct(self): return self.elements def get_brackets(self): - """Return the bracket mobjects. + r"""Return the bracket mobjects. Returns -------- @@ -544,7 +544,7 @@ def __init__( class MobjectMatrix(Matrix): - """A mobject that displays a matrix of mobject entries on the screen. + r"""A mobject that displays a matrix of mobject entries on the screen. Examples -------- diff --git a/manim/mobject/table.py b/manim/mobject/table.py index 4edc163972..560f1a512f 100644 --- a/manim/mobject/table.py +++ b/manim/mobject/table.py @@ -1067,7 +1067,7 @@ def __init__( class IntegerTable(Table): - """A specialized :class:`~.Table` mobject for use with :class:`~.Integer`. + r"""A specialized :class:`~.Table` mobject for use with :class:`~.Integer`. Examples -------- @@ -1081,14 +1081,14 @@ def construct(self): [[0,30,45,60,90], [90,60,45,30,0]], col_labels=[ - MathTex("\\\\frac{\\sqrt{0}}{2}"), - MathTex("\\\\frac{\\sqrt{1}}{2}"), - MathTex("\\\\frac{\\sqrt{2}}{2}"), - MathTex("\\\\frac{\\sqrt{3}}{2}"), - MathTex("\\\\frac{\\sqrt{4}}{2}")], - row_labels=[MathTex("\\sin"), MathTex("\\cos")], + MathTex(r"\frac{\sqrt{0}}{2}"), + MathTex(r"\frac{\sqrt{1}}{2}"), + MathTex(r"\frac{\sqrt{2}}{2}"), + MathTex(r"\frac{\sqrt{3}}{2}"), + MathTex(r"\frac{\sqrt{4}}{2}")], + row_labels=[MathTex(r"\sin"), MathTex(r"\cos")], h_buff=1, - element_to_mobject_config={"unit": "^{\\circ}"}) + element_to_mobject_config={"unit": r"^{\circ}"}) self.add(t0) """ From 8336711bb262132213abdaf6af8f549811c44803 Mon Sep 17 00:00:00 2001 From: JasonGrace2282 Date: Sun, 1 Sep 2024 13:12:46 -0400 Subject: [PATCH 3/4] Fix deprecation warning in Sphinx 9.0 --- manim/utils/docbuild/manim_directive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manim/utils/docbuild/manim_directive.py b/manim/utils/docbuild/manim_directive.py index 4576be81dd..8d68f2aa53 100644 --- a/manim/utils/docbuild/manim_directive.py +++ b/manim/utils/docbuild/manim_directive.py @@ -174,7 +174,7 @@ def run(self) -> list[nodes.Element]: # Rendering is skipped if the tag skip-manim is present, # or if we are making the pot-files should_skip = ( - "skip-manim" in self.state.document.settings.env.app.builder.tags.tags + "skip-manim" in self.state.document.settings.env.app.builder.tags or self.state.document.settings.env.app.builder.name == "gettext" ) if should_skip: From 256934deb3f004966edfdc029550cd50624cdbe9 Mon Sep 17 00:00:00 2001 From: JasonGrace2282 Date: Tue, 3 Dec 2024 09:07:18 -0500 Subject: [PATCH 4/4] Try using python 3.13 --- .readthedocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index bff9cc65d2..afc76e5597 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -3,7 +3,7 @@ build: os: ubuntu-22.04 tools: - python: "3.12" + python: "3.13" apt_packages: - libpango1.0-dev