SciPy 1.18.0 Release Notes
note: SciPy 1.18.0 is not released yet!
SciPy 1.18.0 is the culmination of 6 months of hard work. It contains
many 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 for DeprecationWarning s).
Our development attention will now shift to bug-fix releases on the
1.18.x branch, and on adding new features on the main branch.
This release requires Python 3.12-3.14 and NumPy 2.0.0 or greater.
Highlights of this release
- SciPy now supports three different build modes for BLAS and LAPACK
LP64/ILP64 support, and machinery is provided for downstreamcython_lapack
consumers to gracefully handle LP64/ILP64 backend builds. ILP64 support
has been substantially improved across the SciPy library. - Remaining Fortran to C translations have been completed---an experimental
Fortran-free build option is now available to developers for testing
purposes. Developer feedback is welcome on Fortran-free builds. scipy.signal.whittaker_hendersonnow provides access to Whittaker-Henderson
smoothing of a discrete signal.- A large number of
scipy.statsfunctions now support lazy arrays and JAX
JIT. Array API support has been improved substantially in SciPy, with at least
21 functions gaining new support in this release. 16scipy.statsfunctions
have also gained support for MArray input.
New features
scipy.fft improvements
- SciPy's internal FFT backend has switched from
pocketfftto its
successor packageducc0.fft, which features several incremental
improvements. The most significant of those from SciPy's perspective is
probably that storage requirements for internally cached plans have been
significantly reduced for most long 1D transforms. Plans that require more
storage than 1MB will no longer be cached; this mainly affects huge 1D
transforms of prime and near-prime sizes.
scipy.interpolate improvements
- Users may now increase the QHull simplex assignment tolerance via the new
simplex_toleranceargument to the_call__methods of
LinearNDInterpolatorandCloughTocher2dInterpolator. This can
help users avoid holes in certain interpolation problems. - The FITPACK Fortran code has been ported to C.
scipy.differentiate improvements
scipy.differentiate.derivativenow supports passingkwargsto the
function whose derivative is desired.
scipy.linalg improvements
- We now support three different build modes for BLAS and LAPACK: LP64-only,
ILP64-only, and ILP64 for everyting exceptcython_blas/cython_lapack/
linalg.blas/linalg.lapack(support for Accelerate and MKL). - Machinery is now provided for downstream
cython_lapackusers to gracefully
handle LP64/ILP64 backend builds. Worked examples, including build system
details, have been included in this release. - An
overwrite_bkeyword argument was added toeigvals, for consistency
with other similarlinalgfunctions. linalg.choleskynow leverages symmetry properties for performance
improvements, especially for real matrices. The batching loop ofcholesky
has now also been moved to a C implementation.scipy.linalg.luandscipy.linalg.dethave been rewritten in C++ with
batching support in the compiled code.- Added ILP64 support to
scipy.linalg.expmandscipy.linalg.sqrtm. - The batching loops of
scipy.linalg.qr,scipy.linalg.eig,
scipy.linalg.lstsq, andscipy.linalg.svdhave been moved to C,
providing a substantial speedup for batched input. - The performance of
scipy.linalg.expmhas been improved. - The performance for
scipy.linalg.solvehas improved for batched inputs.
scipy.optimize improvements
- The
trust_constrmethod forminimizewas adjusted so that if thex
array would result in infeasible constraints, and those constraints were
marked askeep_feasible, then the objective function is not called with
thatxarray. - The
COBYQAmethod forminimizenow supports being called
concurrently by multiple threads. Previously, multiple threads calling this
function would only run one at a time. scipy.optimize.nnls, andminimizemethodsSLSQPandL-BFGS-B
now have support for ILP64 LAPACK, when available.- Functions in
scipy.optimize.elementwisenow support passingkwargs
to the callable function.
scipy.signal improvements
- The new
~scipy.signal.whittaker_hendersonimplements Whittaker-Henderson smoothing
of a discrete signal. It offers different penalties to control the smoothness as well
as automatic selection of the penalty strength via optimization of the restricted
maximum likelihood (REML) criterion.
It is a valuable alternative for the Savitzky-Golay filter
~scipy.signal.savgol_filter.
In econometrics, Whittaker-Henderson graduation of penalty order 2 is also known as
Hodrick-Prescott filter. lfilter_ziwas refactored for improved numerical stability and
efficiency. It now raises aValueErrorif parameterahas leading
zeros, i.e.,a[0] == 0, sincelfilterandfiltfiltdo not support
that as well. Furthermore, aValueErrorinstead of aLinAlgErroris
raised if the filter is unstable due to having a pole atz = 1.
scipy.sparse improvements
- In
scipy.sparse.csgraphthe computation of strongly connected components
for directed graphs is now 2x faster with better cache locality, using
algorithmic improvements described in the recent survey by Tarjan and Zwick. - Added ILP64 BLAS/LAPACK support to SuperLU and PROPACK extensions.
- All sparse array/matrix formats now support
matrix_transpose/.mT. - Support for n-dimensional linear operators has been added to
scipy.sparse.linalg.LinearOperator. scipy.sparse.linalg.minresnow supports complex hermitian matrices.
scipy.integrate improvements
- ILP64 support was added for ODEPACK
scipy.integrate.tanhsinhandscipy.integrate.nsumnow support passing
kwargsto the function to be integrated.
scipy.spatial improvements
- 3D area calculations are now faster in
scipy.spatial.SphericalVoronoi. - N-dimensional input is now supported for
scipy.spatial.distance.minkowski,
scipy.spatial.distance.euclidean, andscipy.spatial.distance.seuclidean. - It is now possible to return sparse arrays rather than matrices from
KDTree.sparse_distance_matrix. - It is now possible to compose
RotationandRigidTransformdirectly,
by automatically promotingRotationwhen the two are composed via
a multiplication operator.
scipy.special improvements
- The accuracy of the following functions was improved:
scipy.special.bdtrik,
scipy.special.bdtrin,scipy.special.nbdtrik,scipy.special.nbdtrin. - The numerical behavior for
scipy.special.eval_jacobihas been improved
for several parameter combinations. - The Bessel functions
scipy.special.j0andscipy.special.y0
have improved accuracy for large arguments.
scipy.stats improvements
- The accuracy of
scipy.stats.pmeanwith tiny, nonzerophas been
improved. - The performance of
scipy.stats.halfgennormhas been improved. zstatistichas been added to the result object of
scipy.stats.mannwhitneyu.- A large number of
statsfunctions now support lazy arrays and JAX
JIT (see Python Array API support section below). - Support for the
nan_policykeyword argument has been added to:
scipy.stats.obrientransform,scipy.stats.boxcox,
scipy.stats.boxcox_normmax,scipy.stats.yeojohnson,
scipy.stats.yeojohnson_normmax, andscipy.stats.sigmaclip. scipy.stats.ContinuousDistribution.lmomenthas been added for computing
population L-moments.
Python Array API Standard Support
- Support has been added for CuPy delegation for:
interpolate.PPoly,
interpolate.BPoly, andinterpolate.BSpline. - CuPy support has been added for
scipy.stats.rankdata. - Array API support has been added for
methodandtrimusage
inscipy.stats.ttest_ind. - Support for MArrays has been added to:
scipy.stats.cramervonmises,
scipy.stats.ks_1samp,scipy.stats.ks_2samp,scipy.stats.mode,
scipy.stats.rankdata,scipy.stats.kruskal,scipy.stats.brunnermunzel,
scipy.stats.spearmanrho,scipy.stats.friedmanchisquare,
scipy.stats.cramervonmises_2samp,scipy.stats.mannwhitneyu,
scipy.stats.wilcoxon,scipy.stats.fligner,scipy.stats.linregress,
scipy.stats.alexandergovern, andscipy.stats.levene. - Array API support has been added to:
scipy.stats.quantile_test,
scipy.stats.kendalltau(via NumPy conversion),scipy.stats.kstest,
scipy.sparse.linalg.LinearOperator,scipy.stats.cumfreq,
scipy.stats.relfreq,scipy.stats.ks_2samp,scipy.stats.theilslopes,
scipy.stats.siegelslopes,scipy.stats.obrientransform(including marray),
scipy.stats.binomtest,scipy.integrate.fixed_quad,scipy.signal.square,
scipy.stats.expectile,scipy.stats.shapiro,scipy.stats.pointbiserialr,
scipy.stats.bws_test,scipy.stats.estimated_cdf(new function),
scipy.stats.linregress,scipy.integrate.simpson, and
scipy.signal.sawtooth. - The
torchsupport forscipy.signal.fftconvolvenow correctly
handles thefloat32dtype. - JAX JIT support has been added for:
scipy.stats.binomtest
(except formethod='two-sided'),scipy.stats.mannwhitneyu
(except formethod='auto'),scipy.stats.lmoment,scipy.stats.moment,
scipy.stats.ansari(related to newmethodargument),
scipy.stats.yeojohnson_llf,scipy.stats.epps_singleton_2samp,
scipy.stats.wilcoxon(except formethod='exact'andmethod='auto'),
scipy.stats.rankdata(via delegation),scipy.signal.oaconvolve,
scipy.signal.hilbert, andscipy.signal.hilbert2.
Deprecated features and future changes
- passing
lworkparameter toscipy.linalg.qrhas been deprecated. The
functionality was rarely used; the function computes the optimal size of the
work arrays automatically, therefore users should simply remove their uses
of thelworkparameter. - The sparse construction functions
kron,kronsumandbuild_diag
choose return typesparrayorspmatrixdepending on the type of the
sparse input arrays. When no inputs are sparse, the output is chosen to be
spmatrix. That has been deprecated. The return type when no inputs are
sparse will be changing tosparray. You can control the output type by
ensuring that at least one input array is sparse. If any aresparray,
the output will besparray. If all sparse inputs arespmatrix,
the output will bespmatrix. - A
FutureWarningis now issued for calling{r}matvecon column vectors
withLinearOperator. Identical behavior can be achieved (and extended to
batch dimensions) via{r}matmat. scipy.linalgfunctions are now stricter--using non-LAPACK dtypes is
deprecated. When the deprecations expire, this will effectively limit the
dtypes allowed in linear algebra functions to: integers (upcast to float),
and single/double precision float/complex dtypes.scipy.spatial.minkowsi_distance,scipy.spatial.minkowsi_distance_p,
andscipy.spatial.distance_matrixhave been deprecated in favor of
other superior functions.scipy.spatial.tsearchhas been deprecated because it duplicates functionality
more conveniently provided within theDelaunayclass proper.- The following functions have been deprecated because they were deemed
not practically useful:scipy.interpolate.pade,scipy.interpolate.lagrange,
andscipy.interpolate.approximate_taylor_polynomial. - Setting
spmatrix=Truefor thescipy.ioreadersmmio,FFM,hb,
andmatlab/_miois now deprecated, including when set as the default
value. - The unintentionally public
scipy.cluster.vq.py_vqhas been deprecated.
Backwards incompatible changes
- The output of
scipy.stats.rankdatais now always of a floating point
dtype -- the result dtype of the input and a Pythonfloat. - The behavior of the
residualsreturned byscipy.linalg.lstsqhas been
changed. Forlapack_driver == "gelsy"or the system being either
underdetermined or square, empty residuals are still returned. For
lapack_driver == "gesld"/"gelss"in combination with an overdetermined
system a non-empty residual is always returned. However, in the case where a
slice is not full column rank, the corresponding residual is set toNaN. - The 2nd output object of
scipy.stats.contingency.crosstabwhen kwarg
sparse=Trueis now a sparse array holding the counts instead of a sparse
matrix. This allows it to be nD, so can accept more than 2 sequences as
inputs, but it is a different class. Most operations work the same for
sparse arrays and matrixes with notable differences for matrix:*means
matmul and always-2D. For more info seemigration_to_sparray. scipy.stats.obrientransformnow returns a tuple of arrays instead of
a singlendarray.scipy.stats.multinomialnow returns NaNs when the category probability
(p) rows/arrays do not sum to unity. This is an expiration of the deprecated
behavior of adjusting the final element in theparray to compensate.
Note thatmultinomial.rvswill now raise an error in such cases, since it
has an integral return type.- The
iprintanddispparameters ofscipy.optimize.fmin_l_bfgs_b
have been removed, following the expiry of their deprecation. - For
scipy.linalg.{sqrtm, logm, signm},disp(andsqrtm
blocksize) parameters were removed (expired deprecations). - The deprecated
atolargument ofscipy.optimize.nnlshas been
removed.
Other changes
- The vendored
Boost.Mathwas updated from1.89.0to1.91.0. - SciPy now has a Pixi package definition, allowing developers to easily build
SciPy from source inside Pixi workspaces. - Developers may be interested in the private build option
_without-fortran,
which allows building SciPy from source in the absence of a Fortran compiler.
This is an early prototype of the planned capability of a Fortran-free
SciPy. - The private
scipy.interpolate._regridfunction may be of experimental
interest. It provides an interface for 2-D smoothing B-spline fitting via
separable 1-D FITPACK kernels. It is under consideraton for public exposure
in some form in the future.
Authors
- Name (commits)
- Joseph Adams (1) +
- Adrián Raso González (1) +
- Virgile Andreani (1)
- AshwathElang0 (1) +
- Mart-Mihkel Aun (1) +
- BarnikRB (2) +
- Richie Bendall (1) +
- J Berg (7) +
- Florian Bourgey (50)
- Jake Bowhay (98)
- Jonathan Brodrick (1) +
- Dietrich Brunn (36)
- Evgeni Burovski (200)
- Matthias Bussonnier (6)
- CJ Carey (9)
- Christine P. Chai (2)
- Lucas Colley (89)
- Dan (3) +
- devdanzin (2) +
- Martin Diehl (4)
- Sam Dolat (2) +
- dphipps-qnx (1) +
- DWesl (2)
- efrat99 (3) +
- fbrandt (1) +
- August Femtehjell (2) +
- Matthew H Flamm (1)
- Juan Flores (1) +
- foreverallama (1) +
- fumoboy007 (4) +
- John Patrick Gallagher (1) +
- Wei Bo Gao (1) +
- Christoph Gohlke (1)
- Nathan Goldbaum (20)
- Ludmila Golomozin (11) +
- Ralf Gommers (172)
- Mathieu Guay-Paquet (1) +
- Matt Haberland (147)
- Joren Hammudoglu (24)
- Jacob Hass (4)
- Maya Horii (1) +
- Guido Imperiale (1)
- Jan Möseritz-Schmidt (2)
- Leo Ji (4) +
- JOD (2) +
- Aditya Kamath (2) +
- Mukunda Rao Katta (1) +
- Robert Kern (1)
- Ria Khatoniar (1) +
- Matthias Koeppe (1)
- krishneetRAJ (1) +
- Iason Krommydas (1) +
- Eric Larson (1)
- Basil Liekens (31) +
- lnzwz (2) +
- Christian Lorentzen (15)
- Alex Lubbock (1) +
- Echedey Luis (2) +
- Lunyxis (1) +
- Zhang Maiyun (1) +
- Diego Medina Medina (1) +
- Elle Musoke (11) +
- Andrew Nelson (102)
- Nick ODell (28)
- Dimitri Papadopoulos Orfanos (1)
- partev (1)
- Matti Picus (7)
- Ilhan Polat (190)
- Adrian Raso (3)
- Aditya Rawat (1) +
- Tyler Reddy (94)
- Martin Reinecke (1)
- Lucas Roberts (6)
- Pamphile Roy (1)
- Daniel Schmitz (26)
- Martin Schuck (4)
- Dan Schult (47)
- Scott Shambaugh (16)
- Sabaa Siddique (1) +
- Nicholas Smith (1) +
- Johannes F. Sommerfeldt (1) +
- SpookyYomo (2) +
- Albert Steppi (80)
- Charalampos Stratakis (16) +
- Taylor (1) +
- thecaptain789 (1) +
- Adam Turner (1)
- Christian Veenhuis (2)
- Sebastiano Vigna (1)
- Rivka Walles (14) +
- Warren Weckesser (10)
- Soeren Wolfers (1) +
- wongaokay (1) +
- Xuefeng Xu (1)
- Aniket Singh Yadav (2) +
- yaochengchen (2) +
- Fadi Younes (2) +
- Isaiah Zimmerman (1) +
- Simon Zwieback (1) +
- ਗਗਨਦੀਪ ਸਿੰਘ (Gagandeep Singh) (19)
A total of 100 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.
Note that the source and binary assets associated with this release candidate were published to PyPI using trusted publishing, and so the trusted assets and their hashes are made available more securely at https://pypi.org/project/scipy/1.18.0rc1/ rather than providing them here in a less secure manner.