scipy 1.16.0rc2__cp313-cp313-macosx_14_0_arm64.whl → 1.16.1__cp313-cp313-macosx_14_0_arm64.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/.dylibs/libgcc_s.1.1.dylib +0 -0
- scipy/.dylibs/libgfortran.5.dylib +0 -0
- scipy/.dylibs/libquadmath.0.dylib +0 -0
- scipy/__config__.py +5 -5
- scipy/_cyutility.cpython-313-darwin.so +0 -0
- scipy/_lib/_ccallback_c.cpython-313-darwin.so +0 -0
- scipy/_lib/_test_deprecation_call.cpython-313-darwin.so +0 -0
- scipy/_lib/_util.py +7 -0
- scipy/_lib/messagestream.cpython-313-darwin.so +0 -0
- scipy/cluster/_hierarchy.cpython-313-darwin.so +0 -0
- scipy/cluster/_optimal_leaf_ordering.cpython-313-darwin.so +0 -0
- scipy/cluster/_vq.cpython-313-darwin.so +0 -0
- scipy/conftest.py +25 -0
- scipy/fft/_pocketfft/pypocketfft.cpython-313-darwin.so +0 -0
- scipy/fftpack/convolve.cpython-313-darwin.so +0 -0
- scipy/integrate/_dop.cpython-313-darwin.so +0 -0
- scipy/integrate/_lsoda.cpython-313-darwin.so +0 -0
- scipy/integrate/_odepack.cpython-313-darwin.so +0 -0
- scipy/integrate/_test_odeint_banded.cpython-313-darwin.so +0 -0
- scipy/integrate/_vode.cpython-313-darwin.so +0 -0
- scipy/interpolate/_dfitpack.cpython-313-darwin.so +0 -0
- scipy/interpolate/_fitpack.cpython-313-darwin.so +0 -0
- scipy/interpolate/_interpnd.cpython-313-darwin.so +0 -0
- scipy/interpolate/_ppoly.cpython-313-darwin.so +0 -0
- scipy/interpolate/_rgi_cython.cpython-313-darwin.so +0 -0
- scipy/io/_fast_matrix_market/_fmm_core.cpython-313-darwin.so +0 -0
- scipy/io/_test_fortran.cpython-313-darwin.so +0 -0
- scipy/io/matlab/_mio5_utils.cpython-313-darwin.so +0 -0
- scipy/io/matlab/_mio_utils.cpython-313-darwin.so +0 -0
- scipy/io/matlab/_streams.cpython-313-darwin.so +0 -0
- scipy/io/matlab/tests/test_streams.py +9 -0
- scipy/linalg/_cythonized_array_utils.cpython-313-darwin.so +0 -0
- scipy/linalg/_decomp_interpolative.cpython-313-darwin.so +0 -0
- scipy/linalg/_decomp_lu_cython.cpython-313-darwin.so +0 -0
- scipy/linalg/_decomp_update.cpython-313-darwin.so +0 -0
- scipy/linalg/_fblas.cpython-313-darwin.so +0 -0
- scipy/linalg/_flapack.cpython-313-darwin.so +0 -0
- scipy/linalg/_matfuncs_schur_sqrtm.cpython-313-darwin.so +0 -0
- scipy/linalg/_matfuncs_sqrtm_triu.cpython-313-darwin.so +0 -0
- scipy/linalg/_solve_toeplitz.cpython-313-darwin.so +0 -0
- scipy/linalg/blas.py +35 -24
- scipy/linalg/cython_blas.cpython-313-darwin.so +0 -0
- scipy/linalg/cython_lapack.cpython-313-darwin.so +0 -0
- scipy/linalg/tests/test_matfuncs.py +7 -0
- scipy/ndimage/_cytest.cpython-313-darwin.so +0 -0
- scipy/ndimage/_filters.py +11 -2
- scipy/ndimage/_ni_label.cpython-313-darwin.so +0 -0
- scipy/ndimage/_rank_filter_1d.cpython-313-darwin.so +0 -0
- scipy/ndimage/tests/test_filters.py +52 -0
- scipy/odr/__odrpack.cpython-313-darwin.so +0 -0
- scipy/optimize/_bglu_dense.cpython-313-darwin.so +0 -0
- scipy/optimize/_highspy/_core.cpython-313-darwin.so +0 -0
- scipy/optimize/_highspy/_highs_options.cpython-313-darwin.so +0 -0
- scipy/optimize/_lbfgsb_py.py +23 -8
- scipy/optimize/_lsq/givens_elimination.cpython-313-darwin.so +0 -0
- scipy/optimize/_lsq/least_squares.py +2 -2
- scipy/optimize/_minimize.py +0 -1
- scipy/optimize/_moduleTNC.cpython-313-darwin.so +0 -0
- scipy/optimize/_pava_pybind.cpython-313-darwin.so +0 -0
- scipy/optimize/_shgo_lib/_complex.py +2 -2
- scipy/optimize/_trlib/_trlib.cpython-313-darwin.so +0 -0
- scipy/optimize/cython_optimize/_zeros.cpython-313-darwin.so +0 -0
- scipy/optimize/tests/test_optimize.py +3 -3
- scipy/signal/_filter_design.py +13 -1
- scipy/signal/_fir_filter_design.py +1 -1
- scipy/signal/_peak_finding_utils.cpython-313-darwin.so +0 -0
- scipy/signal/_polyutils.py +1 -1
- scipy/signal/_sosfilt.cpython-313-darwin.so +0 -0
- scipy/signal/_upfirdn_apply.cpython-313-darwin.so +0 -0
- scipy/signal/tests/test_filter_design.py +19 -0
- scipy/signal/tests/test_fir_filter_design.py +5 -0
- scipy/signal/tests/test_signaltools.py +1 -1
- scipy/sparse/_base.py +4 -1
- scipy/sparse/_csparsetools.cpython-313-darwin.so +0 -0
- scipy/sparse/csgraph/_flow.cpython-313-darwin.so +0 -0
- scipy/sparse/csgraph/_matching.cpython-313-darwin.so +0 -0
- scipy/sparse/csgraph/_min_spanning_tree.cpython-313-darwin.so +0 -0
- scipy/sparse/csgraph/_reordering.cpython-313-darwin.so +0 -0
- scipy/sparse/csgraph/_shortest_path.cpython-313-darwin.so +0 -0
- scipy/sparse/csgraph/_tools.cpython-313-darwin.so +0 -0
- scipy/sparse/csgraph/_traversal.cpython-313-darwin.so +0 -0
- scipy/sparse/linalg/_eigen/arpack/_arpack.cpython-313-darwin.so +0 -0
- scipy/sparse/linalg/_propack/_cpropack.cpython-313-darwin.so +0 -0
- scipy/sparse/linalg/_propack/_dpropack.cpython-313-darwin.so +0 -0
- scipy/sparse/linalg/_propack/_spropack.cpython-313-darwin.so +0 -0
- scipy/sparse/linalg/_propack/_zpropack.cpython-313-darwin.so +0 -0
- scipy/sparse/tests/test_base.py +3 -0
- scipy/spatial/_ckdtree.cpython-313-darwin.so +0 -0
- scipy/spatial/_distance_pybind.cpython-313-darwin.so +0 -0
- scipy/spatial/_hausdorff.cpython-313-darwin.so +0 -0
- scipy/spatial/_qhull.cpython-313-darwin.so +0 -0
- scipy/spatial/_voronoi.cpython-313-darwin.so +0 -0
- scipy/spatial/transform/_rigid_transform.cpython-313-darwin.so +0 -0
- scipy/spatial/transform/_rotation.cpython-313-darwin.so +0 -0
- scipy/special/_comb.cpython-313-darwin.so +0 -0
- scipy/special/_ellip_harm_2.cpython-313-darwin.so +0 -0
- scipy/special/_specfun.cpython-313-darwin.so +0 -0
- scipy/special/_test_internal.cpython-313-darwin.so +0 -0
- scipy/special/_ufuncs.cpython-313-darwin.so +0 -0
- scipy/special/_ufuncs_cxx.cpython-313-darwin.so +0 -0
- scipy/special/cython_special.cpython-313-darwin.so +0 -0
- scipy/stats/_ansari_swilk_statistics.cpython-313-darwin.so +0 -0
- scipy/stats/_biasedurn.cpython-313-darwin.so +0 -0
- scipy/stats/_continuous_distns.py +19 -16
- scipy/stats/_distribution_infrastructure.py +20 -0
- scipy/stats/_levy_stable/levyst.cpython-313-darwin.so +0 -0
- scipy/stats/_qmc_cy.cpython-313-darwin.so +0 -0
- scipy/stats/_qmvnt_cy.cpython-313-darwin.so +0 -0
- scipy/stats/_rcont/rcont.cpython-313-darwin.so +0 -0
- scipy/stats/_resampling.py +1 -1
- scipy/stats/_sobol.cpython-313-darwin.so +0 -0
- scipy/stats/_stats.cpython-313-darwin.so +0 -0
- scipy/stats/_stats_py.py +1 -1
- scipy/stats/_unuran/unuran_wrapper.cpython-313-darwin.so +0 -0
- scipy/stats/tests/test_distributions.py +13 -0
- scipy/stats/tests/test_fast_gen_inversion.py +2 -0
- scipy/stats/tests/test_morestats.py +4 -4
- scipy/version.py +2 -2
- {scipy-1.16.0rc2.dist-info → scipy-1.16.1.dist-info}/METADATA +2 -1
- {scipy-1.16.0rc2.dist-info → scipy-1.16.1.dist-info}/RECORD +122 -122
- {scipy-1.16.0rc2.dist-info → scipy-1.16.1.dist-info}/LICENSE.txt +0 -0
- {scipy-1.16.0rc2.dist-info → scipy-1.16.1.dist-info}/WHEEL +0 -0
scipy/.dylibs/libgcc_s.1.1.dylib
CHANGED
Binary file
|
Binary file
|
Binary file
|
scipy/__config__.py
CHANGED
@@ -36,7 +36,7 @@ CONFIG = _cleanup(
|
|
36
36
|
"cython": {
|
37
37
|
"name": r"cython",
|
38
38
|
"linker": r"cython",
|
39
|
-
"version": r"3.1.
|
39
|
+
"version": r"3.1.2",
|
40
40
|
"commands": r"cython",
|
41
41
|
"args": r"",
|
42
42
|
"linker args": r"",
|
@@ -52,14 +52,14 @@ CONFIG = _cleanup(
|
|
52
52
|
"fortran": {
|
53
53
|
"name": "gcc",
|
54
54
|
"linker": r"ld64",
|
55
|
-
"version": "13.
|
55
|
+
"version": "13.4.0",
|
56
56
|
"commands": r"gfortran",
|
57
57
|
"args": r"",
|
58
58
|
"linker args": r"",
|
59
59
|
},
|
60
60
|
"pythran": {
|
61
61
|
"version": r"0.18.0",
|
62
|
-
"include directory": r"../../../../../../private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/
|
62
|
+
"include directory": r"../../../../../../private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/build-env-b1iku3ur/lib/python3.13/site-packages/pythran"
|
63
63
|
},
|
64
64
|
},
|
65
65
|
"Machine Information": {
|
@@ -100,13 +100,13 @@ CONFIG = _cleanup(
|
|
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"/private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/
|
109
|
+
"path": r"/private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/build-env-b1iku3ur/bin/python",
|
110
110
|
"version": "3.13",
|
111
111
|
},
|
112
112
|
}
|
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
|
scipy/conftest.py
CHANGED
@@ -34,6 +34,31 @@ except Exception:
|
|
34
34
|
|
35
35
|
|
36
36
|
def pytest_configure(config):
|
37
|
+
"""
|
38
|
+
Add pytest markers to avoid PytestUnknownMarkWarning
|
39
|
+
|
40
|
+
This needs to contain all markers that are SciPy-specific, as well as
|
41
|
+
dummy fallbacks for markers defined in optional test packages.
|
42
|
+
|
43
|
+
Note that we need both the registration here *and* in `pytest.ini`.
|
44
|
+
"""
|
45
|
+
config.addinivalue_line("markers",
|
46
|
+
"slow: Tests that are very slow.")
|
47
|
+
config.addinivalue_line("markers",
|
48
|
+
"xslow: mark test as extremely slow (not run unless explicitly requested)")
|
49
|
+
config.addinivalue_line("markers",
|
50
|
+
"xfail_on_32bit: mark test as failing on 32-bit platforms")
|
51
|
+
config.addinivalue_line("markers",
|
52
|
+
"array_api_backends: test iterates on all array API backends")
|
53
|
+
config.addinivalue_line("markers",
|
54
|
+
("skip_xp_backends(backends, reason=None, np_only=False, cpu_only=False, " +
|
55
|
+
"eager_only=False, exceptions=None): mark the desired skip configuration " +
|
56
|
+
"for the `skip_xp_backends` fixture"))
|
57
|
+
config.addinivalue_line("markers",
|
58
|
+
("xfail_xp_backends(backends, reason=None, np_only=False, cpu_only=False, " +
|
59
|
+
"eager_only=False, exceptions=None): mark the desired xfail configuration " +
|
60
|
+
"for the `xfail_xp_backends` fixture"))
|
61
|
+
|
37
62
|
try:
|
38
63
|
import pytest_timeout # noqa:F401
|
39
64
|
except Exception:
|
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
|
scipy/linalg/blas.py
CHANGED
@@ -45,15 +45,19 @@ BLAS Level 1 functions
|
|
45
45
|
.. autosummary::
|
46
46
|
:toctree: generated/
|
47
47
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
48
|
+
sasum
|
49
|
+
saxpy
|
50
|
+
scasum
|
51
|
+
scnrm2
|
52
|
+
scopy
|
53
|
+
sdot
|
54
|
+
snrm2
|
55
|
+
srot
|
56
|
+
srotg
|
57
|
+
srotm
|
58
|
+
srotmg
|
59
|
+
sscal
|
60
|
+
sswap
|
57
61
|
dasum
|
58
62
|
daxpy
|
59
63
|
dcopy
|
@@ -71,19 +75,15 @@ BLAS Level 1 functions
|
|
71
75
|
idamax
|
72
76
|
isamax
|
73
77
|
izamax
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
srotm
|
84
|
-
srotmg
|
85
|
-
sscal
|
86
|
-
sswap
|
78
|
+
caxpy
|
79
|
+
ccopy
|
80
|
+
cdotc
|
81
|
+
cdotu
|
82
|
+
crotg
|
83
|
+
cscal
|
84
|
+
csrot
|
85
|
+
csscal
|
86
|
+
cswap
|
87
87
|
zaxpy
|
88
88
|
zcopy
|
89
89
|
zdotc
|
@@ -104,12 +104,15 @@ BLAS Level 2 functions
|
|
104
104
|
sgemv
|
105
105
|
sger
|
106
106
|
ssbmv
|
107
|
+
sspmv
|
107
108
|
sspr
|
108
109
|
sspr2
|
109
110
|
ssymv
|
110
111
|
ssyr
|
111
112
|
ssyr2
|
112
113
|
stbmv
|
114
|
+
stbsv
|
115
|
+
stpmv
|
113
116
|
stpsv
|
114
117
|
strmv
|
115
118
|
strsv
|
@@ -117,12 +120,15 @@ BLAS Level 2 functions
|
|
117
120
|
dgemv
|
118
121
|
dger
|
119
122
|
dsbmv
|
123
|
+
dspmv
|
120
124
|
dspr
|
121
125
|
dspr2
|
122
126
|
dsymv
|
123
127
|
dsyr
|
124
128
|
dsyr2
|
125
129
|
dtbmv
|
130
|
+
dtbsv
|
131
|
+
dtpmv
|
126
132
|
dtpsv
|
127
133
|
dtrmv
|
128
134
|
dtrsv
|
@@ -137,13 +143,15 @@ BLAS Level 2 functions
|
|
137
143
|
chpmv
|
138
144
|
chpr
|
139
145
|
chpr2
|
146
|
+
cspmv
|
147
|
+
cspr
|
148
|
+
csyr
|
140
149
|
ctbmv
|
141
150
|
ctbsv
|
142
151
|
ctpmv
|
143
152
|
ctpsv
|
144
153
|
ctrmv
|
145
154
|
ctrsv
|
146
|
-
csyr
|
147
155
|
zgbmv
|
148
156
|
zgemv
|
149
157
|
zgerc
|
@@ -155,12 +163,15 @@ BLAS Level 2 functions
|
|
155
163
|
zhpmv
|
156
164
|
zhpr
|
157
165
|
zhpr2
|
166
|
+
zspmv
|
167
|
+
zspr
|
168
|
+
zsyr
|
158
169
|
ztbmv
|
159
170
|
ztbsv
|
160
171
|
ztpmv
|
172
|
+
ztpsv
|
161
173
|
ztrmv
|
162
174
|
ztrsv
|
163
|
-
zsyr
|
164
175
|
|
165
176
|
BLAS Level 3 functions
|
166
177
|
----------------------
|
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
|
scipy/optimize/_lbfgsb_py.py
CHANGED
@@ -42,6 +42,8 @@ from ._optimize import (MemoizeJac, OptimizeResult, _call_callback_maybe_halt,
|
|
42
42
|
from ._constraints import old_bound_to_new
|
43
43
|
|
44
44
|
from scipy.sparse.linalg import LinearOperator
|
45
|
+
from scipy._lib.deprecation import _NoValue
|
46
|
+
import warnings
|
45
47
|
|
46
48
|
__all__ = ['fmin_l_bfgs_b', 'LbfgsInvHessProduct']
|
47
49
|
|
@@ -93,7 +95,7 @@ def fmin_l_bfgs_b(func, x0, fprime=None, args=(),
|
|
93
95
|
approx_grad=0,
|
94
96
|
bounds=None, m=10, factr=1e7, pgtol=1e-5,
|
95
97
|
epsilon=1e-8,
|
96
|
-
iprint
|
98
|
+
iprint=_NoValue, maxfun=15000, maxiter=15000, disp=_NoValue,
|
97
99
|
callback=None, maxls=20):
|
98
100
|
"""
|
99
101
|
Minimize a function func using the L-BFGS-B algorithm.
|
@@ -144,7 +146,7 @@ def fmin_l_bfgs_b(func, x0, fprime=None, args=(),
|
|
144
146
|
output and this keyword has no function.
|
145
147
|
|
146
148
|
.. deprecated:: 1.15.0
|
147
|
-
This keyword is deprecated and will be removed from SciPy 1.
|
149
|
+
This keyword is deprecated and will be removed from SciPy 1.18.0.
|
148
150
|
|
149
151
|
disp : int, optional
|
150
152
|
Deprecated option that previously controlled the text printed on the
|
@@ -152,7 +154,7 @@ def fmin_l_bfgs_b(func, x0, fprime=None, args=(),
|
|
152
154
|
output and this keyword has no function.
|
153
155
|
|
154
156
|
.. deprecated:: 1.15.0
|
155
|
-
This keyword is deprecated and will be removed from SciPy 1.
|
157
|
+
This keyword is deprecated and will be removed from SciPy 1.18.0.
|
156
158
|
|
157
159
|
maxfun : int, optional
|
158
160
|
Maximum number of function evaluations. Note that this function
|
@@ -265,7 +267,9 @@ def fmin_l_bfgs_b(func, x0, fprime=None, args=(),
|
|
265
267
|
|
266
268
|
# build options
|
267
269
|
callback = _wrap_callback(callback)
|
268
|
-
opts = {'
|
270
|
+
opts = {'disp': disp,
|
271
|
+
'iprint': iprint,
|
272
|
+
'maxcor': m,
|
269
273
|
'ftol': factr * np.finfo(float).eps,
|
270
274
|
'gtol': pgtol,
|
271
275
|
'eps': epsilon,
|
@@ -288,9 +292,9 @@ def fmin_l_bfgs_b(func, x0, fprime=None, args=(),
|
|
288
292
|
|
289
293
|
|
290
294
|
def _minimize_lbfgsb(fun, x0, args=(), jac=None, bounds=None,
|
291
|
-
disp=
|
295
|
+
disp=_NoValue, maxcor=10, ftol=2.2204460492503131e-09,
|
292
296
|
gtol=1e-5, eps=1e-8, maxfun=15000, maxiter=15000,
|
293
|
-
iprint
|
297
|
+
iprint=_NoValue, callback=None, maxls=20,
|
294
298
|
finite_diff_rel_step=None, workers=None,
|
295
299
|
**unknown_options):
|
296
300
|
"""
|
@@ -305,7 +309,7 @@ def _minimize_lbfgsb(fun, x0, args=(), jac=None, bounds=None,
|
|
305
309
|
output and this keyword has no function.
|
306
310
|
|
307
311
|
.. deprecated:: 1.15.0
|
308
|
-
This keyword is deprecated and will be removed from SciPy 1.
|
312
|
+
This keyword is deprecated and will be removed from SciPy 1.18.0.
|
309
313
|
|
310
314
|
maxcor : int
|
311
315
|
The maximum number of variable metric corrections used to
|
@@ -334,7 +338,7 @@ def _minimize_lbfgsb(fun, x0, args=(), jac=None, bounds=None,
|
|
334
338
|
output and this keyword has no function.
|
335
339
|
|
336
340
|
.. deprecated:: 1.15.0
|
337
|
-
This keyword is deprecated and will be removed from SciPy 1.
|
341
|
+
This keyword is deprecated and will be removed from SciPy 1.18.0.
|
338
342
|
|
339
343
|
maxls : int, optional
|
340
344
|
Maximum number of line search steps (per iteration). Default is 20.
|
@@ -373,6 +377,17 @@ def _minimize_lbfgsb(fun, x0, args=(), jac=None, bounds=None,
|
|
373
377
|
|
374
378
|
x0 = asarray(x0).ravel()
|
375
379
|
n, = x0.shape
|
380
|
+
if disp is not _NoValue:
|
381
|
+
warnings.warn("scipy.optimize: The `disp` and `iprint` options of the "
|
382
|
+
"L-BFGS-B solver are deprecated and will be removed in "
|
383
|
+
"SciPy 1.18.0.",
|
384
|
+
DeprecationWarning, stacklevel=3)
|
385
|
+
|
386
|
+
if iprint is not _NoValue:
|
387
|
+
warnings.warn("scipy.optimize: The `disp` and `iprint` options of the "
|
388
|
+
"L-BFGS-B solver are deprecated and will be removed in "
|
389
|
+
"SciPy 1.18.0.",
|
390
|
+
DeprecationWarning, stacklevel=3)
|
376
391
|
|
377
392
|
# historically old-style bounds were/are expected by lbfgsb.
|
378
393
|
# That's still the case but we'll deal with new-style from here on,
|
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
|
@@ -1126,7 +1126,7 @@ class TestOptimizeSimple(CheckOptimize):
|
|
1126
1126
|
|
1127
1127
|
def test_minimize_l_bfgs_b(self):
|
1128
1128
|
# Minimize with L-BFGS-B method
|
1129
|
-
opts = {'
|
1129
|
+
opts = {'maxiter': self.maxiter}
|
1130
1130
|
r = optimize.minimize(self.func, self.startparams,
|
1131
1131
|
method='L-BFGS-B', jac=self.grad,
|
1132
1132
|
options=opts)
|
@@ -1156,7 +1156,7 @@ class TestOptimizeSimple(CheckOptimize):
|
|
1156
1156
|
# Check that the `ftol` parameter in l_bfgs_b works as expected
|
1157
1157
|
v0 = None
|
1158
1158
|
for tol in [1e-1, 1e-4, 1e-7, 1e-10]:
|
1159
|
-
opts = {'
|
1159
|
+
opts = {'maxiter': self.maxiter, 'ftol': tol}
|
1160
1160
|
sol = optimize.minimize(self.func, self.startparams,
|
1161
1161
|
method='L-BFGS-B', jac=self.grad,
|
1162
1162
|
options=opts)
|
@@ -1173,7 +1173,7 @@ class TestOptimizeSimple(CheckOptimize):
|
|
1173
1173
|
# check that the maxls is passed down to the Fortran routine
|
1174
1174
|
sol = optimize.minimize(optimize.rosen, np.array([-1.2, 1.0]),
|
1175
1175
|
method='L-BFGS-B', jac=optimize.rosen_der,
|
1176
|
-
options={'
|
1176
|
+
options={'maxls': 1})
|
1177
1177
|
assert not sol.success
|
1178
1178
|
|
1179
1179
|
def test_minimize_l_bfgs_b_maxfun_interruption(self):
|