SciPy v1.5.0 Release Notes
Release Date: 2020-06-21 // over 1 year ago-
π SciPy 1.5.0 Release Notes
SciPy
1.5.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 withpython -Wd
and check forDeprecationWarning
s).
π Our development attention will now shift to bug-fix releases on the
1.5.x branch, and on adding new features on the master branch.π This release requires Python
3.6+
and NumPy1.14.5
or greater.For running on PyPy, PyPy3
6.0+
and NumPy1.15.0
are required.π Highlights of this release
- wrappers for more than a dozen new
LAPACK
routines are now available
inscipy.linalg.lapack
- π Improved support for leveraging 64-bit integer size from linear algebra
backends - β addition of the probability distribution for two-sided one-sample
β Kolmogorov-Smirnov tests
π New features
scipy.cluster
improvementsπ Initialization of
scipy.cluster.vq.kmeans2
usingminit="++"
had a
quadratic complexity in the number of samples. It has been improved, resulting
in a much faster initialization with quasi-linear complexity.scipy.cluster.hierarchy.dendrogram
now respects thematplotlib
color
palettescipy.fft
improvementsA new keyword-only argument
plan
is added to all FFT functions in this
module. It is reserved for passing in a precomputed plan from libraries
providing a FFT backend (such asPyFFTW
andmkl-fft
), and it is
currently not used in SciPy.scipy.integrate
improvementsscipy.interpolate
improvementsscipy.io
improvementsscipy.io.wavfile
error messages are more explicit about what's wrong, and
extraneous bytes at the ends of files are ignored instead of raising an error
when the data has successfully been read.scipy.io.loadmat
gained asimplify_cells
parameter, which if set to
True
simplifies the structure of the return value if the.mat
file
contains cell arrays.π
pathlib.Path
objects are now supported inscipy.io
Matrix Market I/O
functionsscipy.linalg
improvementsscipy.linalg.eigh
has been improved. Now variousLAPACK
drivers can be
selected at will and also subsets of eigenvalues can be requested via
subset_by_value
keyword. Another keywordsubset_by_index
is introduced.
π Keywordsturbo
andeigvals
are deprecated.Similarly, standard and generalized Hermitian eigenvalue
LAPACK
routines
?<sy/he>evx
are added and existing ones now have full_lwork
counterparts.Wrappers for the following
LAPACK
routines have been added to
scipy.linalg.lapack
:?getc2
: computes the LU factorization of a general matrix with complete
pivoting?gesc2
: solves a linear system given an LU factorization from?getc2
?gejsv
: computes the singular value decomposition of a general matrix
with higher accuracy calculation of tiny singular values and their
corresponding singular vectors?geqrfp
: computes the QR factorization of a general matrix with
non-negative elements on the diagonal of R?gtsvx
: solves a linear system with general tridiagonal matrix?gttrf
: computes the LU factorization of a tridiagonal matrix?gttrs
: solves a linear system given an LU factorization from?gttrf
?ptsvx
: solves a linear system with symmetric positive definite
tridiagonal matrix?pttrf
: computes the LU factorization of a symmetric positive definite
tridiagonal matrix?pttrs
: solves a linear system given an LU factorization from?pttrf
?pteqr
: computes the eigenvectors and eigenvalues of a positive definite
tridiagonal matrix?tbtrs
: solves a linear system with a triangular banded matrix?csd
: computes the Cosine Sine decomposition of an orthogonal/unitary
matrix
Generalized QR factorization routines (
?geqrf
) now have full_lwork
counterparts.scipy.linalg.cossin
Cosine Sine decomposition of unitary matrices has been
β added.The function
scipy.linalg.khatri_rao
, which computes the Khatri-Rao product,
was added.The new function
scipy.linalg.convolution_matrix
constructs the Toeplitz
matrix representing one-dimensional convolution.scipy.ndimage
improvementsβ‘οΈ
scipy.optimize
improvementsThe finite difference numerical differentiation used in various
minimize
methods that use gradients has several new features:- 2-point, 3-point, or complex step finite differences can be used. Previously
only a 2-step finite difference was available. - There is now the possibility to use a relative step size, previously only an
absolute step size was available. - If the
minimize
method uses bounds the numerical differentiation strictly
obeys those limits. - The numerical differentiation machinery now makes use of a simple cache,
which in some cases can reduce the number of function evaluations. - π
minimize
'smethod= 'powell'
now supports simple bound constraints
β‘οΈ There have been several improvements to
scipy.optimize.linprog
:- The
linprog
benchmark suite has been expanded considerably. - π
linprog
's dense pivot-based redundancy removal routine and sparse
presolve are faster - π When
scikit-sparse
is available, solving sparse problems with
method='interior-point'
is faster
β‘οΈ The caching of values when optimizing a function returning both value and
gradient together has been improved, avoiding repeated function evaluations
when using aHessianApproximation
such asBFGS
.differential_evolution
can now use the modernnp.random.Generator
as
π well as the legacynp.random.RandomState
as a seed.π¦
scipy.signal
improvementsA new optional argument
include_nyquist
is added tofreqz
functions in
this module. It is used for including the last frequency (Nyquist frequency).scipy.signal.find_peaks_cwt
now accepts awindow_size
parameter for the
size of the window used to calculate the noise floor.π
scipy.sparse
improvementsOuter indexing is now faster when using a 2d column vector to select column
indices.π
scipy.sparse.lil.tocsr
is fasterπ Fixed/improved comparisons between pydata sparse arrays and sparse matrices
π BSR format sparse multiplication performance has been improved.
π
scipy.sparse.linalg.LinearOperator
has gained the newndim
class
attributescipy.spatial
improvementsscipy.spatial.geometric_slerp
has been added to enable geometric
spherical linear interpolation on an n-sphereπ
scipy.spatial.SphericalVoronoi
now supports calculation of region areas in 2D
and 3D casesπ The tree building algorithm used by
cKDTree
has improved from quadratic
worst case time complexity to loglinear. Benchmarks are also now available for
π building and querying of balanced/unbalanced kd-trees.scipy.special
improvementsThe following functions now have Cython interfaces in
cython_special
:scipy.special.erfinv
scipy.special.erfcinv
scipy.special.spherical_jn
scipy.special.spherical_yn
scipy.special.spherical_in
scipy.special.spherical_kn
scipy.special.log_softmax
has been added to calculate the logarithm of softmax
π² function. It provides better accuracy thanlog(scipy.special.softmax(x))
for
inputs that make softmax saturate.scipy.stats
improvementsThe function for generating random samples in
scipy.stats.dlaplace
has been
π improved. The new function is approximately twice as fast with a memory
π footprint reduction between 25 % and 60 % (see gh-11069).π
scipy.stats
functions that accept a seed for reproducible calculations using
random number generation (e.g. random variates from distributions) can now use
the modernnp.random.Generator
as well as the legacy
πnp.random.RandomState
as a seed.The
axis
parameter was added toscipy.stats.rankdata
. This allows slices
of an array along the given axis to be ranked independently.The
axis
parameter was added toscipy.stats.f_oneway
, allowing it to
β compute multiple one-way ANOVA tests for data stored in n-dimensional
π arrays. The performance off_oneway
was also improved for some cases.The PDF and CDF methods for
stats.geninvgauss
are now significantly faster
as the numerical integration to calculate the CDF uses a Cython based
LowLevelCallable
.Moments of the normal distribution (
scipy.stats.norm
) are now calculated using
analytical formulas instead of numerical integration for greater speed and
accuracyMoments and entropy trapezoidal distribution (
scipy.stats.trapz
) are now
calculated using analytical formulas instead of numerical integration for
greater speed and accuracyMethods of the truncated normal distribution (
scipy.stats.truncnorm
),
especially_rvs
, are significantly faster after a complete rewrite.The
fit
method of the Laplace distribution,scipy.stats.laplace
, now uses
the analytical formulas for the maximum likelihood estimates of the parameters.Generation of random variates is now thread safe for all SciPy distributions.
3rd-party distributions may need to modify the signature of the_rvs()
method to conform to_rvs(self, ..., size=None, random_state=None)
. (A
π one-time VisibleDeprecationWarning is emitted when using non-conformant
distributions.)β The Kolmogorov-Smirnov two-sided test statistic distribution
(scipy.stats.kstwo
) was added. Calculates the distribution of the K-S
two-sided statisticD_n
for a sample of size n, using a mixture of exact
and asymptotic algorithms.The new function
median_abs_deviation
replaces the deprecated
median_absolute_deviation
.The
wilcoxon
function now computes the p-value for Wilcoxon's signed rank
β test using the exact distribution for inputs up to length 25. The function has
a newmode
parameter to specify how the p-value is to be computed. The
0οΈβ£ default is"auto"
, which uses the exact distribution for inputs up to length
25 and the normal approximation for larger inputs.β Added a new Cython-based implementation to evaluate guassian kernel estimates,
π which should improve the performance ofgaussian_kde
The
winsorize
function now has anan_policy
argument for refined
handling ofnan
input values.The
binned_statistic_dd
function withstatistic="std"
performance was
π improved by ~4x.β
scipy.stats.kstest(rvs, cdf,...)
now handles both one-sample and
β two-sample testing. The one-sample variation usesscipy.stats.ksone
(orscipy.stats.kstwo
with back off toscipy.stats.kstwobign
) to calculate
the p-value. The two-sample variation, invoked ifcdf
is array_like, uses
an algorithm described by Hodges to compute the probability directly, only
backing off toscipy.stats.kstwo
in case of overflow. The result in both
β cases is more accurate p-values, especially for two-sample testing with
smaller (or quite different) sizes.π
scipy.stats.maxwell
performance improvements include a 20 % speed up for
fit()
and 5 % forpdf()
`scipy.stats.shapiro
andscipy.stats.jarque_bera
now return a named tuple
for greater consistency with otherstats
functionsπ Deprecated features
π
scipy
deprecationsscipy.special
changesπ The
bdtr
,bdtrc
, andbdtri
functions are deprecating non-negative
non-integraln
arguments.scipy.stats
changesThe function
median_absolute_deviation
is deprecated. Use
median_abs_deviation
instead.The use of the string
"raw"
with thescale
parameter ofiqr
is
π deprecated. Usescale=1
instead.Backwards incompatible changes
scipy.interpolate
changesscipy.linalg
changesThe output signatures of
?syevr
,?heevr
have been changed from
w, v, info
tow, v, m, isuppz, info
The order of output arguments
w
,v
of<sy/he>{gv, gvd, gvx}
is
swapped.π¦
scipy.signal
changesπ¦ The output length of
scipy.signal.upfirdn
has been corrected, resulting
outputs may now be shorter for some combinations of up/down ratios and input
π¦ signal and filter lengths.π¦
scipy.signal.resample
now supports adomain
keyword argument for
specification of time or frequency domain input.scipy.stats
changesOther changes
π Improved support for leveraging 64-bit integer size from linear algebra backends
in several parts of the SciPy codebase.Shims designed to ensure the compatibility of SciPy with Python 2.7 have now
π been removed.β Many warnings due to unused imports and unused assignments have been addressed.
π Many usage examples were added to function docstrings, and many input
π» validations and intuitive exception messages have been added throughout the
codebase.Early stage adoption of type annotations in a few parts of the codebase
Authors
- @endolith
- Hameer Abbasi
- ADmitri +
- Wesley Alves +
- Berkay Antmen +
- Sylwester Arabas +
- Arne KΓΌderle +
- Christoph Baumgarten
- Peter Bell
- Felix Berkenkamp
- JordΓ£o Bragantini +
- Clemens Brunner +
- Evgeni Burovski
- Matthias Bussonnier +
- CJ Carey
- Derrick Chambers +
- Leander Claes +
- Christian Clauss
- Luigi F. Cruz +
- dankleeman
- Andras Deak
- Milad Sadeghi DM +
- jeremie du boisberranger +
- Stefan Endres
- Malte Esders +
- Leo Fang +
- felixhekhorn +
- Isuru Fernando
- Andrew Fowlie
- Lakshay Garg +
- Gaurav Gijare +
- Ralf Gommers
- Emmanuelle Gouillart +
- Kevin Green +
- Martin Grignard +
- Maja Gwozdz
- Sturla Molden
- gyu-don +
- Matt Haberland
- hakeemo +
- Charles Harris
- Alex Henrie
- Santi Hernandez +
- William Hickman +
- Till Hoffmann +
- Joseph T. Iosue +
- Anany Shrey Jain
- Jakob Jakobson
- Charles Jekel +
- Julien Jerphanion +
- Jiacheng-Liu +
- Christoph Kecht +
- Paul Kienzle +
- Reidar Kind +
- Dmitry E. Kislov +
- Konrad +
- Konrad0
- Takuya KOUMURA +
- Krzysztof PiΓ³ro
- Peter Mahler Larsen
- Eric Larson
- Antony Lee
- Gregory Lee +
- Gregory R. Lee
- Chelsea Liu
- Cong Ma +
- Kevin Mader +
- Maja GwΓ³ΕΊdΕΊ +
- Alex Marvin +
- Matthias KΓΌmmerer
- Nikolay Mayorov
- Mazay0 +
- G. D. McBain
- Nicholas McKibben +
- Sabrina J. Mielke +
- Sebastian J. Mielke +
- MiloΕ‘ KomarΔeviΔ +
- Shubham Mishra +
- Santiago M. Mola +
- Grzegorz Mrukwa +
- Peyton Murray
- Andrew Nelson
- Nico SchlΓΆmer
- nwjenkins +
- odidev +
- Sambit Panda
- Vikas Pandey +
- Rick Paris +
- Harshal Prakash Patankar +
- π Balint Pato +
- Matti Picus
- Ilhan Polat
- poom +
- Siddhesh Poyarekar
- Vladyslav Rachek +
- Bharat Raghunathan
- Manu Rajput +
- Tyler Reddy
- Andrew Reed +
- Lucas Roberts
- Ariel Rokem
- Heshy Roskes
- Matt Ruffalo
- Atsushi Sakai +
- Benjamin Santos +
- Christoph Schock +
- Lisa Schwetlick +
- Chris Simpson +
- Leo Singer
- Kai Striega
- SΓΈren Fuglede JΓΈrgensen
- Kale-ab Tessera +
- Seth Troisi +
- Robert Uhl +
- Paul van Mulbregt
- Vasiliy +
- Isaac Virshup +
- Pauli Virtanen
- Shakthi Visagan +
- Jan Vleeshouwers +
- Sam Wallan +
- Lijun Wang +
- Warren Weckesser
- Richard Weiss +
- wenhui-prudencemed +
- Eric Wieser
- Josh Wilson
- James Wright +
- Ruslan Yevdokymov +
- Ziyao Zhang +
π A total of 129 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. - wrappers for more than a dozen new