Skip to content

Commit

Permalink
Revert vector type aliases to NumPy ndarrays (#3595)
Browse files Browse the repository at this point in the history
  • Loading branch information
chopan050 authored Feb 12, 2024
1 parent ed1b203 commit 011c36a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions manim/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from __future__ import annotations

from os import PathLike
from typing import Callable, Literal, Union
from typing import Callable, Union

import numpy as np
import numpy.typing as npt
Expand Down Expand Up @@ -319,7 +319,7 @@
Vector types
"""

Vector2D: TypeAlias = Point2D
Vector2D: TypeAlias = npt.NDArray[PointDType]
"""``shape: (2,)``
A 2-dimensional vector: ``[float, float]``.
Expand All @@ -332,7 +332,7 @@
VMobjects!
"""

Vector2D_Array: TypeAlias = Point2D_Array
Vector2D_Array: TypeAlias = npt.NDArray[PointDType]
"""``shape: (M, 2)``
An array of `Vector2D` objects: ``[[float, float], ...]``.
Expand All @@ -341,7 +341,7 @@
parameter can handle being passed a `Vector3D_Array` instead.
"""

Vector3D: TypeAlias = Point3D
Vector3D: TypeAlias = npt.NDArray[PointDType]
"""``shape: (3,)``
A 3-dimensional vector: ``[float, float, float]``.
Expand All @@ -351,13 +351,13 @@
VMobjects!
"""

Vector3D_Array: TypeAlias = Point3D_Array
Vector3D_Array: TypeAlias = npt.NDArray[PointDType]
"""``shape: (M, 3)``
An array of `Vector3D` objects: ``[[float, float, float], ...]``.
"""

VectorND: TypeAlias = Union[npt.NDArray[PointDType], tuple[float, ...]]
VectorND: TypeAlias = npt.NDArray[PointDType]
"""``shape (N,)``
An :math:`N`-dimensional vector: ``[float, ...]``.
Expand All @@ -368,19 +368,19 @@
collisions.
"""

VectorND_Array: TypeAlias = Union[npt.NDArray[PointDType], tuple[VectorND, ...]]
VectorND_Array: TypeAlias = npt.NDArray[PointDType]
"""``shape (M, N)``
An array of `VectorND` objects: ``[[float, ...], ...]``.
"""

RowVector: TypeAlias = Union[npt.NDArray[PointDType], tuple[tuple[float, ...]]]
RowVector: TypeAlias = npt.NDArray[PointDType]
"""``shape: (1, N)``
A row vector: ``[[float, ...]]``.
"""

ColVector: TypeAlias = Union[npt.NDArray[PointDType], tuple[tuple[float], ...]]
ColVector: TypeAlias = npt.NDArray[PointDType]
"""``shape: (N, 1)``
A column vector: ``[[float], [float], ...]``.
Expand All @@ -392,13 +392,13 @@
Matrix types
"""

MatrixMN: TypeAlias = Union[npt.NDArray[PointDType], tuple[tuple[float, ...], ...]]
MatrixMN: TypeAlias = npt.NDArray[PointDType]
"""``shape: (M, N)``
A matrix: ``[[float, ...], [float, ...], ...]``.
"""

Zeros: TypeAlias = Union[npt.NDArray[PointDType], tuple[tuple[Literal[0], ...], ...]]
Zeros: TypeAlias = MatrixMN
"""``shape: (M, N)``
A `MatrixMN` filled with zeros, typically created with
Expand Down

0 comments on commit 011c36a

Please sign in to comment.