Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Fix `SyntaxWarnings` when building the docs and bump `readthedocs` to Python 3.13 (#3924)

Aarush Deshpande112c99ba4adf
diff --git a/.readthedocs.yml b/.readthedocs.yml
index c10210285..afc76e559 100644
--- a/.readthedocs.yml
+++ b/.readthedocs.yml
@@ -3,7 +3,7 @@ build:
os: ubuntu-22.04
tools:
- python: "3.11"
+ python: "3.13"
apt_packages:
- libpango1.0-dev
diff --git a/docs/source/examples.rst b/docs/source/examples.rst
index 3213c3516..00b4299a5 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)):
diff --git a/manim/animation/fading.py b/manim/animation/fading.py
index f99eebe4c..79cd41a51 100644
--- a/manim/animation/fading.py
+++ b/manim/animation/fading.py
@@ -166,7 +166,7 @@ class FadeOut(_Fade):
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 ef0e4aa1f..75a6037ff 100644
--- a/manim/mobject/geometry/line.py
+++ b/manim/mobject/geometry/line.py
@@ -1068,7 +1068,7 @@ class Angle(VMobject, metaclass=ConvertToOpenGL):
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 e506bc452..673aba187 100644
--- a/manim/mobject/matrix.py
+++ b/manim/mobject/matrix.py
@@ -15,8 +15,8 @@ Examples
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)]],
@@ -294,7 +294,7 @@ class Matrix(VMobject, metaclass=ConvertToOpenGL):
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)
"""
diff --git a/manim/utils/docbuild/manim_directive.py b/manim/utils/docbuild/manim_directive.py
index 4576be81d..8d68f2aa5 100644
--- a/manim/utils/docbuild/manim_directive.py
+++ b/manim/utils/docbuild/manim_directive.py
@@ -174,7 +174,7 @@ class ManimDirective(Directive):
# 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: