pypi scipy 1.18.0rc1
SciPy 1.18.0rc1

4 hours ago

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 downstream cython_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_henderson now provides access to Whittaker-Henderson
    smoothing of a discrete signal.
  • A large number of scipy.stats functions 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. 16 scipy.stats functions
    have also gained support for MArray input.

New features

scipy.fft improvements

  • SciPy's internal FFT backend has switched from pocketfft to its
    successor package ducc0.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_tolerance argument to the _call__ methods of
    LinearNDInterpolator and CloughTocher2dInterpolator. This can
    help users avoid holes in certain interpolation problems.
  • The FITPACK Fortran code has been ported to C.

scipy.differentiate improvements

  • scipy.differentiate.derivative now supports passing kwargs to 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 except cython_blas/cython_lapack/
    linalg.blas/linalg.lapack (support for Accelerate and MKL).
  • Machinery is now provided for downstream cython_lapack users to gracefully
    handle LP64/ILP64 backend builds. Worked examples, including build system
    details, have been included in this release.
  • An overwrite_b keyword argument was added to eigvals, for consistency
    with other similar linalg functions.
  • linalg.cholesky now leverages symmetry properties for performance
    improvements, especially for real matrices. The batching loop of cholesky
    has now also been moved to a C implementation.
  • scipy.linalg.lu and scipy.linalg.det have been rewritten in C++ with
    batching support in the compiled code.
  • Added ILP64 support to scipy.linalg.expm and scipy.linalg.sqrtm.
  • The batching loops of scipy.linalg.qr, scipy.linalg.eig,
    scipy.linalg.lstsq, and scipy.linalg.svd have been moved to C,
    providing a substantial speedup for batched input.
  • The performance of scipy.linalg.expm has been improved.
  • The performance for scipy.linalg.solve has improved for batched inputs.

scipy.optimize improvements

  • The trust_constr method for minimize was adjusted so that if the x
    array would result in infeasible constraints, and those constraints were
    marked as keep_feasible, then the objective function is not called with
    that x array.
  • The COBYQA method for minimize now supports being called
    concurrently by multiple threads. Previously, multiple threads calling this
    function would only run one at a time.
  • scipy.optimize.nnls, and minimize methods SLSQP and L-BFGS-B
    now have support for ILP64 LAPACK, when available.
  • Functions in scipy.optimize.elementwise now support passing kwargs
    to the callable function.

scipy.signal improvements

  • The new ~scipy.signal.whittaker_henderson implements 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_zi was refactored for improved numerical stability and
    efficiency. It now raises a ValueError if parameter a has leading
    zeros, i.e., a[0] == 0, since lfilter and filtfilt do not support
    that as well. Furthermore, a ValueError instead of a LinAlgError is
    raised if the filter is unstable due to having a pole at z = 1.

scipy.sparse improvements

  • In scipy.sparse.csgraph the 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.minres now supports complex hermitian matrices.

scipy.integrate improvements

  • ILP64 support was added for ODEPACK
  • scipy.integrate.tanhsinh and scipy.integrate.nsum now support passing
    kwargs to 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, and scipy.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 Rotation and RigidTransform directly,
    by automatically promoting Rotation when 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_jacobi has been improved
    for several parameter combinations.
  • The Bessel functions scipy.special.j0 and scipy.special.y0
    have improved accuracy for large arguments.

scipy.stats improvements

  • The accuracy of scipy.stats.pmean with tiny, nonzero p has been
    improved.
  • The performance of scipy.stats.halfgennorm has been improved.
  • zstatistic has been added to the result object of
    scipy.stats.mannwhitneyu.
  • A large number of stats functions now support lazy arrays and JAX
    JIT (see Python Array API support section below).
  • Support for the nan_policy keyword argument has been added to:
    scipy.stats.obrientransform, scipy.stats.boxcox,
    scipy.stats.boxcox_normmax, scipy.stats.yeojohnson,
    scipy.stats.yeojohnson_normmax, and scipy.stats.sigmaclip.
  • scipy.stats.ContinuousDistribution.lmoment has been added for computing
    population L-moments.

Python Array API Standard Support

  • Support has been added for CuPy delegation for: interpolate.PPoly,
    interpolate.BPoly, and interpolate.BSpline.
  • CuPy support has been added for scipy.stats.rankdata.
  • Array API support has been added for method and trim usage
    in scipy.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, and scipy.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 torch support for scipy.signal.fftconvolve now correctly
    handles the float32 dtype.
  • JAX JIT support has been added for: scipy.stats.binomtest
    (except for method='two-sided'), scipy.stats.mannwhitneyu
    (except for method='auto'), scipy.stats.lmoment, scipy.stats.moment,
    scipy.stats.ansari (related to new method argument),
    scipy.stats.yeojohnson_llf, scipy.stats.epps_singleton_2samp,
    scipy.stats.wilcoxon (except for method='exact' and method='auto'),
    scipy.stats.rankdata (via delegation), scipy.signal.oaconvolve,
    scipy.signal.hilbert, and scipy.signal.hilbert2.

Deprecated features and future changes

  • passing lwork parameter to scipy.linalg.qr has 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 the lwork parameter.
  • The sparse construction functions kron, kronsum and build_diag
    choose return type sparray or spmatrix depending 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 to sparray. You can control the output type by
    ensuring that at least one input array is sparse. If any are sparray,
    the output will be sparray. If all sparse inputs are spmatrix,
    the output will be spmatrix.
  • A FutureWarning is now issued for calling {r}matvec on column vectors
    with LinearOperator. Identical behavior can be achieved (and extended to
    batch dimensions) via {r}matmat.
  • scipy.linalg functions 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,
    and scipy.spatial.distance_matrix have been deprecated in favor of
    other superior functions.
  • scipy.spatial.tsearch has been deprecated because it duplicates functionality
    more conveniently provided within the Delaunay class proper.
  • The following functions have been deprecated because they were deemed
    not practically useful: scipy.interpolate.pade, scipy.interpolate.lagrange,
    and scipy.interpolate.approximate_taylor_polynomial.
  • Setting spmatrix=True for the scipy.io readers mmio, FFM, hb,
    and matlab/_mio is now deprecated, including when set as the default
    value.
  • The unintentionally public scipy.cluster.vq.py_vq has been deprecated.

Backwards incompatible changes

  • The output of scipy.stats.rankdata is now always of a floating point
    dtype -- the result dtype of the input and a Python float.
  • The behavior of the residuals returned by scipy.linalg.lstsq has been
    changed. For lapack_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 to NaN.
  • The 2nd output object of scipy.stats.contingency.crosstab when kwarg
    sparse=True is 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 see migration_to_sparray.
  • scipy.stats.obrientransform now returns a tuple of arrays instead of
    a single ndarray.
  • scipy.stats.multinomial now 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 the p array to compensate.
    Note that multinomial.rvs will now raise an error in such cases, since it
    has an integral return type.
  • The iprint and disp parameters of scipy.optimize.fmin_l_bfgs_b
    have been removed, following the expiry of their deprecation.
  • For scipy.linalg.{sqrtm, logm, signm}, disp (and sqrtm
    blocksize) parameters were removed (expired deprecations).
  • The deprecated atol argument of scipy.optimize.nnls has been
    removed.

Other changes

  • The vendored Boost.Math was updated from 1.89.0 to 1.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._regrid function 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.

Don't miss a new scipy release

NewReleases is sending notifications on new releases.