|
21 | 21 | from __future__ import annotations
|
22 | 22 |
|
23 | 23 | from os import PathLike
|
24 |
| -from typing import Callable, Literal, Union |
| 24 | +from typing import Callable, Union |
25 | 25 |
|
26 | 26 | import numpy as np
|
27 | 27 | import numpy.typing as npt
|
|
319 | 319 | Vector types
|
320 | 320 | """
|
321 | 321 |
|
322 |
| -Vector2D: TypeAlias = Point2D |
| 322 | +Vector2D: TypeAlias = npt.NDArray[PointDType] |
323 | 323 | """``shape: (2,)``
|
324 | 324 |
|
325 | 325 | A 2-dimensional vector: ``[float, float]``.
|
|
332 | 332 | VMobjects!
|
333 | 333 | """
|
334 | 334 |
|
335 |
| -Vector2D_Array: TypeAlias = Point2D_Array |
| 335 | +Vector2D_Array: TypeAlias = npt.NDArray[PointDType] |
336 | 336 | """``shape: (M, 2)``
|
337 | 337 |
|
338 | 338 | An array of `Vector2D` objects: ``[[float, float], ...]``.
|
|
341 | 341 | parameter can handle being passed a `Vector3D_Array` instead.
|
342 | 342 | """
|
343 | 343 |
|
344 |
| -Vector3D: TypeAlias = Point3D |
| 344 | +Vector3D: TypeAlias = npt.NDArray[PointDType] |
345 | 345 | """``shape: (3,)``
|
346 | 346 |
|
347 | 347 | A 3-dimensional vector: ``[float, float, float]``.
|
|
351 | 351 | VMobjects!
|
352 | 352 | """
|
353 | 353 |
|
354 |
| -Vector3D_Array: TypeAlias = Point3D_Array |
| 354 | +Vector3D_Array: TypeAlias = npt.NDArray[PointDType] |
355 | 355 | """``shape: (M, 3)``
|
356 | 356 |
|
357 | 357 | An array of `Vector3D` objects: ``[[float, float, float], ...]``.
|
358 | 358 | """
|
359 | 359 |
|
360 |
| -VectorND: TypeAlias = Union[npt.NDArray[PointDType], tuple[float, ...]] |
| 360 | +VectorND: TypeAlias = npt.NDArray[PointDType] |
361 | 361 | """``shape (N,)``
|
362 | 362 |
|
363 | 363 | An :math:`N`-dimensional vector: ``[float, ...]``.
|
|
368 | 368 | collisions.
|
369 | 369 | """
|
370 | 370 |
|
371 |
| -VectorND_Array: TypeAlias = Union[npt.NDArray[PointDType], tuple[VectorND, ...]] |
| 371 | +VectorND_Array: TypeAlias = npt.NDArray[PointDType] |
372 | 372 | """``shape (M, N)``
|
373 | 373 |
|
374 | 374 | An array of `VectorND` objects: ``[[float, ...], ...]``.
|
375 | 375 | """
|
376 | 376 |
|
377 |
| -RowVector: TypeAlias = Union[npt.NDArray[PointDType], tuple[tuple[float, ...]]] |
| 377 | +RowVector: TypeAlias = npt.NDArray[PointDType] |
378 | 378 | """``shape: (1, N)``
|
379 | 379 |
|
380 | 380 | A row vector: ``[[float, ...]]``.
|
381 | 381 | """
|
382 | 382 |
|
383 |
| -ColVector: TypeAlias = Union[npt.NDArray[PointDType], tuple[tuple[float], ...]] |
| 383 | +ColVector: TypeAlias = npt.NDArray[PointDType] |
384 | 384 | """``shape: (N, 1)``
|
385 | 385 |
|
386 | 386 | A column vector: ``[[float], [float], ...]``.
|
|
392 | 392 | Matrix types
|
393 | 393 | """
|
394 | 394 |
|
395 |
| -MatrixMN: TypeAlias = Union[npt.NDArray[PointDType], tuple[tuple[float, ...], ...]] |
| 395 | +MatrixMN: TypeAlias = npt.NDArray[PointDType] |
396 | 396 | """``shape: (M, N)``
|
397 | 397 |
|
398 | 398 | A matrix: ``[[float, ...], [float, ...], ...]``.
|
399 | 399 | """
|
400 | 400 |
|
401 |
| -Zeros: TypeAlias = Union[npt.NDArray[PointDType], tuple[tuple[Literal[0], ...], ...]] |
| 401 | +Zeros: TypeAlias = MatrixMN |
402 | 402 | """``shape: (M, N)``
|
403 | 403 |
|
404 | 404 | A `MatrixMN` filled with zeros, typically created with
|
|
0 commit comments