summaryrefslogtreecommitdiff
path: root/numpy/lib/index_tricks.pyi
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2021-06-10 12:19:01 -0600
committerGitHub <noreply@github.com>2021-06-10 12:19:01 -0600
commit8cb12732effc36690690cc71f4909cb1dd8369fd (patch)
tree87fd3d66f39408cbfeca9c3cdbe03bf32a1c4b94 /numpy/lib/index_tricks.pyi
parentca5f55bbef3613433c19b84bcd83ecf3bea75731 (diff)
parent5fd46fa67db466ed4495a36c027306cbf085c86f (diff)
downloadnumpy-8cb12732effc36690690cc71f4909cb1dd8369fd.tar.gz
Merge pull request #19060 from BvB93/multiarray-docs
ENH: Add initial annotations to `np.core.multiarray`
Diffstat (limited to 'numpy/lib/index_tricks.pyi')
-rw-r--r--numpy/lib/index_tricks.pyi33
1 files changed, 5 insertions, 28 deletions
diff --git a/numpy/lib/index_tricks.pyi b/numpy/lib/index_tricks.pyi
index a3bfef6b6..0f9ae94a9 100644
--- a/numpy/lib/index_tricks.pyi
+++ b/numpy/lib/index_tricks.pyi
@@ -44,6 +44,11 @@ from numpy.typing import (
_ShapeLike,
)
+from numpy.core.multiarray import (
+ unravel_index as unravel_index,
+ ravel_multi_index as ravel_multi_index,
+)
+
if sys.version_info >= (3, 8):
from typing import Literal, SupportsIndex
else:
@@ -58,34 +63,6 @@ _ArrayType = TypeVar("_ArrayType", bound=ndarray[Any, Any])
__all__: List[str]
@overload
-def unravel_index( # type: ignore[misc]
- indices: Union[int, integer[Any]],
- shape: _ShapeLike,
- order: _OrderCF = ...
-) -> Tuple[intp, ...]: ...
-@overload
-def unravel_index(
- indices: _ArrayLikeInt,
- shape: _ShapeLike,
- order: _OrderCF = ...
-) -> Tuple[NDArray[intp], ...]: ...
-
-@overload
-def ravel_multi_index( # type: ignore[misc]
- multi_index: Sequence[Union[int, integer[Any]]],
- dims: _ShapeLike,
- mode: Union[_ModeKind, Tuple[_ModeKind, ...]] = ...,
- order: _OrderCF = ...
-) -> intp: ...
-@overload
-def ravel_multi_index(
- multi_index: Sequence[_ArrayLikeInt],
- dims: _ShapeLike,
- mode: Union[_ModeKind, Tuple[_ModeKind, ...]] = ...,
- order: _OrderCF = ...
-) -> NDArray[intp]: ...
-
-@overload
def ix_(*args: _NestedSequence[_SupportsDType[_DType]]) -> Tuple[ndarray[Any, _DType], ...]: ...
@overload
def ix_(*args: _NestedSequence[str]) -> Tuple[NDArray[str_], ...]: ...