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