@@ -6,85 +6,177 @@ from typing import Any, Mapping, List, Optional, Tuple, Union
6
6
from numpy .core ._internal import _ctypes
7
7
8
8
class dtype :
9
- alignment : int
10
- byteorder : str
11
- char : str
12
- descr : List [Union [Tuple [str , str ], Tuple [str , str , Tuple [int , ...]]]]
13
- fields : Optional [Mapping [str , Union [Tuple [dtype , int ], Tuple [dtype , int , str ]]]]
14
- flags : int
15
- hasobject : bool
16
- isbuiltin : int
17
- isnative : bool
18
- isalignedstruct : bool
19
- itemsize : int
20
- kind : str
21
- name : str
22
9
names : Optional [Tuple [str , ...]]
23
- num : int
24
- shape : Tuple [int , ...]
25
- ndim : int
26
- subdtype : Optional [Tuple [dtype , Tuple [int , ...]]]
10
+ updateifcopy : bool
11
+ writeable : bool
12
+ writebackifcopy : bool
13
+
14
+ @property
15
+ def alignment (self ) -> int : ...
27
16
17
+ @property
18
+ def base (self ) -> dtype : ...
28
19
29
- def newbyteorder (self , new_order : str = ...): dtype
20
+ @property
21
+ def byteorder (self ) -> str : ...
30
22
31
- str : builtins . str
32
- type : builtins . type
23
+ @ property
24
+ def char ( self ) -> str : ...
33
25
34
26
@property
35
- def base (self ) -> dtype : ...
27
+ def descr (self ) -> List [Union [
28
+ Tuple [str , str ],
29
+ Tuple [str , str , Tuple [int , ...]]]]: ...
30
+
31
+ @property
32
+ def fields (self ) -> Optional [Mapping [
33
+ str ,
34
+ Union [Tuple [dtype , int ],
35
+ Tuple [dtype , int , Any ]]]]: ...
36
+
37
+ @property
38
+ def flags (self ) -> int : ...
39
+
40
+ @property
41
+ def hasobject (self ) -> bool : ...
42
+
43
+ @property
44
+ def isbuiltin (self ) -> int : ...
45
+
46
+ @property
47
+ def isnative (self ) -> bool : ...
48
+
49
+ @property
50
+ def isalignedstruct (self ) -> bool : ...
51
+
52
+ @property
53
+ def itemsize (self ) -> int : ...
54
+
55
+ @property
56
+ def kind (self ) -> str : ...
57
+
58
+ @property
59
+ def name (self ) -> str : ...
60
+
61
+ @property
62
+ def num (self ) -> int : ...
63
+
64
+ @property
65
+ def shape (self ) -> Tuple [int , ...]: ...
66
+
67
+ @property
68
+ def ndim (self ) -> int : ...
69
+
70
+ @property
71
+ def subdtype (self ) -> Optional [Tuple [dtype , Tuple [int , ...]]]: ...
72
+
73
+ def newbyteorder (self , new_order : str = ...) -> dtype : ...
74
+
75
+ # Leave str and type for end to avoid having to use `builtins.str`
76
+ # everywhere. See https://github.com/python/mypy/issues/3775
77
+ @property
78
+ def str (self ) -> builtins .str : ...
79
+
80
+ @property
81
+ def type (self ) -> builtins .type : ...
36
82
37
83
38
84
_dtype_class = dtype # for ndarray type
39
85
40
86
41
87
class _flagsobj :
42
88
aligned : bool
43
- behaved : bool
44
- c_contiguous : bool
45
- carray : bool
46
- contiguous : bool
47
- f_contiguous : bool
48
- farray : bool
49
- fnc : bool
50
- forc : bool
51
- fortran : bool
52
- num : bool
53
- owndata : bool
54
- updateifcopy : bool
55
- writeable : bool
56
- writebackifcopy : bool
89
+
90
+ @property
91
+ def behaved (self ) -> bool : ...
92
+
93
+ @property
94
+ def c_contiguous (self ) -> bool : ...
95
+
96
+ @property
97
+ def carray (self ) -> bool : ...
98
+
99
+ @property
100
+ def contiguous (self ) -> bool : ...
101
+
102
+ @property
103
+ def f_contiguous (self ) -> bool : ...
104
+
105
+ @property
106
+ def farray (self ) -> bool : ...
107
+
108
+ @property
109
+ def fnc (self ) -> bool : ...
110
+
111
+ @property
112
+ def forc (self ) -> bool : ...
113
+
114
+ @property
115
+ def fortran (self ) -> bool : ...
116
+
117
+ @property
118
+ def num (self ) -> int : ...
119
+
120
+ @property
121
+ def owndata (self ) -> bool : ...
57
122
58
123
def __getitem__ (self , key : str ) -> bool : ...
59
124
def __setitem__ (self , key : str , value : bool ) -> None : ...
60
125
61
126
62
127
class flatiter :
63
- base : ndarray
64
- coords : Tuple [int , ...]
65
- index : int
128
+ @property
129
+ def base (self ) -> ndarray : ...
130
+
131
+ @property
132
+ def coords (self ) -> Tuple [int , ...]: ...
133
+
134
+ @property
135
+ def index (self ) -> int : ...
66
136
67
137
def copy (self ) -> ndarray : ...
68
138
def __iter__ (self ) -> flatiter : ...
69
139
def __next__ (self ) -> Any : ...
70
140
71
141
72
142
class ndarray :
73
- T : ndarray
74
- data : memoryview
75
143
dtype : _dtype_class
76
- flags : _flagsobj
77
- flat : flatiter
78
144
imag : ndarray
79
145
real : ndarray
80
- size : int
81
- itemsize : int
82
- nbytes : int
83
- ndim : int
84
146
shape : Tuple [int , ...]
85
147
strides : Tuple [int , ...]
86
- ctypes : _ctypes
87
- base : Optional [ndarray ]
148
+
149
+ @property
150
+ def T (self ) -> ndarray : ...
151
+
152
+ @property
153
+ def dat (self ) -> memoryview : ...
154
+
155
+ @property
156
+ def flags (self ) -> _flagsobj : ...
157
+
158
+ @property
159
+ def flat (self ) -> flatiter : ...
160
+
161
+ @property
162
+ def size (self ) -> int : ...
163
+
164
+ @property
165
+ def itemsize (self ) -> int : ...
166
+
167
+ @property
168
+ def nbytes (self ) -> int : ...
169
+
170
+ @property
171
+ def ndim (self ) -> int : ...
172
+
173
+ @property
174
+ def ctypes (self ) -> _ctypes : ...
175
+
176
+ @property
177
+ def base (self ) -> Optional [ndarray ]: ...
178
+
179
+ def __getattr__ (self , name ) -> Any : ...
88
180
89
181
90
182
def array (
0 commit comments