summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBas van Beek <b.f.van.beek@vu.nl>2021-04-21 00:41:34 +0200
committerBas van Beek <43369155+BvB93@users.noreply.github.com>2021-06-06 20:54:37 +0200
commit1dc53a3be6c4191bc65ad7a27ee571b07e52ee97 (patch)
tree5807d8aa1e34e0d7f3601d2d59ea9749a2460d97
parent7461ab575f8641253340ef90a2d37b1f01891e5a (diff)
downloadnumpy-1dc53a3be6c4191bc65ad7a27ee571b07e52ee97.tar.gz
MAINT: Move `array`, `empty` and `zeros` to `np.core.multiarray`
-rw-r--r--numpy/__init__.pyi28
-rw-r--r--numpy/core/multiarray.pyi57
2 files changed, 60 insertions, 25 deletions
diff --git a/numpy/__init__.pyi b/numpy/__init__.pyi
index d5efe19bb..4e68387a8 100644
--- a/numpy/__init__.pyi
+++ b/numpy/__init__.pyi
@@ -295,7 +295,10 @@ from numpy.core.einsumfunc import (
)
from numpy.core.multiarray import (
+ array as array,
empty_like as empty_like,
+ empty as empty,
+ zeros as zeros,
)
from numpy.core.numeric import (
@@ -3420,31 +3423,6 @@ class str_(character, str):
unicode_ = str_
str0 = str_
-def array(
- object: object,
- dtype: DTypeLike = ...,
- *,
- copy: bool = ...,
- order: _OrderKACF = ...,
- subok: bool = ...,
- ndmin: int = ...,
- like: ArrayLike = ...,
-) -> ndarray: ...
-def zeros(
- shape: _ShapeLike,
- dtype: DTypeLike = ...,
- order: _OrderCF = ...,
- *,
- like: ArrayLike = ...,
-) -> ndarray: ...
-def empty(
- shape: _ShapeLike,
- dtype: DTypeLike = ...,
- order: _OrderCF = ...,
- *,
- like: ArrayLike = ...,
-) -> ndarray: ...
-
#
# Constants
#
diff --git a/numpy/core/multiarray.pyi b/numpy/core/multiarray.pyi
index cd8518ed6..0080dc303 100644
--- a/numpy/core/multiarray.pyi
+++ b/numpy/core/multiarray.pyi
@@ -29,3 +29,60 @@ def empty_like(
subok: bool = ...,
shape: Optional[_ShapeLike] = ...,
) -> NDArray[Any]: ...
+
+@overload
+def array(
+ object: object,
+ dtype: _DTypeLike[_SCT],
+ *,
+ copy: bool = ...,
+ order: _OrderKACF = ...,
+ subok: bool = ...,
+ ndmin: int = ...,
+ like: ArrayLike = ...,
+) -> NDArray[_SCT]: ...
+@overload
+def array(
+ object: object,
+ dtype: DTypeLike = ...,
+ *,
+ copy: bool = ...,
+ order: _OrderKACF = ...,
+ subok: bool = ...,
+ ndmin: int = ...,
+ like: ArrayLike = ...,
+) -> NDArray[Any]: ...
+
+@overload
+def zeros(
+ shape: _ShapeLike,
+ dtype: _DTypeLike[_SCT],
+ order: _OrderCF = ...,
+ *,
+ like: ArrayLike = ...,
+) -> NDArray[_SCT]: ...
+@overload
+def zeros(
+ shape: _ShapeLike,
+ dtype: DTypeLike = ...,
+ order: _OrderCF = ...,
+ *,
+ like: ArrayLike = ...,
+) -> NDArray[Any]: ...
+
+@overload
+def empty(
+ shape: _ShapeLike,
+ dtype: _DTypeLike[_SCT],
+ order: _OrderCF = ...,
+ *,
+ like: ArrayLike = ...,
+) -> NDArray[_SCT]: ...
+@overload
+def empty(
+ shape: _ShapeLike,
+ dtype: DTypeLike = ...,
+ order: _OrderCF = ...,
+ *,
+ like: ArrayLike = ...,
+) -> NDArray[Any]: ...