Skip to content

Commit aa31816

Browse files
pre-commit-ci[bot]JasonGrace2282
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 601100a commit aa31816

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

docs/source/contributing/docs/types.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Choosing Typehints
44
In order to provide the best user experience,
55
it's important that typehints are chosen correctly.
66
With the large variety of types provided by Manim, choosing
7-
which one to use can be difficult. This guide aims to
7+
which one to use can be difficult. This guide aims to
88
aid you in the process.
99

1010

@@ -23,21 +23,23 @@ in space. For example:
2323
.. code-block:: python
2424
2525
def status2D(coord: Point2D) -> None:
26-
x, y = coord
27-
print(f"Point at {x=},{y=}")
26+
x, y = coord
27+
print(f"Point at {x=},{y=}")
28+
2829
2930
def status3D(coord: Point3D) -> None:
30-
x, y, z = coord
31-
print(f"Point at {x=},{y=},{z=}")
31+
x, y, z = coord
32+
print(f"Point at {x=},{y=},{z=}")
33+
3234
3335
def get_statuses(coords: Point2D_Array | Point3D_Array) -> None:
34-
for coord in coords:
35-
if len(coord) == 2:
36-
# it's a Point2D
37-
status2D(coord)
38-
else:
39-
# it's a point3D
40-
status3D(coord)
36+
for coord in coords:
37+
if len(coord) == 2:
38+
# it's a Point2D
39+
status2D(coord)
40+
else:
41+
# it's a point3D
42+
status3D(coord)
4143
4244
It's important to realize that the status functions worked with both
4345
tuples/lists of the correct length, and ``NDArray``'s of the correct shape.
@@ -56,7 +58,7 @@ consider this slightly contrived function:
5658
.. code-block:: python
5759
5860
def shift_mobject(mob: Mobject, direction: Vector3D, scale_factor: float = 1) -> mob:
59-
return mob.shift(direction * scale_factor)
61+
return mob.shift(direction * scale_factor)
6062
6163
Here we see an important example of the difference. ``direction`` can not, and
6264
should not, be typed as a ``Point3D`` because it does not work with something
@@ -83,5 +85,3 @@ Béziers
8385

8486
Functions
8587
---------
86-
87-

0 commit comments

Comments
 (0)