numpy 2.3.1__pp311-pypy311_pp73-win_amd64.whl → 2.3.3__pp311-pypy311_pp73-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of numpy might be problematic. Click here for more details.
- numpy/__config__.py +14 -14
- numpy/__init__.py +4 -4
- numpy/__init__.pyi +192 -32
- numpy/_core/_multiarray_tests.pypy311-pp73-win_amd64.lib +0 -0
- numpy/_core/_multiarray_tests.pypy311-pp73-win_amd64.pyd +0 -0
- numpy/_core/_multiarray_umath.pypy311-pp73-win_amd64.lib +0 -0
- numpy/_core/_multiarray_umath.pypy311-pp73-win_amd64.pyd +0 -0
- numpy/_core/_operand_flag_tests.pypy311-pp73-win_amd64.lib +0 -0
- numpy/_core/_operand_flag_tests.pypy311-pp73-win_amd64.pyd +0 -0
- numpy/_core/_rational_tests.pypy311-pp73-win_amd64.lib +0 -0
- numpy/_core/_rational_tests.pypy311-pp73-win_amd64.pyd +0 -0
- numpy/_core/_simd.pypy311-pp73-win_amd64.lib +0 -0
- numpy/_core/_simd.pypy311-pp73-win_amd64.pyd +0 -0
- numpy/_core/_struct_ufunc_tests.pypy311-pp73-win_amd64.lib +0 -0
- numpy/_core/_struct_ufunc_tests.pypy311-pp73-win_amd64.pyd +0 -0
- numpy/_core/_umath_tests.pypy311-pp73-win_amd64.lib +0 -0
- numpy/_core/_umath_tests.pypy311-pp73-win_amd64.pyd +0 -0
- numpy/_core/defchararray.pyi +60 -10
- numpy/_core/lib/npymath.lib +0 -0
- numpy/_core/lib/pkgconfig/numpy.pc +1 -1
- numpy/_core/tests/test_datetime.py +24 -0
- numpy/_core/tests/test_multiarray.py +15 -0
- numpy/_core/tests/test_stringdtype.py +37 -0
- numpy/_core/tests/test_strings.py +4 -0
- numpy/_core/tests/test_ufunc.py +41 -1
- numpy/_typing/_callable.pyi +4 -91
- numpy/distutils/__pycache__/conv_template.pypy311.pyc +0 -0
- numpy/fft/_pocketfft_umath.pypy311-pp73-win_amd64.lib +0 -0
- numpy/fft/_pocketfft_umath.pypy311-pp73-win_amd64.pyd +0 -0
- numpy/lib/_arraysetops_impl.pyi +24 -0
- numpy/lib/_npyio_impl.py +1 -1
- numpy/lib/tests/test_io.py +17 -0
- numpy/linalg/_linalg.py +1 -0
- numpy/linalg/_umath_linalg.pypy311-pp73-win_amd64.lib +0 -0
- numpy/linalg/_umath_linalg.pypy311-pp73-win_amd64.pyd +0 -0
- numpy/linalg/lapack_lite.pypy311-pp73-win_amd64.lib +0 -0
- numpy/linalg/lapack_lite.pypy311-pp73-win_amd64.pyd +0 -0
- numpy/linalg/tests/test_linalg.py +14 -1
- numpy/random/_bounded_integers.pypy311-pp73-win_amd64.lib +0 -0
- numpy/random/_bounded_integers.pypy311-pp73-win_amd64.pyd +0 -0
- numpy/random/_common.pypy311-pp73-win_amd64.lib +0 -0
- numpy/random/_common.pypy311-pp73-win_amd64.pyd +0 -0
- numpy/random/_generator.pypy311-pp73-win_amd64.lib +0 -0
- numpy/random/_generator.pypy311-pp73-win_amd64.pyd +0 -0
- numpy/random/_mt19937.pypy311-pp73-win_amd64.lib +0 -0
- numpy/random/_mt19937.pypy311-pp73-win_amd64.pyd +0 -0
- numpy/random/_pcg64.pypy311-pp73-win_amd64.lib +0 -0
- numpy/random/_pcg64.pypy311-pp73-win_amd64.pyd +0 -0
- numpy/random/_philox.pypy311-pp73-win_amd64.lib +0 -0
- numpy/random/_philox.pypy311-pp73-win_amd64.pyd +0 -0
- numpy/random/_sfc64.pypy311-pp73-win_amd64.lib +0 -0
- numpy/random/_sfc64.pypy311-pp73-win_amd64.pyd +0 -0
- numpy/random/bit_generator.pypy311-pp73-win_amd64.lib +0 -0
- numpy/random/bit_generator.pypy311-pp73-win_amd64.pyd +0 -0
- numpy/random/lib/npyrandom.lib +0 -0
- numpy/random/mtrand.pypy311-pp73-win_amd64.lib +0 -0
- numpy/random/mtrand.pypy311-pp73-win_amd64.pyd +0 -0
- numpy/tests/test_configtool.py +1 -1
- numpy/typing/tests/data/fail/arithmetic.pyi +1 -1
- numpy/typing/tests/data/fail/bitwise_ops.pyi +1 -1
- numpy/typing/tests/data/reveal/array_constructors.pyi +2 -0
- numpy/typing/tests/data/reveal/char.pyi +6 -0
- numpy/typing/tests/data/reveal/ma.pyi +1 -2
- numpy/version.py +2 -2
- numpy-2.3.3.dist-info/DELVEWHEEL +2 -0
- {numpy-2.3.1.dist-info → numpy-2.3.3.dist-info}/LICENSE.txt +881 -881
- {numpy-2.3.1.dist-info → numpy-2.3.3.dist-info}/METADATA +2 -1
- {numpy-2.3.1.dist-info → numpy-2.3.3.dist-info}/RECORD +73 -73
- numpy.libs/{libscipy_openblas64_-13e2df515630b4a41f92893938845698.dll → libscipy_openblas64_-860d95b1c38e637ce4509f5fa24fbf2a.dll} +0 -0
- numpy.libs/{msvcp140-263139962577ecda4cd9469ca360a746.dll → msvcp140-24e15af6186124e0e662805e8330f910.dll} +0 -0
- numpy.libs/vcruntime140_1-34048abaa070ecc13b318cea31425f4c.dll +0 -0
- numpy-2.3.1.dist-info/DELVEWHEEL +0 -2
- numpy.libs/vcruntime140_1-db312421deff8dc10e7a1dc030f0c722.dll +0 -0
- {numpy-2.3.1.dist-info → numpy-2.3.3.dist-info}/WHEEL +0 -0
- {numpy-2.3.1.dist-info → numpy-2.3.3.dist-info}/entry_points.txt +0 -0
numpy/__config__.py
CHANGED
|
@@ -33,7 +33,7 @@ CONFIG = _cleanup(
|
|
|
33
33
|
"c": {
|
|
34
34
|
"name": "msvc",
|
|
35
35
|
"linker": r"link",
|
|
36
|
-
"version": "19.
|
|
36
|
+
"version": "19.44.35215",
|
|
37
37
|
"commands": r"cl",
|
|
38
38
|
"args": r"",
|
|
39
39
|
"linker args": r"",
|
|
@@ -41,7 +41,7 @@ CONFIG = _cleanup(
|
|
|
41
41
|
"cython": {
|
|
42
42
|
"name": "cython",
|
|
43
43
|
"linker": r"cython",
|
|
44
|
-
"version": "3.1.
|
|
44
|
+
"version": "3.1.3",
|
|
45
45
|
"commands": r"cython",
|
|
46
46
|
"args": r"",
|
|
47
47
|
"linker args": r"",
|
|
@@ -49,7 +49,7 @@ CONFIG = _cleanup(
|
|
|
49
49
|
"c++": {
|
|
50
50
|
"name": "msvc",
|
|
51
51
|
"linker": r"link",
|
|
52
|
-
"version": "19.
|
|
52
|
+
"version": "19.44.35215",
|
|
53
53
|
"commands": r"cl",
|
|
54
54
|
"args": r"",
|
|
55
55
|
"linker args": r"",
|
|
@@ -74,26 +74,26 @@ CONFIG = _cleanup(
|
|
|
74
74
|
"blas": {
|
|
75
75
|
"name": "scipy-openblas",
|
|
76
76
|
"found": bool("True".lower().replace("false", "")),
|
|
77
|
-
"version": "0.3.
|
|
77
|
+
"version": "0.3.30",
|
|
78
78
|
"detection method": "pkgconfig",
|
|
79
|
-
"include directory": r"C:/Users/runneradmin/AppData/Local/Temp/cibw-run-
|
|
80
|
-
"lib directory": r"C:/Users/runneradmin/AppData/Local/Temp/cibw-run-
|
|
81
|
-
"openblas configuration": r"OpenBLAS 0.3.
|
|
82
|
-
"pc file directory": r"D:/a/numpy/numpy/.openblas",
|
|
79
|
+
"include directory": r"C:/Users/runneradmin/AppData/Local/Temp/cibw-run-eoug4fy5/pp311-win_amd64/build/venv/Lib/site-packages/scipy_openblas64/include",
|
|
80
|
+
"lib directory": r"C:/Users/runneradmin/AppData/Local/Temp/cibw-run-eoug4fy5/pp311-win_amd64/build/venv/Lib/site-packages/scipy_openblas64/lib",
|
|
81
|
+
"openblas configuration": r"OpenBLAS 0.3.30 USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell MAX_THREADS=24",
|
|
82
|
+
"pc file directory": r"D:/a/numpy-release/numpy-release/.openblas",
|
|
83
83
|
},
|
|
84
84
|
"lapack": {
|
|
85
85
|
"name": "scipy-openblas",
|
|
86
86
|
"found": bool("True".lower().replace("false", "")),
|
|
87
|
-
"version": "0.3.
|
|
87
|
+
"version": "0.3.30",
|
|
88
88
|
"detection method": "pkgconfig",
|
|
89
|
-
"include directory": r"C:/Users/runneradmin/AppData/Local/Temp/cibw-run-
|
|
90
|
-
"lib directory": r"C:/Users/runneradmin/AppData/Local/Temp/cibw-run-
|
|
91
|
-
"openblas configuration": r"OpenBLAS 0.3.
|
|
92
|
-
"pc file directory": r"D:/a/numpy/numpy/.openblas",
|
|
89
|
+
"include directory": r"C:/Users/runneradmin/AppData/Local/Temp/cibw-run-eoug4fy5/pp311-win_amd64/build/venv/Lib/site-packages/scipy_openblas64/include",
|
|
90
|
+
"lib directory": r"C:/Users/runneradmin/AppData/Local/Temp/cibw-run-eoug4fy5/pp311-win_amd64/build/venv/Lib/site-packages/scipy_openblas64/lib",
|
|
91
|
+
"openblas configuration": r"OpenBLAS 0.3.30 USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell MAX_THREADS=24",
|
|
92
|
+
"pc file directory": r"D:/a/numpy-release/numpy-release/.openblas",
|
|
93
93
|
},
|
|
94
94
|
},
|
|
95
95
|
"Python Information": {
|
|
96
|
-
"path": r"C:\Users\runneradmin\AppData\Local\Temp\build-env-
|
|
96
|
+
"path": r"C:\Users\runneradmin\AppData\Local\Temp\build-env-yfop8n90\Scripts\python.exe",
|
|
97
97
|
"version": "3.11",
|
|
98
98
|
},
|
|
99
99
|
"SIMD Extensions": {
|
numpy/__init__.py
CHANGED
|
@@ -88,14 +88,14 @@ Exceptions to this rule are documented.
|
|
|
88
88
|
|
|
89
89
|
|
|
90
90
|
# start delvewheel patch
|
|
91
|
-
def
|
|
91
|
+
def _delvewheel_patch_1_11_1():
|
|
92
92
|
import os
|
|
93
93
|
if os.path.isdir(libs_dir := os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'numpy.libs'))):
|
|
94
94
|
os.add_dll_directory(libs_dir)
|
|
95
95
|
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
del
|
|
97
|
+
_delvewheel_patch_1_11_1()
|
|
98
|
+
del _delvewheel_patch_1_11_1
|
|
99
99
|
# end delvewheel patch
|
|
100
100
|
|
|
101
101
|
import os
|
|
@@ -938,4 +938,4 @@ else:
|
|
|
938
938
|
|
|
939
939
|
|
|
940
940
|
# Remove symbols imported for internal use
|
|
941
|
-
del os, sys, warnings
|
|
941
|
+
del os, sys, warnings
|
numpy/__init__.pyi
CHANGED
|
@@ -134,12 +134,6 @@ from numpy._typing import (
|
|
|
134
134
|
)
|
|
135
135
|
|
|
136
136
|
from numpy._typing._callable import (
|
|
137
|
-
_BoolOp,
|
|
138
|
-
_BoolBitOp,
|
|
139
|
-
_BoolSub,
|
|
140
|
-
_BoolTrueDiv,
|
|
141
|
-
_BoolMod,
|
|
142
|
-
_BoolDivMod,
|
|
143
137
|
_IntTrueDiv,
|
|
144
138
|
_UnsignedIntOp,
|
|
145
139
|
_UnsignedIntBitOp,
|
|
@@ -803,6 +797,7 @@ _1NShapeT = TypeVar("_1NShapeT", bound=tuple[L[1], *tuple[L[1], ...]]) # (1,) |
|
|
|
803
797
|
_ScalarT = TypeVar("_ScalarT", bound=generic)
|
|
804
798
|
_ScalarT_co = TypeVar("_ScalarT_co", bound=generic, default=Any, covariant=True)
|
|
805
799
|
_NumberT = TypeVar("_NumberT", bound=number)
|
|
800
|
+
_InexactT = TypeVar("_InexactT", bound=inexact)
|
|
806
801
|
_RealNumberT = TypeVar("_RealNumberT", bound=floating | integer)
|
|
807
802
|
_FloatingT_co = TypeVar("_FloatingT_co", bound=floating, default=floating, covariant=True)
|
|
808
803
|
_IntegerT = TypeVar("_IntegerT", bound=integer)
|
|
@@ -2151,7 +2146,7 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]):
|
|
|
2151
2146
|
@strides.setter
|
|
2152
2147
|
def strides(self, value: _ShapeLike) -> None: ...
|
|
2153
2148
|
def byteswap(self, inplace: builtins.bool = ...) -> Self: ...
|
|
2154
|
-
def fill(self, value: Any) -> None: ...
|
|
2149
|
+
def fill(self, value: Any, /) -> None: ...
|
|
2155
2150
|
@property
|
|
2156
2151
|
def flat(self) -> flatiter[Self]: ...
|
|
2157
2152
|
|
|
@@ -3814,22 +3809,24 @@ class bool(generic[_BoolItemT_co], Generic[_BoolItemT_co]):
|
|
|
3814
3809
|
@property
|
|
3815
3810
|
def imag(self) -> np.bool[L[False]]: ...
|
|
3816
3811
|
|
|
3817
|
-
@overload
|
|
3818
|
-
def __init__(self: np.bool[
|
|
3812
|
+
@overload # mypy bug workaround: https://github.com/numpy/numpy/issues/29245
|
|
3813
|
+
def __init__(self: np.bool[builtins.bool], value: Never, /) -> None: ...
|
|
3819
3814
|
@overload
|
|
3820
3815
|
def __init__(self: np.bool[L[False]], value: _Falsy = ..., /) -> None: ...
|
|
3821
3816
|
@overload
|
|
3822
3817
|
def __init__(self: np.bool[L[True]], value: _Truthy, /) -> None: ...
|
|
3823
3818
|
@overload
|
|
3824
|
-
def __init__(self, value: object, /) -> None: ...
|
|
3819
|
+
def __init__(self: np.bool[builtins.bool], value: object, /) -> None: ...
|
|
3825
3820
|
|
|
3826
3821
|
def __bool__(self, /) -> _BoolItemT_co: ...
|
|
3822
|
+
|
|
3827
3823
|
@overload
|
|
3828
3824
|
def __int__(self: np.bool[L[False]], /) -> L[0]: ...
|
|
3829
3825
|
@overload
|
|
3830
3826
|
def __int__(self: np.bool[L[True]], /) -> L[1]: ...
|
|
3831
3827
|
@overload
|
|
3832
3828
|
def __int__(self, /) -> L[0, 1]: ...
|
|
3829
|
+
|
|
3833
3830
|
def __abs__(self) -> Self: ...
|
|
3834
3831
|
|
|
3835
3832
|
@overload
|
|
@@ -3839,23 +3836,191 @@ class bool(generic[_BoolItemT_co], Generic[_BoolItemT_co]):
|
|
|
3839
3836
|
@overload
|
|
3840
3837
|
def __invert__(self, /) -> np.bool: ...
|
|
3841
3838
|
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3839
|
+
@overload
|
|
3840
|
+
def __add__(self, other: _NumberT, /) -> _NumberT: ...
|
|
3841
|
+
@overload
|
|
3842
|
+
def __add__(self, other: builtins.bool | bool_, /) -> bool_: ...
|
|
3843
|
+
@overload
|
|
3844
|
+
def __add__(self, other: int, /) -> int_: ...
|
|
3845
|
+
@overload
|
|
3846
|
+
def __add__(self, other: float, /) -> float64: ...
|
|
3847
|
+
@overload
|
|
3848
|
+
def __add__(self, other: complex, /) -> complex128: ...
|
|
3849
|
+
|
|
3850
|
+
@overload
|
|
3851
|
+
def __radd__(self, other: _NumberT, /) -> _NumberT: ...
|
|
3852
|
+
@overload
|
|
3853
|
+
def __radd__(self, other: builtins.bool, /) -> bool_: ...
|
|
3854
|
+
@overload
|
|
3855
|
+
def __radd__(self, other: int, /) -> int_: ...
|
|
3856
|
+
@overload
|
|
3857
|
+
def __radd__(self, other: float, /) -> float64: ...
|
|
3858
|
+
@overload
|
|
3859
|
+
def __radd__(self, other: complex, /) -> complex128: ...
|
|
3860
|
+
|
|
3861
|
+
@overload
|
|
3862
|
+
def __sub__(self, other: _NumberT, /) -> _NumberT: ...
|
|
3863
|
+
@overload
|
|
3864
|
+
def __sub__(self, other: int, /) -> int_: ...
|
|
3865
|
+
@overload
|
|
3866
|
+
def __sub__(self, other: float, /) -> float64: ...
|
|
3867
|
+
@overload
|
|
3868
|
+
def __sub__(self, other: complex, /) -> complex128: ...
|
|
3869
|
+
|
|
3870
|
+
@overload
|
|
3871
|
+
def __rsub__(self, other: _NumberT, /) -> _NumberT: ...
|
|
3872
|
+
@overload
|
|
3873
|
+
def __rsub__(self, other: int, /) -> int_: ...
|
|
3874
|
+
@overload
|
|
3875
|
+
def __rsub__(self, other: float, /) -> float64: ...
|
|
3876
|
+
@overload
|
|
3877
|
+
def __rsub__(self, other: complex, /) -> complex128: ...
|
|
3878
|
+
|
|
3879
|
+
@overload
|
|
3880
|
+
def __mul__(self, other: _NumberT, /) -> _NumberT: ...
|
|
3881
|
+
@overload
|
|
3882
|
+
def __mul__(self, other: builtins.bool | bool_, /) -> bool_: ...
|
|
3883
|
+
@overload
|
|
3884
|
+
def __mul__(self, other: int, /) -> int_: ...
|
|
3885
|
+
@overload
|
|
3886
|
+
def __mul__(self, other: float, /) -> float64: ...
|
|
3887
|
+
@overload
|
|
3888
|
+
def __mul__(self, other: complex, /) -> complex128: ...
|
|
3889
|
+
|
|
3890
|
+
@overload
|
|
3891
|
+
def __rmul__(self, other: _NumberT, /) -> _NumberT: ...
|
|
3892
|
+
@overload
|
|
3893
|
+
def __rmul__(self, other: builtins.bool, /) -> bool_: ...
|
|
3894
|
+
@overload
|
|
3895
|
+
def __rmul__(self, other: int, /) -> int_: ...
|
|
3896
|
+
@overload
|
|
3897
|
+
def __rmul__(self, other: float, /) -> float64: ...
|
|
3898
|
+
@overload
|
|
3899
|
+
def __rmul__(self, other: complex, /) -> complex128: ...
|
|
3900
|
+
|
|
3901
|
+
@overload
|
|
3902
|
+
def __pow__(self, other: _NumberT, mod: None = None, /) -> _NumberT: ...
|
|
3903
|
+
@overload
|
|
3904
|
+
def __pow__(self, other: builtins.bool | bool_, mod: None = None, /) -> int8: ...
|
|
3905
|
+
@overload
|
|
3906
|
+
def __pow__(self, other: int, mod: None = None, /) -> int_: ...
|
|
3907
|
+
@overload
|
|
3908
|
+
def __pow__(self, other: float, mod: None = None, /) -> float64: ...
|
|
3909
|
+
@overload
|
|
3910
|
+
def __pow__(self, other: complex, mod: None = None, /) -> complex128: ...
|
|
3911
|
+
|
|
3912
|
+
@overload
|
|
3913
|
+
def __rpow__(self, other: _NumberT, mod: None = None, /) -> _NumberT: ...
|
|
3914
|
+
@overload
|
|
3915
|
+
def __rpow__(self, other: builtins.bool, mod: None = None, /) -> int8: ...
|
|
3916
|
+
@overload
|
|
3917
|
+
def __rpow__(self, other: int, mod: None = None, /) -> int_: ...
|
|
3918
|
+
@overload
|
|
3919
|
+
def __rpow__(self, other: float, mod: None = None, /) -> float64: ...
|
|
3920
|
+
@overload
|
|
3921
|
+
def __rpow__(self, other: complex, mod: None = None, /) -> complex128: ...
|
|
3922
|
+
|
|
3923
|
+
@overload
|
|
3924
|
+
def __truediv__(self, other: _InexactT, /) -> _InexactT: ...
|
|
3925
|
+
@overload
|
|
3926
|
+
def __truediv__(self, other: float | integer | bool_, /) -> float64: ...
|
|
3927
|
+
@overload
|
|
3928
|
+
def __truediv__(self, other: complex, /) -> complex128: ...
|
|
3929
|
+
|
|
3930
|
+
@overload
|
|
3931
|
+
def __rtruediv__(self, other: _InexactT, /) -> _InexactT: ...
|
|
3932
|
+
@overload
|
|
3933
|
+
def __rtruediv__(self, other: float | integer, /) -> float64: ...
|
|
3934
|
+
@overload
|
|
3935
|
+
def __rtruediv__(self, other: complex, /) -> complex128: ...
|
|
3936
|
+
|
|
3937
|
+
@overload
|
|
3938
|
+
def __floordiv__(self, other: _RealNumberT, /) -> _RealNumberT: ...
|
|
3939
|
+
@overload
|
|
3940
|
+
def __floordiv__(self, other: builtins.bool | bool_, /) -> int8: ...
|
|
3941
|
+
@overload
|
|
3942
|
+
def __floordiv__(self, other: int, /) -> int_: ...
|
|
3943
|
+
@overload
|
|
3944
|
+
def __floordiv__(self, other: float, /) -> float64: ...
|
|
3945
|
+
|
|
3946
|
+
@overload
|
|
3947
|
+
def __rfloordiv__(self, other: _RealNumberT, /) -> _RealNumberT: ...
|
|
3948
|
+
@overload
|
|
3949
|
+
def __rfloordiv__(self, other: builtins.bool, /) -> int8: ...
|
|
3950
|
+
@overload
|
|
3951
|
+
def __rfloordiv__(self, other: int, /) -> int_: ...
|
|
3952
|
+
@overload
|
|
3953
|
+
def __rfloordiv__(self, other: float, /) -> float64: ...
|
|
3954
|
+
|
|
3955
|
+
# keep in sync with __floordiv__
|
|
3956
|
+
@overload
|
|
3957
|
+
def __mod__(self, other: _RealNumberT, /) -> _RealNumberT: ...
|
|
3958
|
+
@overload
|
|
3959
|
+
def __mod__(self, other: builtins.bool | bool_, /) -> int8: ...
|
|
3960
|
+
@overload
|
|
3961
|
+
def __mod__(self, other: int, /) -> int_: ...
|
|
3962
|
+
@overload
|
|
3963
|
+
def __mod__(self, other: float, /) -> float64: ...
|
|
3964
|
+
|
|
3965
|
+
# keep in sync with __rfloordiv__
|
|
3966
|
+
@overload
|
|
3967
|
+
def __rmod__(self, other: _RealNumberT, /) -> _RealNumberT: ...
|
|
3968
|
+
@overload
|
|
3969
|
+
def __rmod__(self, other: builtins.bool, /) -> int8: ...
|
|
3970
|
+
@overload
|
|
3971
|
+
def __rmod__(self, other: int, /) -> int_: ...
|
|
3972
|
+
@overload
|
|
3973
|
+
def __rmod__(self, other: float, /) -> float64: ...
|
|
3974
|
+
|
|
3975
|
+
# keep in sync with __mod__
|
|
3976
|
+
@overload
|
|
3977
|
+
def __divmod__(self, other: _RealNumberT, /) -> _2Tuple[_RealNumberT]: ...
|
|
3978
|
+
@overload
|
|
3979
|
+
def __divmod__(self, other: builtins.bool | bool_, /) -> _2Tuple[int8]: ...
|
|
3980
|
+
@overload
|
|
3981
|
+
def __divmod__(self, other: int, /) -> _2Tuple[int_]: ...
|
|
3982
|
+
@overload
|
|
3983
|
+
def __divmod__(self, other: float, /) -> _2Tuple[float64]: ...
|
|
3984
|
+
|
|
3985
|
+
# keep in sync with __rmod__
|
|
3986
|
+
@overload
|
|
3987
|
+
def __rdivmod__(self, other: _RealNumberT, /) -> _2Tuple[_RealNumberT]: ...
|
|
3988
|
+
@overload
|
|
3989
|
+
def __rdivmod__(self, other: builtins.bool, /) -> _2Tuple[int8]: ...
|
|
3990
|
+
@overload
|
|
3991
|
+
def __rdivmod__(self, other: int, /) -> _2Tuple[int_]: ...
|
|
3992
|
+
@overload
|
|
3993
|
+
def __rdivmod__(self, other: float, /) -> _2Tuple[float64]: ...
|
|
3994
|
+
|
|
3995
|
+
@overload
|
|
3996
|
+
def __lshift__(self, other: _IntegerT, /) -> _IntegerT: ...
|
|
3997
|
+
@overload
|
|
3998
|
+
def __lshift__(self, other: builtins.bool | bool_, /) -> int8: ...
|
|
3999
|
+
@overload
|
|
4000
|
+
def __lshift__(self, other: int, /) -> int_: ...
|
|
4001
|
+
|
|
4002
|
+
@overload
|
|
4003
|
+
def __rlshift__(self, other: _IntegerT, /) -> _IntegerT: ...
|
|
4004
|
+
@overload
|
|
4005
|
+
def __rlshift__(self, other: builtins.bool, /) -> int8: ...
|
|
4006
|
+
@overload
|
|
4007
|
+
def __rlshift__(self, other: int, /) -> int_: ...
|
|
4008
|
+
|
|
4009
|
+
# keep in sync with __lshift__
|
|
4010
|
+
@overload
|
|
4011
|
+
def __rshift__(self, other: _IntegerT, /) -> _IntegerT: ...
|
|
4012
|
+
@overload
|
|
4013
|
+
def __rshift__(self, other: builtins.bool | bool_, /) -> int8: ...
|
|
4014
|
+
@overload
|
|
4015
|
+
def __rshift__(self, other: int, /) -> int_: ...
|
|
4016
|
+
|
|
4017
|
+
# keep in sync with __rlshift__
|
|
4018
|
+
@overload
|
|
4019
|
+
def __rrshift__(self, other: _IntegerT, /) -> _IntegerT: ...
|
|
4020
|
+
@overload
|
|
4021
|
+
def __rrshift__(self, other: builtins.bool, /) -> int8: ...
|
|
4022
|
+
@overload
|
|
4023
|
+
def __rrshift__(self, other: int, /) -> int_: ...
|
|
3859
4024
|
|
|
3860
4025
|
@overload
|
|
3861
4026
|
def __and__(self: np.bool[L[False]], other: builtins.bool | np.bool, /) -> np.bool[L[False]]: ...
|
|
@@ -3899,11 +4064,6 @@ class bool(generic[_BoolItemT_co], Generic[_BoolItemT_co]):
|
|
|
3899
4064
|
def __or__(self, other: int, /) -> np.bool | intp: ...
|
|
3900
4065
|
__ror__ = __or__
|
|
3901
4066
|
|
|
3902
|
-
__mod__: _BoolMod
|
|
3903
|
-
__rmod__: _BoolMod
|
|
3904
|
-
__divmod__: _BoolDivMod
|
|
3905
|
-
__rdivmod__: _BoolDivMod
|
|
3906
|
-
|
|
3907
4067
|
__lt__: _ComparisonOpLT[_NumberLike_co, _ArrayLikeNumber_co]
|
|
3908
4068
|
__le__: _ComparisonOpLE[_NumberLike_co, _ArrayLikeNumber_co]
|
|
3909
4069
|
__gt__: _ComparisonOpGT[_NumberLike_co, _ArrayLikeNumber_co]
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
numpy/_core/defchararray.pyi
CHANGED
|
@@ -1020,14 +1020,15 @@ def startswith(
|
|
|
1020
1020
|
def str_len(A: UST_co) -> NDArray[int_]: ...
|
|
1021
1021
|
|
|
1022
1022
|
# Overload 1 and 2: str- or bytes-based array-likes
|
|
1023
|
-
# overload 3: arbitrary object with unicode=False (-> bytes_)
|
|
1024
|
-
# overload
|
|
1023
|
+
# overload 3 and 4: arbitrary object with unicode=False (-> bytes_)
|
|
1024
|
+
# overload 5 and 6: arbitrary object with unicode=True (-> str_)
|
|
1025
|
+
# overload 7: arbitrary object with unicode=None (default) (-> str_ | bytes_)
|
|
1025
1026
|
@overload
|
|
1026
1027
|
def array(
|
|
1027
1028
|
obj: U_co,
|
|
1028
1029
|
itemsize: int | None = ...,
|
|
1029
1030
|
copy: bool = ...,
|
|
1030
|
-
unicode: L[
|
|
1031
|
+
unicode: L[True] | None = ...,
|
|
1031
1032
|
order: _OrderKACF = ...,
|
|
1032
1033
|
) -> _CharArray[str_]: ...
|
|
1033
1034
|
@overload
|
|
@@ -1035,7 +1036,15 @@ def array(
|
|
|
1035
1036
|
obj: S_co,
|
|
1036
1037
|
itemsize: int | None = ...,
|
|
1037
1038
|
copy: bool = ...,
|
|
1038
|
-
unicode: L[False] = ...,
|
|
1039
|
+
unicode: L[False] | None = ...,
|
|
1040
|
+
order: _OrderKACF = ...,
|
|
1041
|
+
) -> _CharArray[bytes_]: ...
|
|
1042
|
+
@overload
|
|
1043
|
+
def array(
|
|
1044
|
+
obj: object,
|
|
1045
|
+
itemsize: int | None,
|
|
1046
|
+
copy: bool,
|
|
1047
|
+
unicode: L[False],
|
|
1039
1048
|
order: _OrderKACF = ...,
|
|
1040
1049
|
) -> _CharArray[bytes_]: ...
|
|
1041
1050
|
@overload
|
|
@@ -1043,43 +1052,84 @@ def array(
|
|
|
1043
1052
|
obj: object,
|
|
1044
1053
|
itemsize: int | None = ...,
|
|
1045
1054
|
copy: bool = ...,
|
|
1046
|
-
|
|
1055
|
+
*,
|
|
1056
|
+
unicode: L[False],
|
|
1047
1057
|
order: _OrderKACF = ...,
|
|
1048
1058
|
) -> _CharArray[bytes_]: ...
|
|
1049
1059
|
@overload
|
|
1060
|
+
def array(
|
|
1061
|
+
obj: object,
|
|
1062
|
+
itemsize: int | None,
|
|
1063
|
+
copy: bool,
|
|
1064
|
+
unicode: L[True],
|
|
1065
|
+
order: _OrderKACF = ...,
|
|
1066
|
+
) -> _CharArray[str_]: ...
|
|
1067
|
+
@overload
|
|
1050
1068
|
def array(
|
|
1051
1069
|
obj: object,
|
|
1052
1070
|
itemsize: int | None = ...,
|
|
1053
1071
|
copy: bool = ...,
|
|
1054
|
-
|
|
1072
|
+
*,
|
|
1073
|
+
unicode: L[True],
|
|
1055
1074
|
order: _OrderKACF = ...,
|
|
1056
1075
|
) -> _CharArray[str_]: ...
|
|
1076
|
+
@overload
|
|
1077
|
+
def array(
|
|
1078
|
+
obj: object,
|
|
1079
|
+
itemsize: int | None = ...,
|
|
1080
|
+
copy: bool = ...,
|
|
1081
|
+
unicode: bool | None = ...,
|
|
1082
|
+
order: _OrderKACF = ...,
|
|
1083
|
+
) -> _CharArray[str_] | _CharArray[bytes_]: ...
|
|
1057
1084
|
|
|
1058
1085
|
@overload
|
|
1059
1086
|
def asarray(
|
|
1060
1087
|
obj: U_co,
|
|
1061
1088
|
itemsize: int | None = ...,
|
|
1062
|
-
unicode: L[
|
|
1089
|
+
unicode: L[True] | None = ...,
|
|
1063
1090
|
order: _OrderKACF = ...,
|
|
1064
1091
|
) -> _CharArray[str_]: ...
|
|
1065
1092
|
@overload
|
|
1066
1093
|
def asarray(
|
|
1067
1094
|
obj: S_co,
|
|
1068
1095
|
itemsize: int | None = ...,
|
|
1069
|
-
unicode: L[False] = ...,
|
|
1096
|
+
unicode: L[False] | None = ...,
|
|
1097
|
+
order: _OrderKACF = ...,
|
|
1098
|
+
) -> _CharArray[bytes_]: ...
|
|
1099
|
+
@overload
|
|
1100
|
+
def asarray(
|
|
1101
|
+
obj: object,
|
|
1102
|
+
itemsize: int | None,
|
|
1103
|
+
unicode: L[False],
|
|
1070
1104
|
order: _OrderKACF = ...,
|
|
1071
1105
|
) -> _CharArray[bytes_]: ...
|
|
1072
1106
|
@overload
|
|
1073
1107
|
def asarray(
|
|
1074
1108
|
obj: object,
|
|
1075
1109
|
itemsize: int | None = ...,
|
|
1076
|
-
|
|
1110
|
+
*,
|
|
1111
|
+
unicode: L[False],
|
|
1077
1112
|
order: _OrderKACF = ...,
|
|
1078
1113
|
) -> _CharArray[bytes_]: ...
|
|
1079
1114
|
@overload
|
|
1115
|
+
def asarray(
|
|
1116
|
+
obj: object,
|
|
1117
|
+
itemsize: int | None,
|
|
1118
|
+
unicode: L[True],
|
|
1119
|
+
order: _OrderKACF = ...,
|
|
1120
|
+
) -> _CharArray[str_]: ...
|
|
1121
|
+
@overload
|
|
1080
1122
|
def asarray(
|
|
1081
1123
|
obj: object,
|
|
1082
1124
|
itemsize: int | None = ...,
|
|
1083
|
-
|
|
1125
|
+
*,
|
|
1126
|
+
unicode: L[True],
|
|
1084
1127
|
order: _OrderKACF = ...,
|
|
1085
1128
|
) -> _CharArray[str_]: ...
|
|
1129
|
+
@overload
|
|
1130
|
+
def asarray(
|
|
1131
|
+
obj: object,
|
|
1132
|
+
itemsize: int | None = ...,
|
|
1133
|
+
unicode: bool | None = ...,
|
|
1134
|
+
order: _OrderKACF = ...,
|
|
1135
|
+
) -> _CharArray[str_] | _CharArray[bytes_]: ...
|
numpy/_core/lib/npymath.lib
CHANGED
|
Binary file
|
|
@@ -844,6 +844,21 @@ class TestDateTime:
|
|
|
844
844
|
a = np.array([-1, 'NaT', 1234567], dtype='<m')
|
|
845
845
|
assert_equal(str(a), "[ -1 'NaT' 1234567]")
|
|
846
846
|
|
|
847
|
+
def test_timedelta_array_with_nats(self):
|
|
848
|
+
# Regression test for gh-29497.
|
|
849
|
+
x = np.array([np.timedelta64('nat'),
|
|
850
|
+
np.timedelta64('nat', 's'),
|
|
851
|
+
np.timedelta64('nat', 'ms'),
|
|
852
|
+
np.timedelta64(123, 'ms')])
|
|
853
|
+
for td in x[:3]:
|
|
854
|
+
assert np.isnat(td)
|
|
855
|
+
|
|
856
|
+
def test_timedelta_array_nat_assignment(self):
|
|
857
|
+
# Regression test for gh-29497.
|
|
858
|
+
x = np.zeros(3, dtype='m8[ms]')
|
|
859
|
+
x[1] = np.timedelta64('nat', 's')
|
|
860
|
+
assert np.isnat(x[1])
|
|
861
|
+
|
|
847
862
|
def test_pickle(self):
|
|
848
863
|
# Check that pickle roundtripping works
|
|
849
864
|
for proto in range(2, pickle.HIGHEST_PROTOCOL + 1):
|
|
@@ -872,6 +887,15 @@ class TestDateTime:
|
|
|
872
887
|
b"I1\nI1\nI1\ntp7\ntp8\ntp9\nb."
|
|
873
888
|
assert_equal(pickle.loads(pkl), np.dtype('>M8[us]'))
|
|
874
889
|
|
|
890
|
+
def test_gh_29555(self):
|
|
891
|
+
# check that dtype metadata round-trips when none
|
|
892
|
+
dt = np.dtype('>M8[us]')
|
|
893
|
+
assert dt.metadata is None
|
|
894
|
+
for proto in range(2, pickle.HIGHEST_PROTOCOL + 1):
|
|
895
|
+
res = pickle.loads(pickle.dumps(dt, protocol=proto))
|
|
896
|
+
assert_equal(res, dt)
|
|
897
|
+
assert res.metadata is None
|
|
898
|
+
|
|
875
899
|
def test_setstate(self):
|
|
876
900
|
"Verify that datetime dtype __setstate__ can handle bad arguments"
|
|
877
901
|
dt = np.dtype('>M8[us]')
|
|
@@ -4211,6 +4211,13 @@ class TestBinop:
|
|
|
4211
4211
|
assert_equal(obj_arr ** -1, pow_for(-1, obj_arr))
|
|
4212
4212
|
assert_equal(obj_arr ** 2, pow_for(2, obj_arr))
|
|
4213
4213
|
|
|
4214
|
+
def test_pow_calls_square_structured_dtype(self):
|
|
4215
|
+
# gh-29388
|
|
4216
|
+
dt = np.dtype([('a', 'i4'), ('b', 'i4')])
|
|
4217
|
+
a = np.array([(1, 2), (3, 4)], dtype=dt)
|
|
4218
|
+
with pytest.raises(TypeError, match="ufunc 'square' not supported"):
|
|
4219
|
+
a ** 2
|
|
4220
|
+
|
|
4214
4221
|
def test_pos_array_ufunc_override(self):
|
|
4215
4222
|
class A(np.ndarray):
|
|
4216
4223
|
def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
|
|
@@ -8849,6 +8856,14 @@ def test_interface_no_shape():
|
|
|
8849
8856
|
assert_equal(np.array(ArrayLike()), 1)
|
|
8850
8857
|
|
|
8851
8858
|
|
|
8859
|
+
def test_interface_no_shape_error():
|
|
8860
|
+
class ArrayLike:
|
|
8861
|
+
__array_interface__ = {"data": None, "typestr": "f8"}
|
|
8862
|
+
|
|
8863
|
+
with pytest.raises(ValueError, match="Missing __array_interface__ shape"):
|
|
8864
|
+
np.array(ArrayLike())
|
|
8865
|
+
|
|
8866
|
+
|
|
8852
8867
|
def test_array_interface_itemsize():
|
|
8853
8868
|
# See gh-6361
|
|
8854
8869
|
my_dtype = np.dtype({'names': ['A', 'B'], 'formats': ['f4', 'f4'],
|
|
@@ -518,6 +518,25 @@ def test_fancy_indexing(string_list):
|
|
|
518
518
|
assert_array_equal(a, b)
|
|
519
519
|
assert a[0] == 'd' * 25
|
|
520
520
|
|
|
521
|
+
# see gh-29279
|
|
522
|
+
data = [
|
|
523
|
+
["AAAAAAAAAAAAAAAAA"],
|
|
524
|
+
["BBBBBBBBBBBBBBBBBBBBBBBBBBBBB"],
|
|
525
|
+
["CCCCCCCCCCCCCCCCC"],
|
|
526
|
+
["DDDDDDDDDDDDDDDDD"],
|
|
527
|
+
]
|
|
528
|
+
sarr = np.array(data, dtype=np.dtypes.StringDType())
|
|
529
|
+
uarr = np.array(data, dtype="U30")
|
|
530
|
+
for ind in [[0], [1], [2], [3], [[0, 0]], [[1, 1, 3]], [[1, 1]]]:
|
|
531
|
+
assert_array_equal(sarr[ind], uarr[ind])
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
def test_flatiter_indexing():
|
|
535
|
+
# see gh-29659
|
|
536
|
+
arr = np.array(['hello', 'world'], dtype='T')
|
|
537
|
+
arr.flat[:] = 9223372036854775
|
|
538
|
+
assert_array_equal(arr, np.array([9223372036854775] * 2, dtype='T'))
|
|
539
|
+
|
|
521
540
|
|
|
522
541
|
def test_creation_functions():
|
|
523
542
|
assert_array_equal(np.zeros(3, dtype="T"), ["", "", ""])
|
|
@@ -1193,6 +1212,24 @@ def test_growing_strings(dtype):
|
|
|
1193
1212
|
assert_array_equal(arr, uarr)
|
|
1194
1213
|
|
|
1195
1214
|
|
|
1215
|
+
def test_assign_medium_strings():
|
|
1216
|
+
# see gh-29261
|
|
1217
|
+
N = 9
|
|
1218
|
+
src = np.array(
|
|
1219
|
+
(
|
|
1220
|
+
['0' * 256] * 3 + ['0' * 255] + ['0' * 256] + ['0' * 255] +
|
|
1221
|
+
['0' * 256] * 2 + ['0' * 255]
|
|
1222
|
+
), dtype='T')
|
|
1223
|
+
dst = np.array(
|
|
1224
|
+
(
|
|
1225
|
+
['0' * 255] + ['0' * 256] * 2 + ['0' * 255] + ['0' * 256] +
|
|
1226
|
+
['0' * 255] + [''] * 5
|
|
1227
|
+
), dtype='T')
|
|
1228
|
+
|
|
1229
|
+
dst[1:N + 1] = src
|
|
1230
|
+
assert_array_equal(dst[1:N + 1], src)
|
|
1231
|
+
|
|
1232
|
+
|
|
1196
1233
|
UFUNC_TEST_DATA = [
|
|
1197
1234
|
"hello" * 10,
|
|
1198
1235
|
"Ae¢☃€ 😊" * 20,
|