Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SyntaxWarnings when building the docs #3924

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ build:
os: ubuntu-22.04

tools:
python: "3.11"
python: "3.12"

apt_packages:
- libpango1.0-dev
Expand Down
8 changes: 4 additions & 4 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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)):
Expand Down
2 changes: 1 addition & 1 deletion manim/animation/fading.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]),
Expand Down
2 changes: 1 addition & 1 deletion manim/mobject/geometry/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,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)
Expand Down
6 changes: 3 additions & 3 deletions manim/mobject/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]],
Expand Down Expand Up @@ -294,7 +294,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)
"""
Expand Down
2 changes: 1 addition & 1 deletion manim/utils/docbuild/manim_directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading