Skip to content

Commit 20f44b4

Browse files
Added PointND and PointND_Array typing aliases (#3980)
Co-authored-by: Aarush Deshpande <[email protected]>
1 parent 8773252 commit 20f44b4

File tree

1 file changed

+43
-4
lines changed

1 file changed

+43
-4
lines changed

manim/typing.py

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@
5555
"Point3D",
5656
"InternalPoint3D_Array",
5757
"Point3D_Array",
58+
"InternalPointND",
59+
"PointND",
60+
"InternalPointND_Array",
61+
"PointND_Array",
5862
"Vector2D",
5963
"Vector2D_Array",
6064
"Vector3D",
@@ -301,7 +305,7 @@
301305
"""
302306

303307
InternalPoint2D_Array: TypeAlias = npt.NDArray[PointDType]
304-
"""``shape: (N, 2)``
308+
"""``shape: (M, 2)``
305309
306310
An array of `InternalPoint2D` objects: ``[[float, float], ...]``.
307311
@@ -311,7 +315,7 @@
311315
"""
312316

313317
Point2D_Array: TypeAlias = Union[InternalPoint2D_Array, tuple[Point2D, ...]]
314-
"""``shape: (N, 2)``
318+
"""``shape: (M, 2)``
315319
316320
An array of `Point2D` objects: ``[[float, float], ...]``.
317321
@@ -339,7 +343,7 @@
339343
"""
340344

341345
InternalPoint3D_Array: TypeAlias = npt.NDArray[PointDType]
342-
"""``shape: (N, 3)``
346+
"""``shape: (M, 3)``
343347
344348
An array of `Point3D` objects: ``[[float, float, float], ...]``.
345349
@@ -349,14 +353,49 @@
349353
"""
350354

351355
Point3D_Array: TypeAlias = Union[InternalPoint3D_Array, tuple[Point3D, ...]]
352-
"""``shape: (N, 3)``
356+
"""``shape: (M, 3)``
353357
354358
An array of `Point3D` objects: ``[[float, float, float], ...]``.
355359
356360
Please refer to the documentation of the function you are using for
357361
further type information.
358362
"""
359363

364+
InternalPointND: TypeAlias = npt.NDArray[PointDType]
365+
"""``shape: (N,)``
366+
367+
An N-dimensional point: ``[float, ...]``.
368+
369+
.. note::
370+
This type alias is mostly made available for internal use, and
371+
only includes the NumPy type.
372+
"""
373+
374+
PointND: TypeAlias = Union[InternalPointND, tuple[float, ...]]
375+
"""``shape: (N,)``
376+
377+
An N-dimensional point: ``[float, ...]``.
378+
"""
379+
380+
InternalPointND_Array: TypeAlias = npt.NDArray[PointDType]
381+
"""``shape: (M, N)``
382+
383+
An array of `PointND` objects: ``[[float, ...], ...]``.
384+
385+
.. note::
386+
This type alias is mostly made available for internal use, and
387+
only includes the NumPy type.
388+
"""
389+
390+
PointND_Array: TypeAlias = Union[InternalPointND_Array, tuple[PointND, ...]]
391+
"""``shape: (M, N)``
392+
393+
An array of `PointND` objects: ``[[float, ...], ...]``.
394+
395+
Please refer to the documentation of the function you are using for
396+
further type information.
397+
"""
398+
360399

361400
"""
362401
[CATEGORY]

0 commit comments

Comments
 (0)