numpy 2.3.3__cp312-cp312-win_amd64.whl → 2.3.4__cp312-cp312-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 +8 -8
- numpy/__init__.pyi +819 -218
- numpy/_core/_multiarray_tests.cp312-win_amd64.lib +0 -0
- numpy/_core/_multiarray_tests.cp312-win_amd64.pyd +0 -0
- numpy/_core/_multiarray_umath.cp312-win_amd64.lib +0 -0
- numpy/_core/_multiarray_umath.cp312-win_amd64.pyd +0 -0
- numpy/_core/_operand_flag_tests.cp312-win_amd64.lib +0 -0
- numpy/_core/_operand_flag_tests.cp312-win_amd64.pyd +0 -0
- numpy/_core/_rational_tests.cp312-win_amd64.lib +0 -0
- numpy/_core/_rational_tests.cp312-win_amd64.pyd +0 -0
- numpy/_core/_simd.cp312-win_amd64.lib +0 -0
- numpy/_core/_simd.cp312-win_amd64.pyd +0 -0
- numpy/_core/_struct_ufunc_tests.cp312-win_amd64.lib +0 -0
- numpy/_core/_struct_ufunc_tests.cp312-win_amd64.pyd +0 -0
- numpy/_core/_ufunc_config.py +2 -0
- numpy/_core/_ufunc_config.pyi +52 -6
- numpy/_core/_umath_tests.cp312-win_amd64.lib +0 -0
- numpy/_core/_umath_tests.cp312-win_amd64.pyd +0 -0
- numpy/_core/lib/npymath.lib +0 -0
- numpy/_core/lib/pkgconfig/numpy.pc +1 -1
- numpy/_core/numerictypes.py +1 -1
- numpy/_core/tests/test_api.py +34 -1
- numpy/_core/tests/test_numerictypes.py +29 -0
- numpy/_core/tests/test_stringdtype.py +16 -16
- numpy/_core/tests/test_strings.py +15 -0
- numpy/_core/tests/test_umath.py +12 -0
- numpy/exceptions.pyi +2 -0
- numpy/fft/_pocketfft_umath.cp312-win_amd64.lib +0 -0
- numpy/fft/_pocketfft_umath.cp312-win_amd64.pyd +0 -0
- numpy/lib/_histograms_impl.pyi +8 -8
- numpy/lib/_index_tricks_impl.pyi +12 -0
- numpy/lib/_polynomial_impl.pyi +10 -8
- numpy/lib/mixins.pyi +2 -0
- numpy/lib/tests/test_index_tricks.py +5 -0
- numpy/linalg/_linalg.pyi +32 -39
- numpy/linalg/_umath_linalg.cp312-win_amd64.lib +0 -0
- numpy/linalg/_umath_linalg.cp312-win_amd64.pyd +0 -0
- numpy/linalg/lapack_lite.cp312-win_amd64.lib +0 -0
- numpy/linalg/lapack_lite.cp312-win_amd64.pyd +0 -0
- numpy/ma/extras.pyi +4 -0
- numpy/random/_bounded_integers.cp312-win_amd64.lib +0 -0
- numpy/random/_bounded_integers.cp312-win_amd64.pyd +0 -0
- numpy/random/_common.cp312-win_amd64.lib +0 -0
- numpy/random/_common.cp312-win_amd64.pyd +0 -0
- numpy/random/_generator.cp312-win_amd64.lib +0 -0
- numpy/random/_generator.cp312-win_amd64.pyd +0 -0
- numpy/random/_mt19937.cp312-win_amd64.lib +0 -0
- numpy/random/_mt19937.cp312-win_amd64.pyd +0 -0
- numpy/random/_pcg64.cp312-win_amd64.lib +0 -0
- numpy/random/_pcg64.cp312-win_amd64.pyd +0 -0
- numpy/random/_philox.cp312-win_amd64.lib +0 -0
- numpy/random/_philox.cp312-win_amd64.pyd +0 -0
- numpy/random/_sfc64.cp312-win_amd64.lib +0 -0
- numpy/random/_sfc64.cp312-win_amd64.pyd +0 -0
- numpy/random/bit_generator.cp312-win_amd64.lib +0 -0
- numpy/random/bit_generator.cp312-win_amd64.pyd +0 -0
- numpy/random/lib/npyrandom.lib +0 -0
- numpy/random/mtrand.cp312-win_amd64.lib +0 -0
- numpy/random/mtrand.cp312-win_amd64.pyd +0 -0
- numpy/random/tests/test_generator_mt19937.py +5 -0
- numpy/testing/_private/extbuild.pyi +3 -3
- numpy/testing/_private/utils.pyi +1 -1
- numpy/typing/tests/data/fail/bitwise_ops.pyi +3 -3
- numpy/typing/tests/data/fail/scalars.pyi +6 -6
- numpy/typing/tests/data/reveal/arithmetic.pyi +29 -29
- numpy/typing/tests/data/reveal/array_constructors.pyi +5 -5
- numpy/typing/tests/data/reveal/bitwise_ops.pyi +10 -11
- numpy/typing/tests/data/reveal/linalg.pyi +6 -6
- numpy/typing/tests/data/reveal/mod.pyi +18 -19
- numpy/version.py +2 -2
- numpy-2.3.4.dist-info/DELVEWHEEL +2 -0
- {numpy-2.3.3.dist-info → numpy-2.3.4.dist-info}/METADATA +1 -1
- {numpy-2.3.3.dist-info → numpy-2.3.4.dist-info}/RECORD +76 -77
- numpy/_typing/_callable.pyi +0 -279
- numpy-2.3.3.dist-info/DELVEWHEEL +0 -2
- {numpy-2.3.3.dist-info → numpy-2.3.4.dist-info}/LICENSE.txt +0 -0
- {numpy-2.3.3.dist-info → numpy-2.3.4.dist-info}/WHEEL +0 -0
- {numpy-2.3.3.dist-info → numpy-2.3.4.dist-info}/entry_points.txt +0 -0
|
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/_ufunc_config.py
CHANGED
numpy/_core/_ufunc_config.pyi
CHANGED
|
@@ -1,13 +1,31 @@
|
|
|
1
1
|
from collections.abc import Callable
|
|
2
|
-
from
|
|
2
|
+
from types import TracebackType
|
|
3
|
+
from typing import (
|
|
4
|
+
Any,
|
|
5
|
+
Final,
|
|
6
|
+
Literal,
|
|
7
|
+
TypeAlias,
|
|
8
|
+
TypedDict,
|
|
9
|
+
TypeVar,
|
|
10
|
+
type_check_only,
|
|
11
|
+
)
|
|
3
12
|
|
|
4
13
|
from _typeshed import SupportsWrite
|
|
5
14
|
|
|
6
|
-
|
|
15
|
+
__all__ = [
|
|
16
|
+
"seterr",
|
|
17
|
+
"geterr",
|
|
18
|
+
"setbufsize",
|
|
19
|
+
"getbufsize",
|
|
20
|
+
"seterrcall",
|
|
21
|
+
"geterrcall",
|
|
22
|
+
"errstate",
|
|
23
|
+
]
|
|
7
24
|
|
|
8
25
|
_ErrKind: TypeAlias = Literal["ignore", "warn", "raise", "call", "print", "log"]
|
|
9
|
-
|
|
10
|
-
|
|
26
|
+
_ErrCall: TypeAlias = Callable[[str, int], Any] | SupportsWrite[str]
|
|
27
|
+
|
|
28
|
+
_CallableT = TypeVar("_CallableT", bound=Callable[..., object])
|
|
11
29
|
|
|
12
30
|
@type_check_only
|
|
13
31
|
class _ErrDict(TypedDict):
|
|
@@ -16,6 +34,36 @@ class _ErrDict(TypedDict):
|
|
|
16
34
|
under: _ErrKind
|
|
17
35
|
invalid: _ErrKind
|
|
18
36
|
|
|
37
|
+
###
|
|
38
|
+
|
|
39
|
+
class _unspecified: ...
|
|
40
|
+
|
|
41
|
+
_Unspecified: Final[_unspecified]
|
|
42
|
+
|
|
43
|
+
class errstate:
|
|
44
|
+
__slots__ = "_all", "_call", "_divide", "_invalid", "_over", "_token", "_under"
|
|
45
|
+
|
|
46
|
+
def __init__(
|
|
47
|
+
self,
|
|
48
|
+
/,
|
|
49
|
+
*,
|
|
50
|
+
call: _ErrCall | _unspecified = ..., # = _Unspecified
|
|
51
|
+
all: _ErrKind | None = None,
|
|
52
|
+
divide: _ErrKind | None = None,
|
|
53
|
+
over: _ErrKind | None = None,
|
|
54
|
+
under: _ErrKind | None = None,
|
|
55
|
+
invalid: _ErrKind | None = None,
|
|
56
|
+
) -> None: ...
|
|
57
|
+
def __call__(self, /, func: _CallableT) -> _CallableT: ...
|
|
58
|
+
def __enter__(self) -> None: ...
|
|
59
|
+
def __exit__(
|
|
60
|
+
self,
|
|
61
|
+
exc_type: type[BaseException] | None,
|
|
62
|
+
exc_value: BaseException | None,
|
|
63
|
+
traceback: TracebackType | None,
|
|
64
|
+
/,
|
|
65
|
+
) -> None: ...
|
|
66
|
+
|
|
19
67
|
def seterr(
|
|
20
68
|
all: _ErrKind | None = ...,
|
|
21
69
|
divide: _ErrKind | None = ...,
|
|
@@ -28,5 +76,3 @@ def setbufsize(size: int) -> int: ...
|
|
|
28
76
|
def getbufsize() -> int: ...
|
|
29
77
|
def seterrcall(func: _ErrCall | None) -> _ErrCall | None: ...
|
|
30
78
|
def geterrcall() -> _ErrCall | None: ...
|
|
31
|
-
|
|
32
|
-
# See `numpy/__init__.pyi` for the `errstate` class and `no_nep5_warnings`
|
|
Binary file
|
|
Binary file
|
numpy/_core/lib/npymath.lib
CHANGED
|
Binary file
|
numpy/_core/numerictypes.py
CHANGED
|
@@ -598,7 +598,7 @@ def _scalar_type_key(typ):
|
|
|
598
598
|
|
|
599
599
|
|
|
600
600
|
ScalarType = [int, float, complex, bool, bytes, str, memoryview]
|
|
601
|
-
ScalarType += sorted(
|
|
601
|
+
ScalarType += sorted(dict.fromkeys(sctypeDict.values()), key=_scalar_type_key)
|
|
602
602
|
ScalarType = tuple(ScalarType)
|
|
603
603
|
|
|
604
604
|
|
numpy/_core/tests/test_api.py
CHANGED
|
@@ -91,7 +91,7 @@ def test_array_array():
|
|
|
91
91
|
# instead we get a array([...], dtype=">V18")
|
|
92
92
|
assert_equal(bytes(np.array(o).data), bytes(a.data))
|
|
93
93
|
|
|
94
|
-
# test
|
|
94
|
+
# test __array__
|
|
95
95
|
def custom__array__(self, dtype=None, copy=None):
|
|
96
96
|
return np.array(100.0, dtype=dtype, copy=copy)
|
|
97
97
|
|
|
@@ -157,6 +157,39 @@ def test_array_array():
|
|
|
157
157
|
assert_equal(np.array([(1.0,) * 10] * 10, dtype=np.float64),
|
|
158
158
|
np.ones((10, 10), dtype=np.float64))
|
|
159
159
|
|
|
160
|
+
|
|
161
|
+
@pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts")
|
|
162
|
+
def test___array___refcount():
|
|
163
|
+
class MyArray:
|
|
164
|
+
def __init__(self, dtype):
|
|
165
|
+
self.val = np.array(-1, dtype=dtype)
|
|
166
|
+
|
|
167
|
+
def __array__(self, dtype=None, copy=None):
|
|
168
|
+
return self.val.__array__(dtype=dtype, copy=copy)
|
|
169
|
+
|
|
170
|
+
# test all possible scenarios:
|
|
171
|
+
# dtype(none | same | different) x copy(true | false | none)
|
|
172
|
+
dt = np.dtype(np.int32)
|
|
173
|
+
old_refcount = sys.getrefcount(dt)
|
|
174
|
+
np.array(MyArray(dt))
|
|
175
|
+
assert_equal(old_refcount, sys.getrefcount(dt))
|
|
176
|
+
np.array(MyArray(dt), dtype=dt)
|
|
177
|
+
assert_equal(old_refcount, sys.getrefcount(dt))
|
|
178
|
+
np.array(MyArray(dt), copy=None)
|
|
179
|
+
assert_equal(old_refcount, sys.getrefcount(dt))
|
|
180
|
+
np.array(MyArray(dt), dtype=dt, copy=None)
|
|
181
|
+
assert_equal(old_refcount, sys.getrefcount(dt))
|
|
182
|
+
dt2 = np.dtype(np.int16)
|
|
183
|
+
old_refcount2 = sys.getrefcount(dt2)
|
|
184
|
+
np.array(MyArray(dt), dtype=dt2)
|
|
185
|
+
assert_equal(old_refcount2, sys.getrefcount(dt2))
|
|
186
|
+
np.array(MyArray(dt), dtype=dt2, copy=None)
|
|
187
|
+
assert_equal(old_refcount2, sys.getrefcount(dt2))
|
|
188
|
+
with pytest.raises(ValueError):
|
|
189
|
+
np.array(MyArray(dt), dtype=dt2, copy=False)
|
|
190
|
+
assert_equal(old_refcount2, sys.getrefcount(dt2))
|
|
191
|
+
|
|
192
|
+
|
|
160
193
|
@pytest.mark.parametrize("array", [True, False])
|
|
161
194
|
def test_array_impossible_casts(array):
|
|
162
195
|
# All builtin types can be forcibly cast, at least theoretically,
|
|
@@ -617,6 +617,35 @@ class TestScalarTypeNames:
|
|
|
617
617
|
assert np.dtype(t.__name__).type is t
|
|
618
618
|
|
|
619
619
|
|
|
620
|
+
class TestScalarTypeOrder:
|
|
621
|
+
@pytest.mark.parametrize(('a', 'b'), [
|
|
622
|
+
# signedinteger
|
|
623
|
+
(np.byte, np.short),
|
|
624
|
+
(np.short, np.intc),
|
|
625
|
+
(np.intc, np.long),
|
|
626
|
+
(np.long, np.longlong),
|
|
627
|
+
# unsignedinteger
|
|
628
|
+
(np.ubyte, np.ushort),
|
|
629
|
+
(np.ushort, np.uintc),
|
|
630
|
+
(np.uintc, np.ulong),
|
|
631
|
+
(np.ulong, np.ulonglong),
|
|
632
|
+
# floating
|
|
633
|
+
(np.half, np.single),
|
|
634
|
+
(np.single, np.double),
|
|
635
|
+
(np.double, np.longdouble),
|
|
636
|
+
# complexfloating
|
|
637
|
+
(np.csingle, np.cdouble),
|
|
638
|
+
(np.cdouble, np.clongdouble),
|
|
639
|
+
# flexible
|
|
640
|
+
(np.bytes_, np.str_),
|
|
641
|
+
(np.str_, np.void),
|
|
642
|
+
# bouncy castles
|
|
643
|
+
(np.datetime64, np.timedelta64),
|
|
644
|
+
])
|
|
645
|
+
def test_stable_ordering(self, a: type[np.generic], b: type[np.generic]):
|
|
646
|
+
assert np.ScalarType.index(a) <= np.ScalarType.index(b)
|
|
647
|
+
|
|
648
|
+
|
|
620
649
|
class TestBoolDefinition:
|
|
621
650
|
def test_bool_definition(self):
|
|
622
651
|
assert nt.bool is np.bool
|
|
@@ -1631,17 +1631,17 @@ class TestImplementation:
|
|
|
1631
1631
|
"""
|
|
1632
1632
|
|
|
1633
1633
|
@classmethod
|
|
1634
|
-
def setup_class(
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
sp =
|
|
1634
|
+
def setup_class(cls):
|
|
1635
|
+
cls.MISSING = 0x80
|
|
1636
|
+
cls.INITIALIZED = 0x40
|
|
1637
|
+
cls.OUTSIDE_ARENA = 0x20
|
|
1638
|
+
cls.LONG = 0x10
|
|
1639
|
+
cls.dtype = StringDType(na_object=np.nan)
|
|
1640
|
+
cls.sizeofstr = cls.dtype.itemsize
|
|
1641
|
+
sp = cls.dtype.itemsize // 2 # pointer size = sizeof(size_t)
|
|
1642
1642
|
# Below, size is not strictly correct, since it really uses
|
|
1643
1643
|
# 7 (or 3) bytes, but good enough for the tests here.
|
|
1644
|
-
|
|
1644
|
+
cls.view_dtype = np.dtype([
|
|
1645
1645
|
('offset', f'u{sp}'),
|
|
1646
1646
|
('size', f'u{sp // 2}'),
|
|
1647
1647
|
('xsiz', f'V{sp // 2 - 1}'),
|
|
@@ -1652,13 +1652,13 @@ class TestImplementation:
|
|
|
1652
1652
|
('size', f'u{sp // 2}'),
|
|
1653
1653
|
('offset', f'u{sp}'),
|
|
1654
1654
|
])
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
[
|
|
1661
|
-
|
|
1655
|
+
cls.s_empty = ""
|
|
1656
|
+
cls.s_short = "01234"
|
|
1657
|
+
cls.s_medium = "abcdefghijklmnopqrstuvwxyz"
|
|
1658
|
+
cls.s_long = "-=+" * 100
|
|
1659
|
+
cls.a = np.array(
|
|
1660
|
+
[cls.s_empty, cls.s_short, cls.s_medium, cls.s_long],
|
|
1661
|
+
cls.dtype)
|
|
1662
1662
|
|
|
1663
1663
|
def get_view(self, a):
|
|
1664
1664
|
# Cannot view a StringDType as anything else directly, since
|
|
@@ -4,6 +4,7 @@ import sys
|
|
|
4
4
|
import pytest
|
|
5
5
|
|
|
6
6
|
import numpy as np
|
|
7
|
+
from numpy._core._exceptions import _UFuncNoLoopError
|
|
7
8
|
from numpy.testing import IS_PYPY, assert_array_equal, assert_raises
|
|
8
9
|
from numpy.testing._private.utils import requires_memory
|
|
9
10
|
|
|
@@ -821,6 +822,20 @@ class TestMethods:
|
|
|
821
822
|
np.strings.expandtabs(np.array("\ta\n\tb", dtype=dt), sys.maxsize)
|
|
822
823
|
np.strings.expandtabs(np.array("\ta\n\tb", dtype=dt), 2**61)
|
|
823
824
|
|
|
825
|
+
def test_expandtabs_length_not_cause_segfault(self, dt):
|
|
826
|
+
# see gh-28829
|
|
827
|
+
with pytest.raises(
|
|
828
|
+
_UFuncNoLoopError,
|
|
829
|
+
match="did not contain a loop with signature matching types",
|
|
830
|
+
):
|
|
831
|
+
np._core.strings._expandtabs_length.reduce(np.zeros(200))
|
|
832
|
+
|
|
833
|
+
with pytest.raises(
|
|
834
|
+
_UFuncNoLoopError,
|
|
835
|
+
match="did not contain a loop with signature matching types",
|
|
836
|
+
):
|
|
837
|
+
np.strings.expandtabs(np.zeros(200))
|
|
838
|
+
|
|
824
839
|
FILL_ERROR = "The fill character must be exactly one character long"
|
|
825
840
|
|
|
826
841
|
def test_center_raises_multiple_character_fill(self, dt):
|
numpy/_core/tests/test_umath.py
CHANGED
|
@@ -4704,6 +4704,18 @@ def test_reduceat():
|
|
|
4704
4704
|
np.setbufsize(ncu.UFUNC_BUFSIZE_DEFAULT)
|
|
4705
4705
|
assert_array_almost_equal(h1, h2)
|
|
4706
4706
|
|
|
4707
|
+
def test_negative_value_raises():
|
|
4708
|
+
with pytest.raises(ValueError, match="buffer size must be non-negative"):
|
|
4709
|
+
np.setbufsize(-5)
|
|
4710
|
+
|
|
4711
|
+
old = np.getbufsize()
|
|
4712
|
+
try:
|
|
4713
|
+
prev = np.setbufsize(4096)
|
|
4714
|
+
assert prev == old
|
|
4715
|
+
assert np.getbufsize() == 4096
|
|
4716
|
+
finally:
|
|
4717
|
+
np.setbufsize(old)
|
|
4718
|
+
|
|
4707
4719
|
def test_reduceat_empty():
|
|
4708
4720
|
"""Reduceat should work with empty arrays"""
|
|
4709
4721
|
indices = np.array([], 'i4')
|
numpy/exceptions.pyi
CHANGED
|
Binary file
|
|
Binary file
|
numpy/lib/_histograms_impl.pyi
CHANGED
|
@@ -35,16 +35,16 @@ def histogram_bin_edges(
|
|
|
35
35
|
|
|
36
36
|
def histogram(
|
|
37
37
|
a: ArrayLike,
|
|
38
|
-
bins: _BinKind | SupportsIndex | ArrayLike =
|
|
39
|
-
range: tuple[float, float] | None =
|
|
40
|
-
density: bool =
|
|
41
|
-
weights: ArrayLike | None =
|
|
38
|
+
bins: _BinKind | SupportsIndex | ArrayLike = 10,
|
|
39
|
+
range: tuple[float, float] | None = None,
|
|
40
|
+
density: bool | None = None,
|
|
41
|
+
weights: ArrayLike | None = None,
|
|
42
42
|
) -> tuple[NDArray[Any], NDArray[Any]]: ...
|
|
43
43
|
|
|
44
44
|
def histogramdd(
|
|
45
45
|
sample: ArrayLike,
|
|
46
|
-
bins: SupportsIndex | ArrayLike =
|
|
47
|
-
range: Sequence[tuple[float, float]] =
|
|
48
|
-
density: bool | None =
|
|
49
|
-
weights: ArrayLike | None =
|
|
46
|
+
bins: SupportsIndex | ArrayLike = 10,
|
|
47
|
+
range: Sequence[tuple[float, float]] | None = None,
|
|
48
|
+
density: bool | None = None,
|
|
49
|
+
weights: ArrayLike | None = None,
|
|
50
50
|
) -> tuple[NDArray[Any], tuple[NDArray[Any], ...]]: ...
|
numpy/lib/_index_tricks_impl.pyi
CHANGED
|
@@ -98,6 +98,8 @@ class ndindex:
|
|
|
98
98
|
def ndincr(self, /) -> None: ...
|
|
99
99
|
|
|
100
100
|
class nd_grid(Generic[_BoolT_co]):
|
|
101
|
+
__slots__ = ("sparse",)
|
|
102
|
+
|
|
101
103
|
sparse: _BoolT_co
|
|
102
104
|
def __init__(self, sparse: _BoolT_co = ...) -> None: ...
|
|
103
105
|
@overload
|
|
@@ -107,10 +109,14 @@ class nd_grid(Generic[_BoolT_co]):
|
|
|
107
109
|
|
|
108
110
|
@final
|
|
109
111
|
class MGridClass(nd_grid[L[False]]):
|
|
112
|
+
__slots__ = ()
|
|
113
|
+
|
|
110
114
|
def __init__(self) -> None: ...
|
|
111
115
|
|
|
112
116
|
@final
|
|
113
117
|
class OGridClass(nd_grid[L[True]]):
|
|
118
|
+
__slots__ = ()
|
|
119
|
+
|
|
114
120
|
def __init__(self) -> None: ...
|
|
115
121
|
|
|
116
122
|
class AxisConcatenator(Generic[_AxisT_co, _MatrixT_co, _NDMinT_co, _Trans1DT_co]):
|
|
@@ -147,13 +153,19 @@ class AxisConcatenator(Generic[_AxisT_co, _MatrixT_co, _NDMinT_co, _Trans1DT_co]
|
|
|
147
153
|
|
|
148
154
|
@final
|
|
149
155
|
class RClass(AxisConcatenator[L[0], L[False], L[1], L[-1]]):
|
|
156
|
+
__slots__ = ()
|
|
157
|
+
|
|
150
158
|
def __init__(self, /) -> None: ...
|
|
151
159
|
|
|
152
160
|
@final
|
|
153
161
|
class CClass(AxisConcatenator[L[-1], L[False], L[2], L[0]]):
|
|
162
|
+
__slots__ = ()
|
|
163
|
+
|
|
154
164
|
def __init__(self, /) -> None: ...
|
|
155
165
|
|
|
156
166
|
class IndexExpression(Generic[_BoolT_co]):
|
|
167
|
+
__slots__ = ("maketuple",)
|
|
168
|
+
|
|
157
169
|
maketuple: _BoolT_co
|
|
158
170
|
def __init__(self, maketuple: _BoolT_co) -> None: ...
|
|
159
171
|
@overload
|
numpy/lib/_polynomial_impl.pyi
CHANGED
|
@@ -137,20 +137,22 @@ def polyfit(
|
|
|
137
137
|
x: _ArrayLikeFloat_co,
|
|
138
138
|
y: _ArrayLikeFloat_co,
|
|
139
139
|
deg: SupportsIndex | SupportsInt,
|
|
140
|
-
rcond: float | None =
|
|
141
|
-
full: L[False] =
|
|
142
|
-
w: _ArrayLikeFloat_co | None =
|
|
143
|
-
|
|
140
|
+
rcond: float | None = None,
|
|
141
|
+
full: L[False] = False,
|
|
142
|
+
w: _ArrayLikeFloat_co | None = None,
|
|
143
|
+
*,
|
|
144
|
+
cov: L[True, "unscaled"],
|
|
144
145
|
) -> _2Tup[NDArray[float64]]: ...
|
|
145
146
|
@overload
|
|
146
147
|
def polyfit(
|
|
147
148
|
x: _ArrayLikeComplex_co,
|
|
148
149
|
y: _ArrayLikeComplex_co,
|
|
149
150
|
deg: SupportsIndex | SupportsInt,
|
|
150
|
-
rcond: float | None =
|
|
151
|
-
full: L[False] =
|
|
152
|
-
w: _ArrayLikeFloat_co | None =
|
|
153
|
-
|
|
151
|
+
rcond: float | None = None,
|
|
152
|
+
full: L[False] = False,
|
|
153
|
+
w: _ArrayLikeFloat_co | None = None,
|
|
154
|
+
*,
|
|
155
|
+
cov: L[True, "unscaled"],
|
|
154
156
|
) -> _2Tup[NDArray[complex128]]: ...
|
|
155
157
|
@overload
|
|
156
158
|
def polyfit(
|
numpy/lib/mixins.pyi
CHANGED
|
@@ -199,6 +199,11 @@ class TestRavelUnravelIndex:
|
|
|
199
199
|
with assert_raises(ValueError):
|
|
200
200
|
np.unravel_index([1], (2, 1, 0))
|
|
201
201
|
|
|
202
|
+
def test_regression_size_1_index(self):
|
|
203
|
+
# actually tests the nditer size one index tracking
|
|
204
|
+
# regression test for gh-29690
|
|
205
|
+
np.unravel_index(np.array([[1, 0, 1, 0]], dtype=np.uint32), (4,))
|
|
206
|
+
|
|
202
207
|
class TestGrid:
|
|
203
208
|
def test_basic(self):
|
|
204
209
|
a = mgrid[-1:1:10j]
|
numpy/linalg/_linalg.pyi
CHANGED
|
@@ -28,6 +28,7 @@ from numpy import (
|
|
|
28
28
|
)
|
|
29
29
|
from numpy._core.fromnumeric import matrix_transpose
|
|
30
30
|
from numpy._core.numeric import tensordot
|
|
31
|
+
from numpy._globals import _NoValueType
|
|
31
32
|
from numpy._typing import (
|
|
32
33
|
ArrayLike,
|
|
33
34
|
DTypeLike,
|
|
@@ -78,7 +79,7 @@ __all__ = [
|
|
|
78
79
|
"vecdot",
|
|
79
80
|
]
|
|
80
81
|
|
|
81
|
-
|
|
82
|
+
_NumberT = TypeVar("_NumberT", bound=np.number)
|
|
82
83
|
|
|
83
84
|
_ModeKind: TypeAlias = L["reduced", "complete", "r", "raw"]
|
|
84
85
|
|
|
@@ -182,33 +183,29 @@ def cholesky(a: _ArrayLikeFloat_co, /, *, upper: bool = False) -> NDArray[floati
|
|
|
182
183
|
def cholesky(a: _ArrayLikeComplex_co, /, *, upper: bool = False) -> NDArray[complexfloating]: ...
|
|
183
184
|
|
|
184
185
|
@overload
|
|
185
|
-
def outer(x1: _ArrayLike[Never], x2: _ArrayLike[Never]) -> NDArray[Any]: ...
|
|
186
|
+
def outer(x1: _ArrayLike[Never], x2: _ArrayLike[Never], /) -> NDArray[Any]: ...
|
|
186
187
|
@overload
|
|
187
|
-
def outer(x1: _ArrayLikeBool_co, x2: _ArrayLikeBool_co) -> NDArray[np.bool]: ...
|
|
188
|
+
def outer(x1: _ArrayLikeBool_co, x2: _ArrayLikeBool_co, /) -> NDArray[np.bool]: ...
|
|
188
189
|
@overload
|
|
189
|
-
def outer(x1:
|
|
190
|
+
def outer(x1: _ArrayLike[_NumberT], x2: _ArrayLike[_NumberT], /) -> NDArray[_NumberT]: ...
|
|
190
191
|
@overload
|
|
191
|
-
def outer(x1:
|
|
192
|
+
def outer(x1: _ArrayLikeUInt_co, x2: _ArrayLikeUInt_co, /) -> NDArray[unsignedinteger]: ...
|
|
192
193
|
@overload
|
|
193
|
-
def outer(x1:
|
|
194
|
+
def outer(x1: _ArrayLikeInt_co, x2: _ArrayLikeInt_co, /) -> NDArray[signedinteger]: ...
|
|
194
195
|
@overload
|
|
195
|
-
def outer(
|
|
196
|
-
x1: _ArrayLikeComplex_co,
|
|
197
|
-
x2: _ArrayLikeComplex_co,
|
|
198
|
-
) -> NDArray[complexfloating]: ...
|
|
196
|
+
def outer(x1: _ArrayLikeFloat_co, x2: _ArrayLikeFloat_co, /) -> NDArray[floating]: ...
|
|
199
197
|
@overload
|
|
200
|
-
def outer(
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
out: None = ...,
|
|
204
|
-
) -> NDArray[timedelta64]: ...
|
|
198
|
+
def outer(x1: _ArrayLikeComplex_co, x2: _ArrayLikeComplex_co, /) -> NDArray[complexfloating]: ...
|
|
199
|
+
@overload
|
|
200
|
+
def outer(x1: _ArrayLikeTD64_co, x2: _ArrayLikeTD64_co, /) -> NDArray[timedelta64]: ...
|
|
205
201
|
@overload
|
|
206
|
-
def outer(x1: _ArrayLikeObject_co, x2: _ArrayLikeObject_co) -> NDArray[object_]: ...
|
|
202
|
+
def outer(x1: _ArrayLikeObject_co, x2: _ArrayLikeObject_co, /) -> NDArray[object_]: ...
|
|
207
203
|
@overload
|
|
208
204
|
def outer(
|
|
209
205
|
x1: _ArrayLikeComplex_co | _ArrayLikeTD64_co | _ArrayLikeObject_co,
|
|
210
206
|
x2: _ArrayLikeComplex_co | _ArrayLikeTD64_co | _ArrayLikeObject_co,
|
|
211
|
-
|
|
207
|
+
/,
|
|
208
|
+
) -> NDArray[Any]: ...
|
|
212
209
|
|
|
213
210
|
@overload
|
|
214
211
|
def qr(a: _ArrayLikeInt_co, mode: _ModeKind = ...) -> QRResult: ...
|
|
@@ -308,20 +305,26 @@ def matrix_rank(
|
|
|
308
305
|
@overload
|
|
309
306
|
def pinv(
|
|
310
307
|
a: _ArrayLikeInt_co,
|
|
311
|
-
rcond: _ArrayLikeFloat_co =
|
|
312
|
-
hermitian: bool =
|
|
308
|
+
rcond: _ArrayLikeFloat_co | None = None,
|
|
309
|
+
hermitian: bool = False,
|
|
310
|
+
*,
|
|
311
|
+
rtol: _ArrayLikeFloat_co | _NoValueType = ...,
|
|
313
312
|
) -> NDArray[float64]: ...
|
|
314
313
|
@overload
|
|
315
314
|
def pinv(
|
|
316
315
|
a: _ArrayLikeFloat_co,
|
|
317
|
-
rcond: _ArrayLikeFloat_co =
|
|
318
|
-
hermitian: bool =
|
|
316
|
+
rcond: _ArrayLikeFloat_co | None = None,
|
|
317
|
+
hermitian: bool = False,
|
|
318
|
+
*,
|
|
319
|
+
rtol: _ArrayLikeFloat_co | _NoValueType = ...,
|
|
319
320
|
) -> NDArray[floating]: ...
|
|
320
321
|
@overload
|
|
321
322
|
def pinv(
|
|
322
323
|
a: _ArrayLikeComplex_co,
|
|
323
|
-
rcond: _ArrayLikeFloat_co =
|
|
324
|
-
hermitian: bool =
|
|
324
|
+
rcond: _ArrayLikeFloat_co | None = None,
|
|
325
|
+
hermitian: bool = False,
|
|
326
|
+
*,
|
|
327
|
+
rtol: _ArrayLikeFloat_co | _NoValueType = ...,
|
|
325
328
|
) -> NDArray[complexfloating]: ...
|
|
326
329
|
|
|
327
330
|
# TODO: Returns a 2-tuple of scalars for 2D arrays and
|
|
@@ -461,22 +464,12 @@ def cross(
|
|
|
461
464
|
) -> NDArray[complexfloating]: ...
|
|
462
465
|
|
|
463
466
|
@overload
|
|
464
|
-
def matmul(
|
|
465
|
-
x1: _ArrayLikeInt_co,
|
|
466
|
-
x2: _ArrayLikeInt_co,
|
|
467
|
-
) -> NDArray[signedinteger]: ...
|
|
467
|
+
def matmul(x1: _ArrayLike[_NumberT], x2: _ArrayLike[_NumberT], /) -> NDArray[_NumberT]: ...
|
|
468
468
|
@overload
|
|
469
|
-
def matmul(
|
|
470
|
-
x1: _ArrayLikeUInt_co,
|
|
471
|
-
x2: _ArrayLikeUInt_co,
|
|
472
|
-
) -> NDArray[unsignedinteger]: ...
|
|
469
|
+
def matmul(x1: _ArrayLikeInt_co, x2: _ArrayLikeInt_co, /) -> NDArray[signedinteger]: ...
|
|
473
470
|
@overload
|
|
474
|
-
def matmul(
|
|
475
|
-
x1: _ArrayLikeFloat_co,
|
|
476
|
-
x2: _ArrayLikeFloat_co,
|
|
477
|
-
) -> NDArray[floating]: ...
|
|
471
|
+
def matmul(x1: _ArrayLikeUInt_co, x2: _ArrayLikeUInt_co, /) -> NDArray[unsignedinteger]: ...
|
|
478
472
|
@overload
|
|
479
|
-
def matmul(
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
) -> NDArray[complexfloating]: ...
|
|
473
|
+
def matmul(x1: _ArrayLikeFloat_co, x2: _ArrayLikeFloat_co, /) -> NDArray[floating]: ...
|
|
474
|
+
@overload
|
|
475
|
+
def matmul(x1: _ArrayLikeComplex_co, x2: _ArrayLikeComplex_co, /) -> NDArray[complexfloating]: ...
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
numpy/ma/extras.pyi
CHANGED
|
@@ -110,12 +110,16 @@ def cov(x, y=..., rowvar=..., bias=..., allow_masked=..., ddof=...): ...
|
|
|
110
110
|
def corrcoef(x, y=..., rowvar=..., bias=..., allow_masked=..., ddof=...): ...
|
|
111
111
|
|
|
112
112
|
class MAxisConcatenator(AxisConcatenator):
|
|
113
|
+
__slots__ = ()
|
|
114
|
+
|
|
113
115
|
@staticmethod
|
|
114
116
|
def concatenate(arrays: Incomplete, axis: int = 0) -> Incomplete: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
|
|
115
117
|
@classmethod
|
|
116
118
|
def makemat(cls, arr: Incomplete) -> Incomplete: ... # type: ignore[override] # pyright: ignore[reportIncompatibleVariableOverride]
|
|
117
119
|
|
|
118
120
|
class mr_class(MAxisConcatenator):
|
|
121
|
+
__slots__ = ()
|
|
122
|
+
|
|
119
123
|
def __init__(self) -> None: ...
|
|
120
124
|
|
|
121
125
|
mr_: mr_class
|
|
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
|
|
Binary file
|