scipy 1.16.0__cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl → 1.16.1__cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.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.
- scipy/__config__.py +7 -7
- scipy/_cyutility.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/_lib/_ccallback_c.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/_lib/_test_deprecation_call.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/_lib/_test_deprecation_def.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/_lib/_util.py +7 -0
- scipy/_lib/messagestream.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/cluster/_hierarchy.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/cluster/_optimal_leaf_ordering.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/cluster/_vq.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/fft/_pocketfft/pypocketfft.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/fftpack/convolve.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/integrate/_dop.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/integrate/_lsoda.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/integrate/_odepack.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/integrate/_test_odeint_banded.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/integrate/_vode.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/interpolate/_dfitpack.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/interpolate/_dierckx.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/interpolate/_interpnd.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/interpolate/_ppoly.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/interpolate/_rgi_cython.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/io/_fast_matrix_market/_fmm_core.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/io/_test_fortran.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/io/matlab/_mio5_utils.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/io/matlab/_mio_utils.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/io/matlab/_streams.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/io/matlab/tests/test_streams.py +9 -0
- scipy/linalg/_cythonized_array_utils.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/linalg/_decomp_interpolative.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/linalg/_decomp_lu_cython.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/linalg/_decomp_update.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/linalg/_fblas.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/linalg/_flapack.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/linalg/_matfuncs_expm.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/linalg/_matfuncs_schur_sqrtm.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/linalg/_matfuncs_sqrtm_triu.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/linalg/_solve_toeplitz.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/linalg/cython_blas.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/linalg/cython_lapack.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/linalg/tests/test_matfuncs.py +7 -0
- scipy/ndimage/_cytest.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/ndimage/_filters.py +11 -2
- scipy/ndimage/_ni_label.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/ndimage/_rank_filter_1d.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/ndimage/tests/test_filters.py +52 -0
- scipy/odr/__odrpack.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/optimize/_bglu_dense.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/optimize/_highspy/_core.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/optimize/_highspy/_highs_options.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/optimize/_lbfgsb.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/optimize/_lsq/givens_elimination.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/optimize/_lsq/least_squares.py +2 -2
- scipy/optimize/_minimize.py +0 -1
- scipy/optimize/_moduleTNC.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/optimize/_pava_pybind.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/optimize/_shgo_lib/_complex.py +2 -2
- scipy/optimize/_slsqplib.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/optimize/_trlib/_trlib.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/optimize/cython_optimize/_zeros.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/signal/_filter_design.py +13 -1
- scipy/signal/_fir_filter_design.py +1 -1
- scipy/signal/_peak_finding_utils.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/signal/_polyutils.py +1 -1
- scipy/signal/_sosfilt.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/signal/_upfirdn_apply.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/signal/tests/test_filter_design.py +19 -0
- scipy/signal/tests/test_fir_filter_design.py +5 -0
- scipy/sparse/_base.py +4 -1
- scipy/sparse/_csparsetools.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/sparse/csgraph/_flow.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/sparse/csgraph/_matching.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/sparse/csgraph/_min_spanning_tree.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/sparse/csgraph/_reordering.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/sparse/csgraph/_shortest_path.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/sparse/csgraph/_tools.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/sparse/csgraph/_traversal.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/sparse/linalg/_dsolve/_superlu.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/sparse/linalg/_eigen/arpack/_arpack.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/sparse/linalg/_propack/_cpropack.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/sparse/linalg/_propack/_dpropack.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/sparse/linalg/_propack/_spropack.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/sparse/linalg/_propack/_zpropack.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/sparse/tests/test_base.py +3 -0
- scipy/spatial/_ckdtree.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/spatial/_distance_pybind.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/spatial/_hausdorff.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/spatial/_qhull.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/spatial/_voronoi.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/spatial/transform/_rigid_transform.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/spatial/transform/_rotation.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/special/_comb.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/special/_ellip_harm_2.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/special/_specfun.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/special/_test_internal.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/special/_ufuncs.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/special/_ufuncs_cxx.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/special/cython_special.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/stats/_ansari_swilk_statistics.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/stats/_biasedurn.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/stats/_continuous_distns.py +19 -16
- scipy/stats/_levy_stable/levyst.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/stats/_qmc_cy.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/stats/_qmvnt_cy.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/stats/_rcont/rcont.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/stats/_sobol.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/stats/_stats.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/stats/_unuran/unuran_wrapper.cpython-313-aarch64-linux-gnu.so +0 -0
- scipy/stats/tests/test_distributions.py +13 -0
- scipy/stats/tests/test_fast_gen_inversion.py +2 -0
- scipy/version.py +2 -2
- {scipy-1.16.0.dist-info → scipy-1.16.1.dist-info}/METADATA +2 -1
- {scipy-1.16.0.dist-info → scipy-1.16.1.dist-info}/RECORD +115 -115
- {scipy-1.16.0.dist-info → scipy-1.16.1.dist-info}/LICENSE.txt +0 -0
- {scipy-1.16.0.dist-info → scipy-1.16.1.dist-info}/WHEEL +0 -0
scipy/__config__.py
CHANGED
@@ -59,7 +59,7 @@ CONFIG = _cleanup(
|
|
59
59
|
},
|
60
60
|
"pythran": {
|
61
61
|
"version": r"0.18.0",
|
62
|
-
"include directory": r"../../tmp/build-env-
|
62
|
+
"include directory": r"../../tmp/build-env-ulwtif3t/lib/python3.13/site-packages/pythran"
|
63
63
|
},
|
64
64
|
},
|
65
65
|
"Machine Information": {
|
@@ -83,8 +83,8 @@ CONFIG = _cleanup(
|
|
83
83
|
"found": bool("True".lower().replace('false', '')),
|
84
84
|
"version": "0.3.28",
|
85
85
|
"detection method": "pkgconfig",
|
86
|
-
"include directory": r"/opt/_internal/cpython-3.13.
|
87
|
-
"lib directory": r"/opt/_internal/cpython-3.13.
|
86
|
+
"include directory": r"/opt/_internal/cpython-3.13.5/lib/python3.13/site-packages/scipy_openblas32/include",
|
87
|
+
"lib directory": r"/opt/_internal/cpython-3.13.5/lib/python3.13/site-packages/scipy_openblas32/lib",
|
88
88
|
"openblas configuration": r"OpenBLAS 0.3.28 DYNAMIC_ARCH NO_AFFINITY neoversen2 MAX_THREADS=64",
|
89
89
|
"pc file directory": r"/project",
|
90
90
|
},
|
@@ -93,20 +93,20 @@ CONFIG = _cleanup(
|
|
93
93
|
"found": bool("True".lower().replace('false', '')),
|
94
94
|
"version": "0.3.28",
|
95
95
|
"detection method": "pkgconfig",
|
96
|
-
"include directory": r"/opt/_internal/cpython-3.13.
|
97
|
-
"lib directory": r"/opt/_internal/cpython-3.13.
|
96
|
+
"include directory": r"/opt/_internal/cpython-3.13.5/lib/python3.13/site-packages/scipy_openblas32/include",
|
97
|
+
"lib directory": r"/opt/_internal/cpython-3.13.5/lib/python3.13/site-packages/scipy_openblas32/lib",
|
98
98
|
"openblas configuration": r"OpenBLAS 0.3.28 DYNAMIC_ARCH NO_AFFINITY neoversen2 MAX_THREADS=64",
|
99
99
|
"pc file directory": r"/project",
|
100
100
|
},
|
101
101
|
"pybind11": {
|
102
102
|
"name": "pybind11",
|
103
|
-
"version": "
|
103
|
+
"version": "3.0.0",
|
104
104
|
"detection method": "config-tool",
|
105
105
|
"include directory": r"unknown",
|
106
106
|
},
|
107
107
|
},
|
108
108
|
"Python Information": {
|
109
|
-
"path": r"/tmp/build-env-
|
109
|
+
"path": r"/tmp/build-env-ulwtif3t/bin/python",
|
110
110
|
"version": "3.13",
|
111
111
|
},
|
112
112
|
}
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
scipy/_lib/_util.py
CHANGED
@@ -351,6 +351,13 @@ def _transition_to_rng(old_name, *, position_num=None, end_version=None,
|
|
351
351
|
|
352
352
|
return fun(*args, **kwargs)
|
353
353
|
|
354
|
+
# Add the old parameter name to the function signature
|
355
|
+
wrapped_signature = inspect.signature(fun)
|
356
|
+
wrapper.__signature__ = wrapped_signature.replace(parameters=[
|
357
|
+
*wrapped_signature.parameters.values(),
|
358
|
+
inspect.Parameter(old_name, inspect.Parameter.KEYWORD_ONLY, default=None),
|
359
|
+
])
|
360
|
+
|
354
361
|
if replace_doc:
|
355
362
|
doc = FunctionDoc(wrapper)
|
356
363
|
parameter_names = [param.name for param in doc['Parameters']]
|
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
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -2,7 +2,9 @@
|
|
2
2
|
|
3
3
|
"""
|
4
4
|
|
5
|
+
import platform
|
5
6
|
import os
|
7
|
+
import sys
|
6
8
|
import zlib
|
7
9
|
|
8
10
|
from io import BytesIO
|
@@ -15,6 +17,7 @@ import numpy as np
|
|
15
17
|
|
16
18
|
from numpy.testing import assert_, assert_equal
|
17
19
|
from pytest import raises as assert_raises
|
20
|
+
import pytest
|
18
21
|
|
19
22
|
from scipy.io.matlab._streams import (make_stream,
|
20
23
|
GenericStream, ZlibInputStream,
|
@@ -194,6 +197,9 @@ class TestZlibInputStream:
|
|
194
197
|
stream.seek(1024)
|
195
198
|
assert_(stream.all_data_read())
|
196
199
|
|
200
|
+
@pytest.mark.skipif(
|
201
|
+
(platform.system() == 'Windows' and sys.version_info >= (3, 14)),
|
202
|
+
reason='gh-23185')
|
197
203
|
def test_all_data_read_overlap(self):
|
198
204
|
COMPRESSION_LEVEL = 6
|
199
205
|
|
@@ -210,6 +216,9 @@ class TestZlibInputStream:
|
|
210
216
|
stream.seek(len(data))
|
211
217
|
assert_(stream.all_data_read())
|
212
218
|
|
219
|
+
@pytest.mark.skipif(
|
220
|
+
(platform.system() == 'Windows' and sys.version_info >= (3, 14)),
|
221
|
+
reason='gh-23185')
|
213
222
|
def test_all_data_read_bad_checksum(self):
|
214
223
|
COMPRESSION_LEVEL = 6
|
215
224
|
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -460,6 +460,13 @@ class TestSqrtM:
|
|
460
460
|
np.fill_diagonal(M, 1)
|
461
461
|
assert np.isrealobj(sqrtm(M))
|
462
462
|
|
463
|
+
def test_gh23278(self):
|
464
|
+
M = np.array([[1., 0., 0.], [0, 1, -1j], [0, 1j, 2]])
|
465
|
+
sq = sqrtm(M)
|
466
|
+
assert_allclose(sq @ sq, M, atol=1e-14)
|
467
|
+
sq = sqrtm(M.astype(np.complex64))
|
468
|
+
assert_allclose(sq @ sq, M, atol=1e-6)
|
469
|
+
|
463
470
|
def test_data_size_preservation_uint_in_float_out(self):
|
464
471
|
M = np.eye(10, dtype=np.uint8)
|
465
472
|
assert sqrtm(M).dtype == np.float64
|
Binary file
|
scipy/ndimage/_filters.py
CHANGED
@@ -232,7 +232,9 @@ def vectorized_filter(input, function, *, size=None, footprint=None, output=None
|
|
232
232
|
We adjust `size` to the number of dimensions indicated by `axes`.
|
233
233
|
For instance, if `axes` is ``(0, 2, 1)`` and ``n`` is passed for ``size``,
|
234
234
|
then the effective `size` is ``(n, n, n)``.
|
235
|
-
|
235
|
+
output : array, optional
|
236
|
+
The array in which to place the output. By default, an array of the dtype
|
237
|
+
returned by `function` will be created.
|
236
238
|
mode : {'reflect', 'constant', 'nearest', 'mirror', 'wrap'}, optional
|
237
239
|
The `mode` parameter determines how the input array is extended
|
238
240
|
beyond its boundaries. Default is 'reflect'. Behavior for each valid
|
@@ -1987,7 +1989,14 @@ def _rank_filter(input, rank, size=None, footprint=None, output=None,
|
|
1987
1989
|
"A sequence of modes is not supported by non-separable rank "
|
1988
1990
|
"filters")
|
1989
1991
|
mode = _ni_support._extend_mode_to_code(mode, is_filter=True)
|
1990
|
-
|
1992
|
+
# Some corner cases are currently not allowed to use the
|
1993
|
+
# "new"/fast 1D rank filter code, including when the
|
1994
|
+
# footprint is large compared to the array size.
|
1995
|
+
# See discussion in gh-23293; longer-term it may be possible
|
1996
|
+
# to allow the fast path for these corner cases as well,
|
1997
|
+
# if algorithmic fixes are found.
|
1998
|
+
lim2 = input.size - ((footprint.size - 1) // 2 - origin)
|
1999
|
+
if input.ndim == 1 and ((lim2 >= 0) or (input.size == 1)):
|
1991
2000
|
if input.dtype in (np.int64, np.float64, np.float32):
|
1992
2001
|
x = input
|
1993
2002
|
x_out = output
|
Binary file
|
Binary file
|
@@ -3029,3 +3029,55 @@ class TestVectorizedFilter:
|
|
3029
3029
|
def test_gh_22586_crash_property(x, size, mode):
|
3030
3030
|
# property-based test for median_filter resilience to hard crashing
|
3031
3031
|
ndimage.median_filter(x, size=size, mode=mode)
|
3032
|
+
|
3033
|
+
|
3034
|
+
@pytest.mark.parametrize('samples, mode, size, expected', [
|
3035
|
+
([1, 2], "reflect", 5, [2, 1]),
|
3036
|
+
([2], "reflect", 5, [2]), # original failure from gh-23075
|
3037
|
+
([2], "nearest", 5, [2]),
|
3038
|
+
([2], "wrap", 5, [2]),
|
3039
|
+
([2], "mirror", 5, [2]),
|
3040
|
+
([2], "constant", 5, [0]),
|
3041
|
+
([2], "reflect", 1, [2]),
|
3042
|
+
([2], "nearest", 1, [2]),
|
3043
|
+
([2], "wrap", 1, [2]),
|
3044
|
+
([2], "mirror", 1, [2]),
|
3045
|
+
([2], "constant", 1, [2]),
|
3046
|
+
([2], "reflect", 100, [2]),
|
3047
|
+
([2], "nearest", 100, [2]),
|
3048
|
+
([2], "wrap", 100, [2]),
|
3049
|
+
([2], "mirror", 100, [2]),
|
3050
|
+
([2], "constant", 100, [0]),
|
3051
|
+
])
|
3052
|
+
def test_gh_23075(samples, mode, size, expected):
|
3053
|
+
# results verified against SciPy 1.14.1, before the median_filter
|
3054
|
+
# overhaul
|
3055
|
+
sample_array = np.asarray(samples, dtype=np.float32)
|
3056
|
+
expected = np.asarray(expected, dtype=np.float32)
|
3057
|
+
filtered_samples = ndimage.median_filter(sample_array, size=size, mode=mode)
|
3058
|
+
xp_assert_close(filtered_samples, expected, check_shape=True, check_dtype=True)
|
3059
|
+
|
3060
|
+
|
3061
|
+
@pytest.mark.parametrize('samples, size, cval, expected', [
|
3062
|
+
([2], 5, 17.7, [17.7]),
|
3063
|
+
([2], 1, 0, [2]),
|
3064
|
+
([2], 100, 1.4, [1.4]),
|
3065
|
+
([9], 137, -7807.7, [-7807.7]),
|
3066
|
+
])
|
3067
|
+
def test_gh_23075_constant(samples, size, cval, expected):
|
3068
|
+
# results verified against SciPy 1.14.1, before the median_filter
|
3069
|
+
# overhaul
|
3070
|
+
sample_array = np.asarray(samples, dtype=np.single)
|
3071
|
+
expected = np.asarray(expected, dtype=np.single)
|
3072
|
+
filtered_samples = ndimage.median_filter(sample_array,
|
3073
|
+
size=size,
|
3074
|
+
mode="constant",
|
3075
|
+
cval=cval)
|
3076
|
+
xp_assert_close(filtered_samples, expected, check_shape=True, check_dtype=True)
|
3077
|
+
|
3078
|
+
|
3079
|
+
def test_median_filter_lim2():
|
3080
|
+
sample_array = np.ones(8)
|
3081
|
+
expected = np.ones(8)
|
3082
|
+
filtered_samples = ndimage.median_filter(sample_array, size=19, mode="reflect")
|
3083
|
+
xp_assert_close(filtered_samples, expected, check_shape=True, check_dtype=True)
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -17,7 +17,7 @@ from .trf import trf
|
|
17
17
|
from .dogbox import dogbox
|
18
18
|
from .common import EPS, in_bounds, make_strictly_feasible
|
19
19
|
|
20
|
-
|
20
|
+
|
21
21
|
from scipy.optimize._optimize import _wrap_callback
|
22
22
|
|
23
23
|
TERMINATION_MESSAGES = {
|
@@ -392,7 +392,7 @@ def least_squares(
|
|
392
392
|
|
393
393
|
* For 'trf' : ``x_scale == 1``
|
394
394
|
* For 'dogbox' : ``x_scale == 1``
|
395
|
-
* For '
|
395
|
+
* For 'lm' : ``x_scale == 'jac'``
|
396
396
|
|
397
397
|
.. versionchanged:: 1.16.0
|
398
398
|
The default keyword value is changed from 1 to None to indicate that
|
scipy/optimize/_minimize.py
CHANGED
@@ -188,7 +188,6 @@ def minimize(fun, x0, args=(), method=None, jac=None, hess=None,
|
|
188
188
|
|
189
189
|
Equality constraint means that the constraint function result is to
|
190
190
|
be zero whereas inequality means that it is to be non-negative.
|
191
|
-
Note that COBYLA only supports inequality constraints.
|
192
191
|
|
193
192
|
tol : float, optional
|
194
193
|
Tolerance for termination. When `tol` is specified, the selected
|
Binary file
|
Binary file
|
@@ -183,6 +183,7 @@ class Complex:
|
|
183
183
|
self.V = VertexCacheIndex()
|
184
184
|
|
185
185
|
self.V_non_symm = [] # List of non-symmetric vertices
|
186
|
+
self.split_edge = cache(self._split_edge)
|
186
187
|
|
187
188
|
def __call__(self):
|
188
189
|
return self.H
|
@@ -995,8 +996,7 @@ class Complex:
|
|
995
996
|
d_v0v1.connect(d_v1v2)
|
996
997
|
return
|
997
998
|
|
998
|
-
|
999
|
-
def split_edge(self, v1, v2):
|
999
|
+
def _split_edge(self, v1, v2):
|
1000
1000
|
v1 = self.V[v1]
|
1001
1001
|
v2 = self.V[v2]
|
1002
1002
|
# Destroy original edge, if it exists:
|
Binary file
|
Binary file
|
Binary file
|
scipy/signal/_filter_design.py
CHANGED
@@ -60,6 +60,17 @@ def _is_int_type(x):
|
|
60
60
|
return True
|
61
61
|
|
62
62
|
|
63
|
+
def _real_dtype_for_complex(dtyp, *, xp):
|
64
|
+
if xp.isdtype(dtyp, 'real floating'):
|
65
|
+
return dtyp
|
66
|
+
if dtyp == xp.complex64:
|
67
|
+
return xp.float32
|
68
|
+
elif dtyp == xp.complex128:
|
69
|
+
return xp.float64
|
70
|
+
else:
|
71
|
+
raise ValueError(f"Unknown dtype {dtyp}.")
|
72
|
+
|
73
|
+
|
63
74
|
# https://github.com/numpy/numpy/blob/v2.2.0/numpy/_core/function_base.py#L195-L302
|
64
75
|
def _logspace(start, stop, num=50, endpoint=True, base=10.0, dtype=None, *, xp):
|
65
76
|
if not isinstance(base, float | int) and xp.asarray(base).ndim > 0:
|
@@ -488,6 +499,7 @@ def freqz(b, a=1, worN=512, whole=False, plot=None, fs=2*pi,
|
|
488
499
|
if xp.isdtype(a.dtype, 'integral'):
|
489
500
|
a = xp.astype(a, xp_default_dtype(xp))
|
490
501
|
res_dtype = xp.result_type(b, a)
|
502
|
+
real_dtype = _real_dtype_for_complex(res_dtype, xp=xp)
|
491
503
|
|
492
504
|
b = xpx.atleast_nd(b, ndim=1, xp=xp)
|
493
505
|
a = xpx.atleast_nd(a, ndim=1, xp=xp)
|
@@ -509,7 +521,7 @@ def freqz(b, a=1, worN=512, whole=False, plot=None, fs=2*pi,
|
|
509
521
|
# if include_nyquist is true and whole is false, w should
|
510
522
|
# include end point
|
511
523
|
w = xp.linspace(0, lastpoint, N,
|
512
|
-
endpoint=include_nyquist and not whole, dtype=
|
524
|
+
endpoint=include_nyquist and not whole, dtype=real_dtype)
|
513
525
|
n_fft = N if whole else 2 * (N - 1) if include_nyquist else 2 * N
|
514
526
|
if (xp_size(a) == 1 and (b.ndim == 1 or (b.shape[-1] == 1))
|
515
527
|
and n_fft >= b.shape[0]
|
@@ -834,7 +834,7 @@ def remez(numtaps, bands, desired, *, weight=None, type='bandpass',
|
|
834
834
|
xp = array_namespace(bands, desired, weight)
|
835
835
|
bands = np.asarray(bands)
|
836
836
|
desired = np.asarray(desired)
|
837
|
-
if weight:
|
837
|
+
if weight is not None:
|
838
838
|
weight = np.asarray(weight)
|
839
839
|
|
840
840
|
fs = _validate_fs(fs, allow_none=True)
|
Binary file
|
scipy/signal/_polyutils.py
CHANGED
@@ -117,7 +117,7 @@ def poly(seq_of_zeros, *, xp):
|
|
117
117
|
if xp.isdtype(a.dtype, 'complex floating'):
|
118
118
|
# if complex roots are all complex conjugates, the roots are real.
|
119
119
|
roots = xp.asarray(seq_of_zeros, dtype=xp.complex128)
|
120
|
-
if xp.all(
|
120
|
+
if xp.all(xp.sort(xp.imag(roots)) == xp.sort(xp.imag(xp.conj(roots)))):
|
121
121
|
a = xp.asarray(xp.real(a), copy=True)
|
122
122
|
|
123
123
|
return a
|
Binary file
|
Binary file
|
@@ -382,6 +382,19 @@ class TestTf2Sos:
|
|
382
382
|
sos2 = tf2sos(b, a, analog=analog)
|
383
383
|
assert_array_almost_equal(sos, sos2, decimal=4)
|
384
384
|
|
385
|
+
def test_gh_23221(self):
|
386
|
+
# Tests that this tf2sos call below does not produce ComplexWarnings
|
387
|
+
# This test is specific for scipy==1.16.0: later scipy versions do not produce
|
388
|
+
# the warning.
|
389
|
+
with suppress_warnings():
|
390
|
+
warnings.simplefilter("error")
|
391
|
+
tf2sos([0.21860986786301265, -0.4372197357260253, -0.2186098678630126,
|
392
|
+
0.8744394714520509, -0.21860986786301248, -0.4372197357260253,
|
393
|
+
0.21860986786301265],
|
394
|
+
[1., -4.18323041786553, 6.829924151626914, -5.407777865686045,
|
395
|
+
2.0773105450802336, -0.33482732571537893, 0.0186009178695853 ]
|
396
|
+
)
|
397
|
+
|
385
398
|
|
386
399
|
@skip_xp_backends(
|
387
400
|
cpu_only=True, reason="XXX zpk2sos is numpy-only", exceptions=['cupy']
|
@@ -754,6 +767,12 @@ class TestFreqz:
|
|
754
767
|
xp_assert_equal(w, xp.asarray([0. , 0.1]))
|
755
768
|
xp_assert_equal(h, xp.asarray([1.+0.j, 1.+0.j]))
|
756
769
|
|
770
|
+
def test_gh_23277(self):
|
771
|
+
# backwards compatibility: `w` array must be real, not complex
|
772
|
+
filt = [0.5 + 0.0j, 0.5 + 0.0j]
|
773
|
+
w, _ = freqz(filt, worN=8)
|
774
|
+
assert w.dtype == np.float64
|
775
|
+
|
757
776
|
def test_basic(self, xp):
|
758
777
|
w, h = freqz(xp.asarray([1.0]), worN=8)
|
759
778
|
assert_array_almost_equal(w, xp.pi * xp.arange(8, dtype=w.dtype) / 8.)
|
@@ -546,6 +546,11 @@ class TestRemez:
|
|
546
546
|
with pytest.raises(ValueError, match="Sampling.*single scalar"):
|
547
547
|
remez(11, .1, 1, fs=np.array([10, 20]))
|
548
548
|
|
549
|
+
def test_gh_23266(self, xp):
|
550
|
+
bands = xp.asarray([0.0, 0.2, 0.3, 0.5])
|
551
|
+
desired = xp.asarray([1.0, 0.0])
|
552
|
+
weight = xp.asarray([1.0, 2.0])
|
553
|
+
remez(21, bands, desired, weight=weight)
|
549
554
|
|
550
555
|
|
551
556
|
@skip_xp_backends(cpu_only=True, reason="lstsq")
|
scipy/sparse/_base.py
CHANGED
@@ -494,7 +494,10 @@ class _spbase(SparseABC):
|
|
494
494
|
return self._mul_scalar(other)
|
495
495
|
|
496
496
|
if self.ndim < 3:
|
497
|
-
|
497
|
+
try:
|
498
|
+
return self._multiply_2d_with_broadcasting(other)
|
499
|
+
except AttributeError:
|
500
|
+
return self.tocsr()._multiply_2d_with_broadcasting(other)
|
498
501
|
|
499
502
|
if not (issparse(other) or isdense(other)):
|
500
503
|
# If it's a list or whatever, treat it like an array
|
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
|
scipy/sparse/tests/test_base.py
CHANGED
@@ -1624,6 +1624,9 @@ class _TestCommon:
|
|
1624
1624
|
B = array([[0,7,0],[0,-4,0]])
|
1625
1625
|
Asp = self.spcreator(A)
|
1626
1626
|
Bsp = self.spcreator(B)
|
1627
|
+
# check output format
|
1628
|
+
out_fmt = Asp.format if Asp.format in ('csc', 'dia', 'bsr') else 'csr'
|
1629
|
+
assert (Asp.multiply(Bsp)).format == out_fmt
|
1627
1630
|
assert_almost_equal(Asp.multiply(Bsp).toarray(), A*B) # sparse/sparse
|
1628
1631
|
assert_almost_equal(Asp.multiply(B).toarray(), A*B) # sparse/dense
|
1629
1632
|
|
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
|
Binary file
|