Update dependency scipy to v1.16.1 #241
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.14.1
->1.16.1
Release Notes
scipy/scipy (scipy)
v1.16.1
: SciPy 1.16.1Compare Source
SciPy 1.16.1 Release Notes
SciPy
1.16.1
is a bug-fix release that adds support for Python3.14.0rc1
,including PyPI wheels.
Authors
A total of 12 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
The full issue and pull request lists, and the release asset hashes are available
in the associated
README.txt
file.v1.16.0
: SciPy 1.16.0Compare Source
SciPy 1.16.0 Release Notes
SciPy
1.16.0
is the culmination of 6 months of hard work. It containsmany new features, numerous bug-fixes, improved test coverage and better
documentation. There have been a number of deprecations and API changes
in this release, which are documented below. All users are encouraged to
upgrade to this release, as there are a large number of bug-fixes and
optimizations. Before upgrading, we recommend that users check that
their own code does not use deprecated SciPy functionality (to do so,
run your code with
python -Wd
and check forDeprecationWarning
s).Our development attention will now shift to bug-fix releases on the
1.16.x branch, and on adding new features on the main branch.
This release requires Python
3.11-3.13
and NumPy1.25.2
or greater.Highlights of this release
new support in
scipy.signal
, and additional support inscipy.stats
andscipy.special
. Improved support for JAX and Dask backends has been added,with notable support in
scipy.cluster.hierarchy
, many functions inscipy.special
, and many of the trimmed statistics functions.scipy.optimize
now uses the new Python implementation from thePRIMA
package for COBYLA. The PRIMA implementation fixes many bugsin the old Fortran 77 implementation with a better performance on average.
scipy.sparse.coo_array
now supports n-D arrays with reshaping, arithmetic andreduction operations like sum/mean/min/max. No n-D indexing or
scipy.sparse.random_array
support yet.scipy.linalg
namespace that accept arrayarguments now support N-dimensional arrays to be processed as a batch.
scipy.signal
functions,scipy.signal.firwin_2d
andscipy.signal.closest_STFT_dual_window
, for creation of a 2-D FIR filter andscipy.signal.ShortTimeFFT
dual window calculation, respectively.scipy.spatial.transform.RigidTransform
, provides functionalityto convert between different representations of rigid transforms in 3-D
space.
scipy.ndimage.vectorized_filter
for generic filters thattake advantage of a vectorized Python callable was added.
New features
scipy.io
improvementsscipy.io.savemat
now provides informative warnings for invalid field names.scipy.io.mmread
now provides a clearer error message when provided witha source file path that does not exist.
scipy.io.wavfile.read
can now read non-seekable files.scipy.integrate
improvementsscipy.integrate.tanhsinh
was improved.scipy.interpolate
improvementsscipy.interpolate.make_smoothing_spline
.scipy.linalg
improvementsscipy.linalg
namespace that accept arrayarguments now support N-dimensional arrays to be processed as a batch.
See
linalg_batch
for details.scipy.linalg.sqrtm
is rewritten in C and its performance is improved. Italso tries harder to return real-valued results for real-valued inputs if
possible. See the function docstring for more details. In this version the
input argument
disp
and the optional output argumenterrest
aredeprecated and will be removed four versions later. Similarly, after
changing the underlying algorithm to recursion, the
blocksize
keywordargument has no effect and will be removed two versions later.
?stevd
,?langb
,?sytri
,?hetri
and?gbcon
were added toscipy.linalg.lapack
.scipy.linalg.eigh_tridiagonal
was improved.scipy.linalg.solve
can now estimate the reciprocal condition number andthe matrix norm calculation is more efficient.
scipy.ndimage
improvementsscipy.ndimage.vectorized_filter
for generic filters thattake advantage of a vectorized Python callable was added.
scipy.ndimage.rotate
has improved performance, especially on ARM platforms.scipy.optimize
improvementsPRIMA
package.The PRIMA implementation fixes many bugs
in the old Fortran 77 implementation. In addition, it results in fewer function evaluations on average
but it depends on the problem and for some
problems it can result in more function evaluations or a less optimal
result. For those cases the user can try modifying the initial and final
trust region radii given by
rhobeg
andtol
respectively. A largerrhobeg
can help the algorithm take bigger steps initially, while asmaller
tol
can help it continue and find a better solution.For more information, see the PRIMA documentation.
scipy.optimize.minimize
methods, and thescipy.optimize.least_squares
function, have been given aworkers
keyword. This allows parallelization of some calculations via a map-like
callable, such as
multiprocessing.Pool
. These parallelizationopportunities typically occur during numerical differentiation. This can
greatly speed up minimization when the objective function is expensive to
calculate.
lm
method ofscipy.optimize.least_squares
can now accept3-point
andcs
for thejac
keyword.constraint multipliers are exposed to the user through the
multiplier
keyword of the returned
scipy.optimize.OptimizeResult
object.regression introduced in 1.15.x
scipy.optimize.root
now warns for invalid inner parameters when using thenewton_krylov
methodmethod='L-BFGS-B'
now hasa faster
hess_inv.todense()
implementation. Time complexity has improvedfrom cubic to quadratic.
scipy.optimize.least_squares
has a newcallback
argument that is applicableto the
trf
anddogbox
methods.callback
may be used to trackoptimization results at each step or to provide custom conditions for
stopping.
scipy.signal
improvementsscipy.signal.firwin_2d
for the creation of a 2-D FIR Filterusing the 1-D window method was added.
scipy.signal.cspline1d_eval
andscipy.signal.qspline1d_eval
now providean informative error on empty input rather than hitting the recursion limit.
scipy.signal.closest_STFT_dual_window
to calculate thescipy.signal.ShortTimeFFT
dual window of a given window closest to adesired dual window.
scipy.signal.ShortTimeFFT.from_win_equals_dual
tocreate a
scipy.signal.ShortTimeFFT
instance where the window and its dualare equal up to a scaling factor. It allows to create short-time Fourier
transforms which are unitary mappings.
scipy.signal.convolve2d
was improved.scipy.sparse
improvementsscipy.sparse.coo_array
now supports n-D arrays using binary and reductionoperations.
matmul.
scipy.sparse.csgraph.dijkstra
shortest_path is more efficient.scipy.sparse.csgraph.yen
has performance improvements.sparse.csgraph
andsparse.linalg
wasadded.
scipy.spatial
improvementsscipy.spatial.transform.RigidTransform
, provides functionalityto convert between different representations of rigid transforms in 3-D
space, its application to vectors and transform composition.
It follows the same design approach as
scipy.spatial.transform.Rotation
.scipy.spatial.transform.Rotation
now has an appropriate__repr__
method,and improved performance for its
scipy.spatial.transform.Rotation.apply
method.
scipy.stats
improvementsscipy.stats.quantile
, an array API compatible function forquantile estimation, was added.
scipy.stats.make_distribution
was extended to work with existing discretedistributions and to facilitate the creation of custom distributions in the
new random variable infrastructure.
scipy.stats.Binomial
, was added.equal_var
keyword was added toscipy.stats.tukey_hsd
(enables theGames-Howell test) and
scipy.stats.f_oneway
(enables Welch ANOVA).scipy.stats.gennorm
was improved.scipy.stats.mode
implementation was vectorized, for faster batchcalculation.
axis
,nan_policy
, andkeepdims
keywords was added toscipy.stats.power_divergence
,scipy.stats.chisquare
,scipy.stats.pointbiserialr
,scipy.stats.kendalltau
,scipy.stats.weightedtau
,scipy.stats.theilslopes
,scipy.stats.siegelslopes
,scipy.stats.boxcox_llf
, andscipy.stats.linregress
.keepdims
andnan_policy
keywords was added toscipy.stats.gstd
.scipy.stats.special_ortho_group
andscipy.stats.pearsonr
was improved.
rng
keyword argument was added to thelogcdf
andcdf
methods ofmultivariate_normal_gen
andmultivariate_normal_frozen
.Array API Standard Support
Experimental support for array libraries other than NumPy has been added to
multiple submodules in recent versions of SciPy. Please consider testing
these features by setting the environment variable
SCIPY_ARRAY_API=1
andproviding PyTorch, JAX, CuPy or Dask arrays as array arguments.
Many functions in
scipy.stats
,scipy.special
,scipy.optimize
, andscipy.constants
now provide tables documenting compatible array and devicetypes as well as support for lazy arrays and JIT compilation. New features with
support and old features with support added for SciPy 1.16.0 include:
scipy.signal
functionalityscipy.ndimage.vectorized_filter
scipy.special.stdtrit
scipy.special.softmax
scipy.special.log_softmax
scipy.stats.quantile
scipy.stats.gstd
scipy.stats.rankdata
Features with extended array API support (generally, improved support
for JAX and Dask) in SciPy 1.16.0 include:
scipy.cluster.hierarchy
functionsscipy.special
scipy.stats
SciPy now has a CI job that exercises GPU (CUDA) support, and as a result
using PyTorch, CuPy or JAX arrays on GPU with SciPy is now more reliable.
Deprecated features
atol
argument ofscipy.optimize.nnls
is deprecated and willbe removed in SciPy 1.18.0.
disp
argument ofscipy.linalg.signm
,scipy.linalg.logm
, andscipy.linalg.sqrtm
will be removed in SciPy 1.18.0.scipy.stats.multinomial
now emits aFutureWarning
if the rows ofp
do not sum to
1.0
. This condition will produce NaNs beginning in SciPy1.18.0.
disp
andiprint
arguments of thel-bfgs-b
solver ofscipy.optimize
have been deprecated, and will be removed in SciPy 1.18.0.
Expired Deprecations
scipy.sparse.conjtransp
has been removed. Use.T.conj()
instead.quadrature='trapz'
option has been removed fromscipy.integrate.quad_vec
, andscipy.stats.trapz
has been removed. Usetrapezoid
in both instances instead.scipy.special.comb
andscipy.special.perm
now raise whenexact=True
and arguments are non-integral.
argument
x
has been removed fromscipy.stats.linregress
. The datamust be specified separately as
x
andy
.scipy.stats.power_divergence
andscipy.stats.chisquare
.(e.g.,
scipy.sparse.base
,scipy.interpolate.dfitpack
) were cleanedup. They were previously already emitting deprecation warnings.
Backwards incompatible changes
scipy.linalg
functions for solving a linear system (e.g.scipy.linalg.solve
) documented that the RHS argument must be either 1-D or2-D but did not always raise an error when the RHS argument had more the
two dimensions. Now, many-dimensional right hand sides are treated according
to the rules specified in
linalg_batch
.scipy.stats.bootstrap
now explicitly broadcasts elements ofdata
to thesame shape (ignoring
axis
) before performing the calculation.from scipy.signal import *
,but may still be imported directly, as detailed at scipy/scipy-stubs#549.
Build and packaging related changes
10.13.
from 60 MB to 30 MB.
Cython>=3.1.0
, SciPy now uses the newcython --generate-shared
functionality, which reduces the total size of SciPy's wheels and on-disk
installations significantly.
after
sf_error_state
was removed fromscipy.special
.-Duse-system-libraries
has been added. It allowsopting in to using system libraries instead of using vendored sources.
Currently
Boost.Math
andQhull
are supported as system builddependencies.
Other changes
scipy-stubs
(v1.16.0.0
) isavailable at https://github.com/scipy/scipy-stubs/releases/tag/v1.16.0.0
scipy._lib
onscipy.sparse
was removed,which reduces the import time of a number of other SciPy submodules.
issues in
scipy.special
were fixed, andpytest-run-parallel
is now usedin a CI job to guard against regressions.
spin
as a developerCLI was added, including support for editable installs. The SciPy-specific
python dev.py
CLI will be removed in the next release cycle in favor ofspin
.scipy.special
was moved to the newheader-only
xsf
library. That library wasincluded back in the SciPy source tree as a git submodule.
namedtuple
-like bunch objects returned by some SciPy functionsnow have improved compatibility with the
polars
library.rvs
method ofscipy.stats.wrapcauchy
is now mapped tothe unit circle between 0 and
2 * pi
.lm
method ofscipy.optimize.least_squares
now has a different behaviorfor the maximum number of function evaluations,
max_nfev
. The default forthe
lm
method is changed to100 * n
, for both a callable and anumerically estimated jacobian. This limit on function evaluations excludes
those used for any numerical estimation of the Jacobian. Previously the
default when using an estimated jacobian was
100 * n * (n + 1)
, becausethe method included evaluations used in the estimation. In addition, for the
lm
method the number of function calls used in Jacobian approximationis no longer included in
OptimizeResult.nfev
. This brings the behaviorof
lm
,trf
, anddogbox
into line.Authors
A total of 126 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
Complete issue list, PR list, and release asset hashes are available in the associated
README.txt
.v1.15.3
: SciPy 1.15.3Compare Source
SciPy 1.15.3 Release Notes
SciPy
1.15.3
is a bug-fix release with no new featurescompared to
1.15.2
.For the complete issue and PR lists see the raw release notes.
Authors
A total of 24 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
v1.15.2
: SciPy 1.15.2Compare Source
SciPy 1.15.2 Release Notes
SciPy
1.15.2
is a bug-fix release with no new featurescompared to
1.15.1
. Free-threaded Python3.13
wheelsfor Linux ARM platform are available on PyPI starting with
this release.
Authors
A total of 14 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
v1.15.1
: SciPy 1.15.1Compare Source
SciPy 1.15.1 Release Notes
SciPy
1.15.1
is a bug-fix release with no new featurescompared to
1.15.0
. Importantly, an issue with theimport of
scipy.optimize
breaking other packageshas been fixed.
Authors
A total of 5 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
v1.15.0
: SciPy 1.15.0Compare Source
SciPy 1.15.0 Release Notes
SciPy
1.15.0
is the culmination of6
months of hard work. It containsmany new features, numerous bug-fixes, improved test coverage and better
documentation. There have been a number of deprecations and API changes
in this release, which are documented below. All users are encouraged to
upgrade to this release, as there are a large number of bug-fixes and
optimizations. Before upgrading, we recommend that users check that
their own code does not use deprecated SciPy functionality (to do so,
run your code with
python -Wd
and check forDeprecationWarning
s).Our development attention will now shift to bug-fix releases on the
1.15.x branch, and on adding new features on the main branch.
This release requires Python
3.10-3.13
and NumPy1.23.5
or greater.Highlights of this release
Sparse arrays are now fully functional for 1-D and 2-D arrays. We recommend
that all new code use sparse arrays instead of sparse matrices and that
developers start to migrate their existing code from sparse matrix to sparse
array:
migration_to_sparray
. Bothsparse.linalg
andsparse.csgraph
work with either sparse matrix or sparse array and work internally with
sparse array.
Sparse arrays now provide basic support for n-D arrays in the COO format
including
add
,subtract
,reshape
,transpose
,matmul
,dot
,tensordot
and others. More functionality is coming in futurereleases.
Preliminary support for free-threaded Python 3.13.
New probability distribution features in
scipy.stats
can be used to improvethe speed and accuracy of existing continuous distributions and perform new
probability calculations.
Several new features support vectorized calculations with Python Array API
Standard compatible input (see "Array API Standard Support" below):
scipy.differentiate
is a new top-level submodule for accurateestimation of derivatives of black box functions.
scipy.optimize.elementwise
contains new functions for root-finding andminimization of univariate functions.
scipy.integrate
offers new functionscubature
,tanhsinh
, andnsum
for multivariate integration, univariate integration, andunivariate series summation, respectively.
scipy.interpolate.AAA
adds the AAA algorithm for barycentric rationalapproximation of real or complex functions.
scipy.special
adds new functions offering improved Legendre functionimplementations with a more consistent interface.
New features
scipy.differentiate
introductionThe new
scipy.differentiate
sub-package contains functions for accurateestimation of derivatives of black box functions.
scipy.differentiate.derivative
for first-order derivatives ofscalar-in, scalar-out functions.
scipy.differentiate.jacobian
for first-order partial derivatives ofvector-in, vector-out functions.
scipy.differentiate.hessian
for second-order partial derivatives ofvector-in, scalar-out functions.
All functions use high-order finite difference rules with adaptive (real)
step size. To facilitate batch computation, these functions are vectorized
and support several Array API compatible array libraries in addition to NumPy
(see "Array API Standard Support" below).
scipy.integrate
improvementsscipy.integrate.cubature
function supports multidimensionalintegration, and has support for approximating integrals with
one or more sets of infinite limits.
scipy.integrate.tanhsinh
is now exposed for public use, allowingevaluation of a convergent integral using tanh-sinh quadrature.
scipy.integrate.nsum
evaluates finite and infinite series and theirlogarithms.
scipy.integrate.lebedev_rule
computes abscissae and weights forintegration over the surface of a sphere.
QUADPACK
Fortran77 package has been ported to C.scipy.interpolate
improvementsscipy.interpolate.AAA
adds the AAA algorithm for barycentric rationalapproximation of real or complex functions.
scipy.interpolate.FloaterHormannInterpolator
adds barycentric rationalinterpolation.
scipy.interpolate.make_splrep
andscipy.interpolate.make_splprep
implement construction of smoothing splines.The algorithmic content is equivalent to FITPACK (
splrep
andsplprep
functions, and
*UnivariateSpline
classes) and the user API is consistentwith
make_interp_spline
: these functions receive data arrays and returna
scipy.interpolate.BSpline
instance.scipy.interpolate.generate_knots
implements theFITPACK strategy for selecting knots of a smoothing spline given the
smoothness parameter,
s
. The function exposes the internal logic of knotselection that
splrep
and*UnivariateSpline
was using.scipy.linalg
improvementsscipy.linalg.interpolative
Fortran77 code has been ported to Cython.scipy.linalg.solve
supports several new values for theassume_a
argument, enabling faster computation for diagonal, tri-diagonal, banded, and
triangular matrices. Also, when
assume_a
is left unspecified, thefunction now automatically detects and exploits diagonal, tri-diagonal,
and triangular structures.
scipy.linalg
matrix creation functions (scipy.linalg.circulant
,scipy.linalg.companion
,scipy.linalg.convolution_matrix
,scipy.linalg.fiedler
,scipy.linalg.fiedler_companion
, andscipy.linalg.leslie
) now support batchmatrix creation.
scipy.linalg.funm
is faster.scipy.linalg.orthogonal_procrustes
now supports complex input.scipy.linalg.lapack
:?lantr
,?sytrs
,?hetrs
,?trcon
,and
?gtcon
.scipy.linalg.expm
was rewritten in C.scipy.linalg.null_space
now accepts the new argumentsoverwrite_a
,check_finite
, andlapack_driver
.id_dist
Fortran code was rewritten in Cython.scipy.ndimage
improvementsaxes
argumentthat specifies which axes of the input filtering is to be performed on.
These include
correlate
,convolve
,generic_laplace
,laplace
,gaussian_laplace
,derivative2
,generic_gradient_magnitude
,gaussian_gradient_magnitude
andgeneric_filter
.axes
argument that specifies which axes of the input filtering is to be performed
on.
scipy.ndimage.rank_filter
time complexity has improved fromn
tolog(n)
.scipy.optimize
improvements1.4.0
to1.8.0
,bringing accuracy and performance improvements to solvers.
MINPACK
Fortran77 package has been ported to C.L-BFGS-B
Fortran77 package has been ported to C.scipy.optimize.elementwise
namespace includes functionsbracket_root
,find_root
,bracket_minimum
, andfind_minimum
for root-finding and minimization of univariate functions. To facilitate
batch computation, these functions are vectorized and support several
Array API compatible array libraries in addition to NumPy (see
"Array API Standard Support" below). Compared to existing functions (e.g.
scipy.optimize.root_scalar
andscipy.optimize.minimize_scalar
),these functions can offer speedups of over 100x when used with NumPy arrays,
and even greater gains are possible with other Array API Standard compatible
array libraries (e.g. CuPy).
scipy.optimize.differential_evolution
now supports more general use ofworkers
, such as passing a map-like callable.scipy.optimize.nnls
was rewritten in Cython.HessianUpdateStrategy
now supports__matmul__
.scipy.signal
improvementssignal.chirp()
.scipy.signal.lombscargle
has two new arguments,weights
andfloating_mean
, enabling sample weighting and removal of an unknowny-offset independently for each frequency. Additionally, the
normalize
argument includes a new option to return the complex representation of the
amplitude and phase.
scipy.signal.envelope
for computation of the envelope of areal or complex valued signal.
scipy.sparse
improvementsmoving from sparse.matrix to sparse.array in your code/library.
arrays are now fully functional for 1-D and 2D.
for basic arithmetic.
sparse.linalg.is_sptriangular
andsparse.linalg.spbandwidth
mimic the existing dense toolslinalg.is_triangular
andlinalg.bandwidth
.sparse.linalg
andsparse.csgraph
now work with sparse arrays. Becareful that your index arrays are 32-bit. We are working on 64bit support.
ARPACK
library has been upgraded to version3.9.1
.axis
argument forcount_nonzero
.incompatible data types, such as
float16
.min
,max
,argmin
, andargmax
now support computationover nonzero elements only via the new
explicit
argument.get_index_dtype
andsafely_cast_index_arrays
areavailable to facilitate index array casting in
sparse
.scipy.spatial
improvementsRotation.concatenate
now accepts a bareRotation
object, and willreturn a copy of it.
scipy.special
improvementsNew functions offering improved Legendre function implementations with a
more consistent interface. See respective docstrings for more information.
scipy.special.legendre_p
,scipy.special.legendre_p_all
scipy.special.assoc_legendre_p
,scipy.special.assoc_legendre_p_all
scipy.special.sph_harm_y
,scipy.special.sph_harm_y_all
scipy.special.sph_legendre_p
,scipy.special.sph_legendre_p_all
,The factorial functions
special.{factorial,factorial2,factorialk}
nowoffer an extension to the complex domain by passing the kwarg
extend='complex'
. This is opt-in because it changes the values fornegative inputs (which by default return 0), as well as for some integers
(in the case of
factorial2
andfactorialk
; for more details,check the respective docstrings).
scipy.special.zeta
now defines the Riemann zeta function on the complexplane.
scipy.special.softplus
computes the softplus functionThe spherical Bessel functions (
scipy.special.spherical_jn
,scipy.special.spherical_yn
,scipy.special.spherical_in
, andscipy.special.spherical_kn
) now support negative arguments with real dtype.scipy.special.logsumexp
now preserves precision when one element of thesum has magnitude much bigger than the rest.
The accuracy of several functions has been improved:
scipy.special.ncfdtr
,scipy.special.nctdtr
, andscipy.special.gdtrib
have been improved throughout the domain.scipy.special.hyperu
is improved for the case ofb=1
, smallx
,and small
a
.scipy.special.logit
is improved near the argumentp=0.5
.scipy.special.rel_entr
is improved whenx/y
overflows, underflows,or is close to
1
.scipy.special.ndtr
is now more efficient forsqrt(2)/2 < |x| < 1
.scipy.stats
improvementsA new probability distribution infrastructure has been added for the
implementation of univariate, continuous distributions. It has several
speed, accuracy, memory, and interface advantages compared to the
previous infrastructure. See
rv_infrastructure
for a tutorial.scipy.stats.make_distribution
to treat an existing continuousdistribution (e.g.
scipy.stats.norm
) with the new infrastructure.This can improve the speed and accuracy of existing distributions,
especially those with methods not overridden with distribution-specific
formulas.
scipy.stats.Normal
andscipy.stats.Uniform
are pre-defined classesto represent the normal and uniform distributions, respectively.
Their interfaces may be faster and more convenient than those produced by
make_distribution
.scipy.stats.Mixture
can be used to represent mixture distributions.Instances of
scipy.stats.Normal
,scipy.stats.Uniform
, and the classesreturned by
scipy.stats.make_distribution
are supported by several newmathematical transformations.
scipy.stats.truncate
for truncation of the support.scipy.stats.order_statistic
for the order statistics of a given numberof IID random variables.
scipy.stats.abs
,scipy.stats.exp
, andscipy.stats.log
. For example,scipy.stats.abs(Normal())
is distributed according to the folded normaland
scipy.stats.exp(Normal())
is lognormally distributed.The new
scipy.stats.lmoment
calculates sample l-moments and l-momentratios. Notably, these sample estimators are unbiased.
scipy.stats.chatterjeexi
computes the Xi correlation coefficient, whichcan detect nonlinear dependence. The function also performs a hypothesis
test of independence between samples.
scipy.stats.wilcoxon
has improved method resolution logic for the defaultmethod='auto'
. Other values ofmethod
provided by the user are nowrespected in all cases, and the method argument
approx
has beenrenamed to
asymptotic
for consistency with similar functions. (Use ofapprox
is still allowed for backward compatibility.)There are several new probability distributions:
scipy.stats.dpareto_lognorm
represents the double Pareto lognormaldistribution.
scipy.stats.landau
represents the Landau distribution.scipy.stats.normal_inverse_gamma
represents the normal-inverse-gammadistribution.
scipy.stats.poisson_binom
represents the Poisson binomial distribution.Batch calculation with
scipy.stats.alexandergovern
andscipy.stats.combine_pvalues
is faster.scipy.stats.chisquare
added an argumentsum_check
. By default, thefunction raises an error when the sum of expected and obseved frequencies
are not equal; setting
sum_check=False
disables this check tofacilitate hypothesis tests other than Pearson's chi-squared test.
The accuracy of several distribution methods has been improved, including:
scipy.stats.nct
methodpdf
scipy.stats.crystalball
methodsf
scipy.stats.geom
methodrvs
scipy.stats.cauchy
methodslogpdf
,pdf
,ppf
andisf
logcdf
and/orlogsf
methods of distributions that do notoverride the generic implementation of these methods, including
scipy.stats.beta
,scipy.stats.betaprime
,scipy.stats.cauchy
,scipy.stats.chi
,scipy.stats.chi2
,scipy.stats.exponweib
,scipy.stats.gamma
,scipy.stats.gompertz
,scipy.stats.halflogistic
,scipy.stats.hypsecant
,scipy.stats.invgamma
,scipy.stats.laplace
,scipy.stats.levy
,scipy.stats.loggamma
,scipy.stats.maxwell
,scipy.stats.nakagami
, andscipy.stats.t
.scipy.stats.qmc.PoissonDisk
now accepts lower and upper boundsparameters
l_bounds
andu_bounds
.scipy.stats.fisher_exact
now supports two-dimensional tables with shapesother than
(2, 2)
.Preliminary Support for Free-Threaded CPython 3.13
SciPy
1.15
has preliminary support for the free-threaded build of CPython3.13.
This allows SciPy functionality to execute in parallel with Pythonthreads
(see the
threading
stdlib module). This support was enabled by fixing asignificant number of thread-safety issues in both pure Python and
C/C++/Cython/Fortran extension modules. Wheels are provided on PyPI for this
release; NumPy
>=2.1.3
is required at runtime. Note that building for afree-threaded interpreter requires a recent pre-release or nightly for Cython
3.1.0
.Support for free-threaded Python does not mean that SciPy is fully thread-safe.
Please see
scipy_thread_safety
for more details.If you are interested in free-threaded Python, for example because you have a
multiprocessing-based workflow that you are interested in running with Python
threads, we encourage testing and experimentation. If you run into problems
that you suspect are because of SciPy, please open an issue, checking first if
the bug also occurs in the "regular" non-free-threaded CPython
3.13
build.Many threading bugs can also occur in code that releases the GIL; disabling
the GIL only makes it easier to hit threading bugs.
Array API Standard Support
Experimental support for array libraries other than NumPy has been added to
existing sub-packages in recent versions of SciPy. Please consider testing
these features by setting an environment variable
SCIPY_ARRAY_API=1
andproviding PyTorch, JAX, ndonnx, or CuPy arrays as array arguments. Features
with support added for SciPy
1.15.0
include:scipy.differentiate
(new sub-package)scipy.optimize.elementwise
(new namespace)scipy.optimize.rosen
,scipy.optimize.rosen_der
, andscipy.optimize.rosen_hess
scipy.special.logsumexp
scipy.integrate.trapezoid
scipy.integrate.tanhsinh
(newly public function)scipy.integrate.cubature
(new function)scipy.integrate.nsum
(new function)scipy.special.chdtr
,scipy.special.betainc
, andscipy.special.betaincc
scipy.stats.boxcox_llf
scipy.stats.differential_entropy
scipy.stats.zmap
,scipy.stats.zscore
, andscipy.stats.gzscore
scipy.stats.tmean
,scipy.stats.tvar
,scipy.stats.tstd
,scipy.stats.tsem
,scipy.stats.tmin
, andscipy.stats.tmax
scipy.stats.gmean
,scipy.stats.hmean
andscipy.stats.pmean
scipy.stats.combine_pvalues
scipy.stats.ttest_ind
,scipy.stats.ttest_rel
scipy.stats.directional_stats
scipy.ndimage
functions will now delegate tocupyx.scipy.ndimage
,and for other backends will transit via NumPy arrays on the host.
Deprecated features and future changes
scipy.linalg.interpolative.rand
andscipy.linalg.interpolative.seed
have been deprecated and will be removedin SciPy
1.17.0
.scipy.spatial.distance.cosine
andscipy.spatial.distance.correlation
have been deprecated and will raisean error in SciPy
1.17.0
.scipy.spatial.distance.kulczynski1
andscipy.spatial.distance.sokalmichener
were deprecated and will be removedin SciPy
1.17.0
.scipy.stats.find_repeats
is deprecated and will beremoved in SciPy
1.17.0
. Please usenumpy.unique
/numpy.unique_counts
instead.scipy.linalg.kron
is deprecated in favour ofnumpy.kron
.scipy.signal
convolution/correlation functions (
scipy.signal.correlate
,scipy.signal.convolve
andscipy.signal.choose_conv_method
) andfiltering functions (
scipy.signal.lfilter
,scipy.signal.sosfilt
) hasbeen deprecated and will be removed in SciPy
1.17.0
.scipy.stats.linregress
has deprecated one-argument use; the twovariables must be specified as separate arguments.
scipy.stats.trapz
is deprecated in favor ofscipy.stats.trapezoid
.scipy.special.lpn
is deprecated in favor ofscipy.special.legendre_p_all
.scipy.special.lpmn
andscipy.special.clpmn
are deprecated in favor ofscipy.special.assoc_legendre_p_all
.scipy.special.sph_harm
has been deprecated in favor ofscipy.special.sph_harm_y
.r
andc
arrays passed toscipy.linalg.toeplitz
,scipy.linalg.matmul_toeplitz
, orscipy.linalg.solve_toeplitz
will betreated as batches of 1-D coefficients beginning in SciPy
1.17.0
.random_state
andpermutations
arguments ofscipy.stats.ttest_ind
are deprecated. Usemethod
to perform apermutation test, instead.
Expired Deprecations
scipy.signal
have been removed. This includesdaub
,qmf
,cascade
,morlet
,morlet2
,ricker
,and
cwt
. Users should usepywavelets
instead.scipy.signal.cmplx_sort
has been removed.scipy.integrate.quadrature
andscipy.integrate.romberg
have beenremoved in favour of
scipy.integrate.quad
.scipy.stats.rvs_ratio_uniforms
has been removed in favor ofscipy.stats.sampling.RatioUniforms
.scipy.special.factorial
now raises an error for non-integer scalars whenexact=True
.scipy.integrate.cumulative_trapezoid
now raises an error for values ofinitial
other than0
andNone
.scipy.interpolate.Akima1DInterpolator
and
scipy.interpolate.PchipInterpolator
special.btdtr
andspecial.btdtri
have been removed.exact=
kwarg inspecial.factorialk
has changedfrom
True
toFalse
.scipy.misc
submodule have been removed.Backwards incompatible changes
interpolate.BSpline.integrate
output is now always a numpy array.Previously, for 1D splines the output was a python float or a 0D array
depending on the value of the
extrapolate
argument.scipy.stats.wilcoxon
now respects themethod
argument provided by theuser. Previously, even if
method='exact'
was specified, the functionwould resort to
method='approx'
in some cases.scipy.integrate.AccuracyWarning
has been removed as the functions thewarning was emitted from (
scipy.integrate.quadrature
andscipy.integrate.romberg
) have been removed.Other changes
A separate accompanying type stubs package,
scipy-stubs
, will be madeavailable with the
1.15.0
release. Installation instructions areavailable.
scipy.stats.bootstrap
now emits aFutureWarning
if the shapes of theinput arrays do not agree. Broadcast the arrays to the same batch shape
(i.e. for all dimensions except those specified by the
axis
argument)to avoid the warning. Broadcasting will be performed automatically in the
future.
SciPy endorsed SPEC-7,
which proposes a
rng
argument to control pseudorandom number generation(PRNG) in a standard way, replacing legacy arguments like
seed
andrandom_sate
. In many cases, use ofrng
will change the behavior ofthe function unless the argument is already an instance of
numpy.random.Generator
.Effective in SciPy
1.15.0
:rng
argument has been added to the following functions:scipy.cluster.vq.kmeans
,scipy.cluster.vq.kmeans2
,scipy.interpolate.BarycentricInterpolator
,scipy.interpolate.barycentric_interpolate
,scipy.linalg.clarkson_woodruff_transform
,scipy.optimize.basinhopping
,scipy.optimize.differential_evolution
,scipy.optimize.dual_annealing
,scipy.optimize.check_grad
,scipy.optimize.quadratic_assignment
,scipy.sparse.random
,scipy.sparse.random_array
,scipy.sparse.rand
,scipy.sparse.linalg.svds
,scipy.spatial.transform.Rotation.random
,scipy.spatial.distance.directed_hausdorff
,scipy.stats.goodness_of_fit
,scipy.stats.BootstrapMethod
,scipy.stats.PermutationMethod
,scipy.stats.bootstrap
,scipy.stats.permutation_test
,scipy.stats.dunnett
, allscipy.stats.qmc
classes that consume random numbers, andscipy.stats.sobol_indices
.rng
argument will follow the SPEC 7standard behavior: the argument will be normalized with
np.random.default_rng
before being used.will remain unchanged (for now).
It is planned that in
1.17.0
the legacy argument will start emittingwarnings, and that in
1.19.0
the default behavior will change.In all cases, users can avoid future disruption by proactively passing
an instance of
np.random.Generator
by keywordrng
. For details,see SPEC-7.
The SciPy build no longer adds
-std=legacy
for Fortran code,except when using Gfortran. This avoids problems with the new Flang and
AMD Fortran compilers. It may make new build warnings appear for other
compilers - if so, please file an issue.
scipy.signal.sosfreqz
has been renamed toscipy.signal.freqz_sos
.New code should use the new name. The old name is maintained as an alias for
backwards compatibility.
Testing thread-safety improvements related to Python
3.13t
have beenmade in:
scipy.special
,scipy.spatial
,scipy.sparse
,scipy.interpolate
.Authors (commits)
A total of 149 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.