|
1 | | -from typing import Any, Optional, Type, Union |
| 1 | +from typing import Optional, Type, Union |
2 | 2 |
|
3 | | -import nptyping as npt |
4 | 3 | import numpy as np |
5 | | -from typing_extensions import Literal |
| 4 | +import numpy.typing as npt |
6 | 5 |
|
7 | 6 | from nrrd.errors import NRRDError |
8 | 7 |
|
9 | 8 |
|
10 | | -def parse_vector(x: str, dtype: Optional[Type[Union[int, float]]] = None) -> npt.NDArray[Literal['*'], Any]: |
| 9 | +def parse_vector(x: str, dtype: Optional[Type[Union[int, float]]] = None) -> npt.NDArray: |
11 | 10 | """Parse NRRD vector from string into (N,) :class:`numpy.ndarray`. |
12 | 11 |
|
13 | 12 | See :ref:`background/datatypes:int vector` and :ref:`background/datatypes:double vector` for more information on |
@@ -52,7 +51,7 @@ def parse_vector(x: str, dtype: Optional[Type[Union[int, float]]] = None) -> npt |
52 | 51 |
|
53 | 52 |
|
54 | 53 | def parse_optional_vector(x: str, dtype: Optional[Type[Union[int, float]]] = None) -> \ |
55 | | - Optional[npt.NDArray[Literal['*'], Any]]: |
| 54 | + Optional[npt.NDArray]: |
56 | 55 | """Parse optional NRRD vector from string into (N,) :class:`numpy.ndarray` or :obj:`None`. |
57 | 56 |
|
58 | 57 | Function parses optional NRRD vector from string into an (N,) :class:`numpy.ndarray`. This function works the same |
@@ -83,7 +82,7 @@ def parse_optional_vector(x: str, dtype: Optional[Type[Union[int, float]]] = Non |
83 | 82 | return parse_vector(x, dtype) |
84 | 83 |
|
85 | 84 |
|
86 | | -def parse_matrix(x: str, dtype: Optional[Type[Union[int, float]]] = None) -> npt.NDArray[Literal['*, *'], Any]: |
| 85 | +def parse_matrix(x: str, dtype: Optional[Type[Union[int, float]]] = None) -> npt.NDArray: |
87 | 86 | """Parse NRRD matrix from string into (M,N) :class:`numpy.ndarray`. |
88 | 87 |
|
89 | 88 | See :ref:`background/datatypes:int matrix` and :ref:`background/datatypes:double matrix` for more information on |
@@ -130,7 +129,7 @@ def parse_matrix(x: str, dtype: Optional[Type[Union[int, float]]] = None) -> npt |
130 | 129 | return matrix |
131 | 130 |
|
132 | 131 |
|
133 | | -def parse_optional_matrix(x: str) -> Optional[npt.NDArray[Literal['*, *'], Any]]: |
| 132 | +def parse_optional_matrix(x: str) -> Optional[npt.NDArray]: |
134 | 133 | """Parse optional NRRD matrix from string into (M,N) :class:`numpy.ndarray` of :class:`float`. |
135 | 134 |
|
136 | 135 | Function parses optional NRRD matrix from string into an (M,N) :class:`numpy.ndarray` of :class:`float`. This |
@@ -173,7 +172,7 @@ def parse_optional_matrix(x: str) -> Optional[npt.NDArray[Literal['*, *'], Any]] |
173 | 172 | return matrix |
174 | 173 |
|
175 | 174 |
|
176 | | -def parse_number_list(x: str, dtype: Optional[Type[Union[int, float]]] = None) -> npt.NDArray[Literal['*'], Any]: |
| 175 | +def parse_number_list(x: str, dtype: Optional[Type[Union[int, float]]] = None) -> npt.NDArray: |
177 | 176 | """Parse NRRD number list from string into (N,) :class:`numpy.ndarray`. |
178 | 177 |
|
179 | 178 | See :ref:`background/datatypes:int list` and :ref:`background/datatypes:double list` for more information on the |
|
0 commit comments