@@ -4,7 +4,7 @@ from typing_extensions import TypeVar
4
4
5
5
import _numtype as _nt
6
6
import numpy as np
7
- from numpy ._typing import ArrayLike , DTypeLike , NDArray , _ArrayLike , _DTypeLike
7
+ from numpy ._typing import ArrayLike , DTypeLike , _ArrayLike , _DTypeLike
8
8
9
9
__all__ = ["atleast_1d" , "atleast_2d" , "atleast_3d" , "block" , "hstack" , "stack" , "unstack" , "vstack" ]
10
10
@@ -14,7 +14,7 @@ _ScalarT = TypeVar("_ScalarT", bound=np.generic)
14
14
_SCT0 = TypeVar ("_SCT0" , bound = np .generic )
15
15
_SCT1 = TypeVar ("_SCT1" , bound = np .generic )
16
16
17
- _ArrayT = TypeVar ("_ArrayT" , bound = NDArray [Any ])
17
+ _ArrayT = TypeVar ("_ArrayT" , bound = _nt . Array [Any ])
18
18
19
19
_Array1T = TypeVar ("_Array1T" , bound = np .ndarray [_nt .Shape1N , np .dtype ])
20
20
_Array1T0 = TypeVar ("_Array1T0" , bound = np .ndarray [_nt .Shape1N , np .dtype ])
@@ -38,19 +38,19 @@ def atleast_1d(a0: _Array1T0, a1: _Array1T1, /) -> tuple[_Array1T0, _Array1T1]:
38
38
@overload
39
39
def atleast_1d (a0 : _Array1T , a1 : _Array1T , / , * arys : _Array1T ) -> tuple [_Array1T , ...]: ... # type: ignore[overload-overlap]
40
40
@overload
41
- def atleast_1d (a0 : _ArrayLike [_ScalarT ], / ) -> NDArray [_ScalarT ]: ...
41
+ def atleast_1d (a0 : _ArrayLike [_ScalarT ], / ) -> _nt . Array [_ScalarT ]: ...
42
42
@overload
43
- def atleast_1d (a0 : _ArrayLike [_SCT0 ], a2 : _ArrayLike [_SCT1 ], / ) -> tuple [NDArray [_SCT0 ], NDArray [_SCT1 ]]: ...
43
+ def atleast_1d (a0 : _ArrayLike [_SCT0 ], a2 : _ArrayLike [_SCT1 ], / ) -> tuple [_nt . Array [_SCT0 ], _nt . Array [_SCT1 ]]: ...
44
44
@overload
45
45
def atleast_1d (
46
46
a0 : _ArrayLike [_ScalarT ], a2 : _ArrayLike [_ScalarT ], / , * arys : _ArrayLike [_ScalarT ]
47
- ) -> tuple [NDArray [_ScalarT ], ...]: ...
47
+ ) -> tuple [_nt . Array [_ScalarT ], ...]: ...
48
48
@overload
49
- def atleast_1d (a0 : ArrayLike , / ) -> NDArray [Any ]: ...
49
+ def atleast_1d (a0 : ArrayLike , / ) -> _nt . Array [Any ]: ...
50
50
@overload
51
- def atleast_1d (a0 : ArrayLike , a2 : ArrayLike , / ) -> tuple [NDArray [Any ], NDArray [Any ]]: ...
51
+ def atleast_1d (a0 : ArrayLike , a2 : ArrayLike , / ) -> tuple [_nt . Array [Any ], _nt . Array [Any ]]: ...
52
52
@overload
53
- def atleast_1d (a0 : ArrayLike , a2 : ArrayLike , / , * arys : ArrayLike ) -> tuple [NDArray [Any ], ...]: ...
53
+ def atleast_1d (a0 : ArrayLike , a2 : ArrayLike , / , * arys : ArrayLike ) -> tuple [_nt . Array [Any ], ...]: ...
54
54
55
55
#
56
56
@overload
@@ -60,19 +60,19 @@ def atleast_2d(a0: _Array2T0, a1: _Array2T1, /) -> tuple[_Array2T0, _Array2T1]:
60
60
@overload
61
61
def atleast_2d (a0 : _Array2T , a1 : _Array2T , / , * arys : _Array2T ) -> tuple [_Array2T , ...]: ... # type: ignore[overload-overlap]
62
62
@overload
63
- def atleast_2d (a0 : _ArrayLike [_ScalarT ], / ) -> NDArray [_ScalarT ]: ...
63
+ def atleast_2d (a0 : _ArrayLike [_ScalarT ], / ) -> _nt . Array [_ScalarT ]: ...
64
64
@overload
65
- def atleast_2d (a0 : _ArrayLike [_SCT0 ], a2 : _ArrayLike [_SCT1 ], / ) -> tuple [NDArray [_SCT0 ], NDArray [_SCT1 ]]: ...
65
+ def atleast_2d (a0 : _ArrayLike [_SCT0 ], a2 : _ArrayLike [_SCT1 ], / ) -> tuple [_nt . Array [_SCT0 ], _nt . Array [_SCT1 ]]: ...
66
66
@overload
67
67
def atleast_2d (
68
68
a0 : _ArrayLike [_ScalarT ], a2 : _ArrayLike [_ScalarT ], / , * arys : _ArrayLike [_ScalarT ]
69
- ) -> tuple [NDArray [_ScalarT ], ...]: ...
69
+ ) -> tuple [_nt . Array [_ScalarT ], ...]: ...
70
70
@overload
71
- def atleast_2d (a0 : ArrayLike , / ) -> NDArray [Any ]: ...
71
+ def atleast_2d (a0 : ArrayLike , / ) -> _nt . Array [Any ]: ...
72
72
@overload
73
- def atleast_2d (a0 : ArrayLike , a2 : ArrayLike , / ) -> tuple [NDArray [Any ], NDArray [Any ]]: ...
73
+ def atleast_2d (a0 : ArrayLike , a2 : ArrayLike , / ) -> tuple [_nt . Array [Any ], _nt . Array [Any ]]: ...
74
74
@overload
75
- def atleast_2d (a0 : ArrayLike , a2 : ArrayLike , / , * arys : ArrayLike ) -> tuple [NDArray [Any ], ...]: ...
75
+ def atleast_2d (a0 : ArrayLike , a2 : ArrayLike , / , * arys : ArrayLike ) -> tuple [_nt . Array [Any ], ...]: ...
76
76
77
77
#
78
78
@overload
@@ -82,19 +82,19 @@ def atleast_3d(a0: _Array3T0, a1: _Array3T1, /) -> tuple[_Array3T0, _Array3T1]:
82
82
@overload
83
83
def atleast_3d (a0 : _Array3T , a1 : _Array3T , / , * arys : _Array3T ) -> tuple [_Array3T , ...]: ... # type: ignore[overload-overlap]
84
84
@overload
85
- def atleast_3d (a0 : _ArrayLike [_ScalarT ], / ) -> NDArray [_ScalarT ]: ...
85
+ def atleast_3d (a0 : _ArrayLike [_ScalarT ], / ) -> _nt . Array [_ScalarT ]: ...
86
86
@overload
87
- def atleast_3d (a0 : _ArrayLike [_SCT0 ], a2 : _ArrayLike [_SCT1 ], / ) -> tuple [NDArray [_SCT0 ], NDArray [_SCT1 ]]: ...
87
+ def atleast_3d (a0 : _ArrayLike [_SCT0 ], a2 : _ArrayLike [_SCT1 ], / ) -> tuple [_nt . Array [_SCT0 ], _nt . Array [_SCT1 ]]: ...
88
88
@overload
89
89
def atleast_3d (
90
90
a0 : _ArrayLike [_ScalarT ], a2 : _ArrayLike [_ScalarT ], / , * arys : _ArrayLike [_ScalarT ]
91
- ) -> tuple [NDArray [_ScalarT ], ...]: ...
91
+ ) -> tuple [_nt . Array [_ScalarT ], ...]: ...
92
92
@overload
93
- def atleast_3d (a0 : ArrayLike , / ) -> NDArray [Any ]: ...
93
+ def atleast_3d (a0 : ArrayLike , / ) -> _nt . Array [Any ]: ...
94
94
@overload
95
- def atleast_3d (a0 : ArrayLike , a2 : ArrayLike , / ) -> tuple [NDArray [Any ], NDArray [Any ]]: ...
95
+ def atleast_3d (a0 : ArrayLike , a2 : ArrayLike , / ) -> tuple [_nt . Array [Any ], _nt . Array [Any ]]: ...
96
96
@overload
97
- def atleast_3d (a0 : ArrayLike , a2 : ArrayLike , / , * arys : ArrayLike ) -> tuple [NDArray [Any ], ...]: ...
97
+ def atleast_3d (a0 : ArrayLike , a2 : ArrayLike , / , * arys : ArrayLike ) -> tuple [_nt . Array [Any ], ...]: ...
98
98
99
99
#
100
100
@overload
@@ -103,21 +103,21 @@ def vstack(
103
103
* ,
104
104
dtype : None = None ,
105
105
casting : np ._CastingKind = "same_kind" ,
106
- ) -> NDArray [_ScalarT ]: ...
106
+ ) -> _nt . Array [_ScalarT ]: ...
107
107
@overload
108
108
def vstack (
109
109
tup : Sequence [ArrayLike ],
110
110
* ,
111
111
dtype : _DTypeLike [_ScalarT ],
112
112
casting : np ._CastingKind = "same_kind" ,
113
- ) -> NDArray [_ScalarT ]: ...
113
+ ) -> _nt . Array [_ScalarT ]: ...
114
114
@overload
115
115
def vstack (
116
116
tup : Sequence [ArrayLike ],
117
117
* ,
118
118
dtype : DTypeLike | None = None ,
119
119
casting : np ._CastingKind = "same_kind" ,
120
- ) -> NDArray [Any ]: ...
120
+ ) -> _nt . Array [Any ]: ...
121
121
122
122
#
123
123
@overload
@@ -126,21 +126,21 @@ def hstack(
126
126
* ,
127
127
dtype : None = None ,
128
128
casting : np ._CastingKind = "same_kind" ,
129
- ) -> NDArray [_ScalarT ]: ...
129
+ ) -> _nt . Array [_ScalarT ]: ...
130
130
@overload
131
131
def hstack (
132
132
tup : Sequence [ArrayLike ],
133
133
* ,
134
134
dtype : _DTypeLike [_ScalarT ],
135
135
casting : np ._CastingKind = "same_kind" ,
136
- ) -> NDArray [_ScalarT ]: ...
136
+ ) -> _nt . Array [_ScalarT ]: ...
137
137
@overload
138
138
def hstack (
139
139
tup : Sequence [ArrayLike ],
140
140
* ,
141
141
dtype : DTypeLike | None = None ,
142
142
casting : np ._CastingKind = "same_kind" ,
143
- ) -> NDArray [Any ]: ...
143
+ ) -> _nt . Array [Any ]: ...
144
144
145
145
#
146
146
@overload
@@ -151,7 +151,7 @@ def stack(
151
151
* ,
152
152
dtype : None = None ,
153
153
casting : np ._CastingKind = "same_kind" ,
154
- ) -> NDArray [_ScalarT ]: ...
154
+ ) -> _nt . Array [_ScalarT ]: ...
155
155
@overload
156
156
def stack (
157
157
arrays : Sequence [ArrayLike ],
@@ -160,7 +160,7 @@ def stack(
160
160
* ,
161
161
dtype : _DTypeLike [_ScalarT ],
162
162
casting : np ._CastingKind = "same_kind" ,
163
- ) -> NDArray [_ScalarT ]: ...
163
+ ) -> _nt . Array [_ScalarT ]: ...
164
164
@overload
165
165
def stack (
166
166
arrays : Sequence [ArrayLike ],
@@ -169,7 +169,7 @@ def stack(
169
169
* ,
170
170
dtype : DTypeLike | None = None ,
171
171
casting : np ._CastingKind = "same_kind" ,
172
- ) -> NDArray [Any ]: ...
172
+ ) -> _nt . Array [Any ]: ...
173
173
@overload
174
174
def stack (
175
175
arrays : Sequence [ArrayLike ],
@@ -191,12 +191,12 @@ def stack(
191
191
192
192
#
193
193
@overload
194
- def unstack (array : _ArrayLike [_ScalarT ], / , * , axis : SupportsIndex = 0 ) -> tuple [NDArray [_ScalarT ], ...]: ...
194
+ def unstack (array : _ArrayLike [_ScalarT ], / , * , axis : SupportsIndex = 0 ) -> tuple [_nt . Array [_ScalarT ], ...]: ...
195
195
@overload
196
- def unstack (array : ArrayLike , / , * , axis : SupportsIndex = 0 ) -> tuple [NDArray [Any ], ...]: ...
196
+ def unstack (array : ArrayLike , / , * , axis : SupportsIndex = 0 ) -> tuple [_nt . Array [Any ], ...]: ...
197
197
198
198
#
199
199
@overload
200
- def block (arrays : _ArrayLike [_ScalarT ]) -> NDArray [_ScalarT ]: ...
200
+ def block (arrays : _ArrayLike [_ScalarT ]) -> _nt . Array [_ScalarT ]: ...
201
201
@overload
202
- def block (arrays : ArrayLike ) -> NDArray [Any ]: ...
202
+ def block (arrays : ArrayLike ) -> _nt . Array [Any ]: ...
0 commit comments