1
- from typing import Any , Literal as L , SupportsIndex , TypeAlias , overload
1
+ from _typeshed import Incomplete
2
+ from typing import Literal as L , SupportsIndex , TypeAlias , overload
2
3
from typing_extensions import TypeVar
3
4
5
+ import _numtype as _nt
4
6
import numpy as np
5
- from numpy ._typing import DTypeLike , NDArray , _ArrayLikeFloat_co , _ArrayLikeNumber_co , _DTypeLike
7
+ from numpy ._typing import DTypeLike , _ArrayLikeFloat_co , _ArrayLikeNumber_co , _DTypeLike
6
8
7
9
__all__ = ["geomspace" , "linspace" , "logspace" ]
8
10
@@ -25,7 +27,7 @@ def linspace(
25
27
axis : SupportsIndex = 0 ,
26
28
* ,
27
29
device : _Device | None = None ,
28
- ) -> NDArray [np .floating ]: ...
30
+ ) -> _nt . Array [np .floating ]: ...
29
31
@overload
30
32
def linspace (
31
33
start : _ArrayLikeNumber_co ,
@@ -37,7 +39,7 @@ def linspace(
37
39
axis : SupportsIndex = 0 ,
38
40
* ,
39
41
device : _Device | None = None ,
40
- ) -> NDArray [np .inexact ]: ...
42
+ ) -> _nt . Array [np .inexact ]: ...
41
43
@overload
42
44
def linspace (
43
45
start : _ArrayLikeNumber_co ,
@@ -49,7 +51,7 @@ def linspace(
49
51
axis : SupportsIndex = 0 ,
50
52
* ,
51
53
device : _Device | None = None ,
52
- ) -> NDArray [_ScalarT ]: ...
54
+ ) -> _nt . Array [_ScalarT ]: ...
53
55
@overload
54
56
def linspace (
55
57
start : _ArrayLikeNumber_co ,
@@ -61,7 +63,7 @@ def linspace(
61
63
dtype : _DTypeLike [_ScalarT ],
62
64
axis : SupportsIndex = 0 ,
63
65
device : _Device | None = None ,
64
- ) -> NDArray [_ScalarT ]: ...
66
+ ) -> _nt . Array [_ScalarT ]: ...
65
67
@overload
66
68
def linspace (
67
69
start : _ArrayLikeNumber_co ,
@@ -73,7 +75,7 @@ def linspace(
73
75
axis : SupportsIndex = 0 ,
74
76
* ,
75
77
device : _Device | None = None ,
76
- ) -> NDArray [ Any ]: ...
78
+ ) -> _nt . Array [ Incomplete ]: ...
77
79
@overload
78
80
def linspace (
79
81
start : _ArrayLikeFloat_co ,
@@ -85,7 +87,7 @@ def linspace(
85
87
dtype : None = None ,
86
88
axis : SupportsIndex = 0 ,
87
89
device : _Device | None = None ,
88
- ) -> tuple [NDArray [np .floating ], np .floating ]: ...
90
+ ) -> tuple [_nt . Array [np .floating ], np .floating ]: ...
89
91
@overload
90
92
def linspace (
91
93
start : _ArrayLikeNumber_co ,
@@ -97,7 +99,7 @@ def linspace(
97
99
dtype : None = None ,
98
100
axis : SupportsIndex = 0 ,
99
101
device : _Device | None = None ,
100
- ) -> tuple [NDArray [np .inexact ], np .inexact ]: ...
102
+ ) -> tuple [_nt . Array [np .inexact ], np .inexact ]: ...
101
103
@overload
102
104
def linspace (
103
105
start : _ArrayLikeNumber_co ,
@@ -109,7 +111,7 @@ def linspace(
109
111
dtype : _DTypeLike [_ScalarT ],
110
112
axis : SupportsIndex = 0 ,
111
113
device : _Device | None = None ,
112
- ) -> tuple [NDArray [_ScalarT ], _ScalarT ]: ...
114
+ ) -> tuple [_nt . Array [_ScalarT ], _ScalarT ]: ...
113
115
@overload
114
116
def linspace (
115
117
start : _ArrayLikeNumber_co ,
@@ -121,7 +123,7 @@ def linspace(
121
123
dtype : DTypeLike = ...,
122
124
axis : SupportsIndex = 0 ,
123
125
device : _Device | None = None ,
124
- ) -> tuple [NDArray [ Any ], Any ]: ...
126
+ ) -> tuple [_nt . Array [ Incomplete ], Incomplete ]: ...
125
127
126
128
#
127
129
@overload
@@ -133,7 +135,7 @@ def logspace(
133
135
base : _ArrayLikeFloat_co = 10.0 ,
134
136
dtype : None = None ,
135
137
axis : SupportsIndex = 0 ,
136
- ) -> NDArray [np .floating ]: ...
138
+ ) -> _nt . Array [np .floating ]: ...
137
139
@overload
138
140
def logspace (
139
141
start : _ArrayLikeNumber_co ,
@@ -143,7 +145,7 @@ def logspace(
143
145
base : _ArrayLikeNumber_co = 10.0 ,
144
146
dtype : None = None ,
145
147
axis : SupportsIndex = 0 ,
146
- ) -> NDArray [np .inexact ]: ...
148
+ ) -> _nt . Array [np .inexact ]: ...
147
149
@overload
148
150
def logspace (
149
151
start : _ArrayLikeNumber_co ,
@@ -153,7 +155,7 @@ def logspace(
153
155
base : _ArrayLikeNumber_co ,
154
156
dtype : _DTypeLike [_ScalarT ],
155
157
axis : SupportsIndex = 0 ,
156
- ) -> NDArray [_ScalarT ]: ...
158
+ ) -> _nt . Array [_ScalarT ]: ...
157
159
@overload
158
160
def logspace (
159
161
start : _ArrayLikeNumber_co ,
@@ -164,7 +166,7 @@ def logspace(
164
166
* ,
165
167
dtype : _DTypeLike [_ScalarT ],
166
168
axis : SupportsIndex = 0 ,
167
- ) -> NDArray [_ScalarT ]: ...
169
+ ) -> _nt . Array [_ScalarT ]: ...
168
170
@overload
169
171
def logspace (
170
172
start : _ArrayLikeNumber_co ,
@@ -174,7 +176,7 @@ def logspace(
174
176
base : _ArrayLikeNumber_co = 10.0 ,
175
177
dtype : DTypeLike = ...,
176
178
axis : SupportsIndex = 0 ,
177
- ) -> NDArray [ Any ]: ...
179
+ ) -> _nt . Array [ Incomplete ]: ...
178
180
179
181
#
180
182
@overload
@@ -185,7 +187,7 @@ def geomspace(
185
187
endpoint : bool = True ,
186
188
dtype : None = None ,
187
189
axis : SupportsIndex = 0 ,
188
- ) -> NDArray [np .floating ]: ...
190
+ ) -> _nt . Array [np .floating ]: ...
189
191
@overload
190
192
def geomspace (
191
193
start : _ArrayLikeNumber_co ,
@@ -194,7 +196,7 @@ def geomspace(
194
196
endpoint : bool = True ,
195
197
dtype : None = None ,
196
198
axis : SupportsIndex = 0 ,
197
- ) -> NDArray [np .inexact ]: ...
199
+ ) -> _nt . Array [np .inexact ]: ...
198
200
@overload
199
201
def geomspace (
200
202
start : _ArrayLikeNumber_co ,
@@ -203,7 +205,7 @@ def geomspace(
203
205
endpoint : bool ,
204
206
dtype : _DTypeLike [_ScalarT ],
205
207
axis : SupportsIndex = 0 ,
206
- ) -> NDArray [_ScalarT ]: ...
208
+ ) -> _nt . Array [_ScalarT ]: ...
207
209
@overload
208
210
def geomspace (
209
211
start : _ArrayLikeNumber_co ,
@@ -213,7 +215,7 @@ def geomspace(
213
215
* ,
214
216
dtype : _DTypeLike [_ScalarT ],
215
217
axis : SupportsIndex = 0 ,
216
- ) -> NDArray [_ScalarT ]: ...
218
+ ) -> _nt . Array [_ScalarT ]: ...
217
219
@overload
218
220
def geomspace (
219
221
start : _ArrayLikeNumber_co ,
@@ -222,7 +224,7 @@ def geomspace(
222
224
endpoint : bool = True ,
223
225
dtype : DTypeLike | None = None ,
224
226
axis : SupportsIndex = 0 ,
225
- ) -> NDArray [ Any ]: ...
227
+ ) -> _nt . Array [ Incomplete ]: ...
226
228
227
229
#
228
230
def add_newdoc (
0 commit comments