SciPy 1.8.0 Release Notes
Note: SciPy 1.8.0
is not released yet!
SciPy 1.8.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.8.x branch, and on adding new features on the master branch.
This release requires Python 3.8
+ and NumPy 1.17.3
or greater.
For running on PyPy, PyPy3 6.0
+ is required.
Highlights of this release
- A sparse array API has been added for early testing and feedback; this
work is ongoing, and users should expect minor API refinements over
the next few releases. - The sparse SVD library PROPACK is now vendored with SciPy, and an interface
is exposed viascipy.sparse.svds
withsolver='PROPACK'
. - A new
scipy.stats.sampling
submodule that leverages theUNU.RAN
C
library to sample from arbitrary univariate non-uniform continuous and
discrete distributions - All namespaces that were private but happened to miss underscores in
their names have been deprecated.
New features
scipy.fft
improvements
Added an orthogonalize=None
parameter to the real transforms in scipy.fft
which controls whether the modified definition of DCT/DST is used without
changing the overall scaling.
scipy.fft
backend registration is now smoother, operating with a single
registration call and no longer requiring a context manager.
scipy.integrate
improvements
scipy.integrate.quad_vec
introduces a new optional keyword-only argument,
args
. args
takes in a tuple of extra arguments if any (default is
args=()
), which is then internally used to pass into the callable function
(needing these extra arguments) which we wish to integrate.
scipy.interpolate
improvements
scipy.interpolate.BSpline
has a new method, design_matrix
, which
constructs a design matrix of b-splines in the sparse CSR format.
A new method from_cubic
in BSpline
class allows to convert a
CubicSpline
object to BSpline
object.
scipy.linalg
improvements
scipy.linalg
gained three new public array structure investigation functions.
scipy.linalg.bandwidth
returns information about the bandedness of an array
and can be used to test for triangular structure discovery, while
scipy.linalg.issymmetric
and scipy.linalg.ishermitian
test the array for
exact and approximate symmetric/Hermitian structure.
scipy.optimize
improvements
scipy.optimize.check_grad
introduces two new optional keyword only arguments,
direction
and seed
. direction
can take values, 'all'
(default),
in which case all the one hot direction vectors will be used for verifying
the input analytical gradient function and 'random'
, in which case a
random direction vector will be used for the same purpose. seed
(default is None
) can be used for reproducing the return value of
check_grad
function. It will be used only when direction='random'
.
The scipy.optimize.minimize
TNC
method has been rewritten to use Cython
bindings. This also fixes an issue with the callback altering the state of the
optimization.
Added optional parameters target_accept_rate
and stepwise_factor
for
adapative step size adjustment in basinhopping
.
The epsilon
argument to approx_fprime
is now optional so that it may
have a default value consistent with most other functions in scipy.optimize
.
scipy.signal
improvements
Add analog
argument, default False
, to zpk2sos
, and add new pairing
option 'minimal'
to construct analog and minimal discrete SOS arrays.
tf2sos
uses zpk2sos; add analog
argument here as well, and pass it on
to zpk2sos
.
savgol_coeffs
and savgol_filter
now work for even window lengths.
Added the Chirp Z-transform and Zoom FFT available as scipy.signal.CZT
and
scipy.signal.ZoomFFT
.
scipy.sparse
improvements
An array API has been added for early testing and feedback; this
work is ongoing, and users should expect minor API refinements over
the next few releases. Please refer to the scipy.sparse
docstring for more information.
maximum_flow
introduces optional keyword only argument, method
which accepts either, 'edmonds-karp'
(Edmonds Karp algorithm) or
'dinic'
(Dinic's algorithm). Moreover, 'dinic'
is used as default
value for method
which means that Dinic's algorithm is used for computing
maximum flow unless specified. See, the comparison between the supported
algorithms in
this comment <https://github.com/scipy/scipy/pull/14358#issue-684212523>
_.
Parameters atol
, btol
now default to 1e-6 in
scipy.sparse.linalg.lsmr
to match with default values in
scipy.sparse.linalg.lsqr
.
Add the Transpose-Free Quasi-Minimal Residual algorithm (TFQMR) for general
nonsingular non-Hermitian linear systems in scipy.sparse.linalg.tfqmr
.
The sparse SVD library PROPACK is now vendored with SciPy, and an interface is
exposed via scipy.sparse.svds
with solver='PROPACK'
. For some problems,
this may be faster and/or more accurate than the default, ARPACK.
sparse.linalg
iterative solvers now have a nonzero initial guess option,
which may be specified as x0 = 'Mb'
.
The trace
method has been added for sparse matrices.
scipy.spatial
improvements
scipy.spatial.transform.Rotation
now supports item assignment and has a new
concatenate
method.
Add scipy.spatial.distance.kulczynski1
in favour of
scipy.spatial.distance.kulsinski
which will be deprecated in the next
release.
scipy.spatial.distance.minkowski
now also supports 0<p<1
.
scipy.special
improvements
The new function scipy.special.log_expit
computes the logarithm of the
logistic sigmoid function. The function is formulated to provide accurate
results for large positive and negative inputs, so it avoids the problems
that would occur in the naive implementation log(expit(x))
.
A suite of five new functions for elliptic integrals:
scipy.special.ellipr{c,d,f,g,j}
. These are the
Carlson symmetric elliptic integrals <https://dlmf.nist.gov/19.16>
_, which
have computational advantages over the classical Legendre integrals. Previous
versions included some elliptic integrals from the Cephes library
(scipy.special.ellip{k,km1,kinc,e,einc}
) but was missing the integral of
third kind (Legendre's Pi), which can be evaluated using the new Carlson
functions. The new Carlson elliptic integral functions can be evaluated in the
complex plane, whereas the Cephes library's functions are only defined for
real inputs.
Several defects in scipy.special.hyp2f1
have been corrected. Approximately
correct values are now returned for z
near exp(+-i*pi/3)
, fixing
#8054 <https://github.com/scipy/scipy/issues/8054>
. Evaluation for such z
is now calculated through a series derived by
López and Temme (2013) <https://arxiv.org/abs/1306.2046>
that converges in
these regions. In addition, degenerate cases with one or more of a
, b
,
and/or c
a non-positive integer are now handled in a manner consistent with
mpmath's hyp2f1 implementation <https://mpmath.org/doc/current/functions/hypergeometric.html>
,
which fixes #7340 <https://github.com/scipy/scipy/issues/7340>
. These fixes
were made as part of an effort to rewrite the Fortran 77 implementation of
hyp2f1 in Cython piece by piece. This rewriting is now roughly 50% complete.
scipy.stats
improvements
scipy.stats.qmc.LatinHypercube
introduces two new optional keyword-only
arguments, optimization
and strength
. optimization
is either
None
or random-cd
. In the latter, random permutations are performed to
improve the centered discrepancy. strength
is either 1 or 2. 1 corresponds
to the classical LHS while 2 has better sub-projection properties. This
construction is referred to as an orthogonal array based LHS of strength 2.
In both cases, the output is still a LHS.
scipy.stats.qmc.Halton
is faster as the underlying Van der Corput sequence
was ported to Cython.
The alternative
parameter was added to the kendalltau
and somersd
functions to allow one-sided hypothesis testing. Similarly, the masked
versions of skewtest
, kurtosistest
, ttest_1samp
, ttest_ind
,
and ttest_rel
now also have an alternative
parameter.
Add scipy.stats.gzscore
to calculate the geometrical z score.
Random variate generators to sample from arbitrary univariate non-uniform
continuous and discrete distributions have been added to the new
scipy.stats.sampling
submodule. Implementations of a C library
UNU.RAN <http://statmath.wu.ac.at/software/unuran/>
_ are used for
performance. The generators added are:
- TransformedDensityRejection
- DiscreteAliasUrn
- NumericalInversePolynomial
- DiscreteGuideTable
- SimpleRatioUniforms
The binned_statistic
set of functions now have improved performance for
the std
, min
, max
, and median
statistic calculations.
somersd
and _tau_b
now have faster Pythran-based implementations.
Some general efficiency improvements to handling of nan
values in
several stats
functions.
Added the Tukey-Kramer test as scipy.stats.tukey_hsd
.
Improved performance of scipy.stats.argus
rvs
method.
Added the parameter keepdims
to scipy.stats.variation
and prevent the
undesirable return of a masked array from the function in some cases.
permutation_test
performs an exact or randomized permutation test of a
given statistic on provided data.
Deprecated features
Clear split between public and private API
SciPy has always documented what its public API consisted of in
:ref:its API reference docs <scipy-api>
,
however there never was a clear split between public and
private namespaces in the code base. In this release, all namespaces that were
private but happened to miss underscores in their names have been deprecated.
These include (as examples, there are many more):
scipy.signal.spline
scipy.ndimage.filters
scipy.ndimage.fourier
scipy.ndimage.measurements
scipy.ndimage.morphology
scipy.ndimage.interpolation
scipy.sparse.linalg.solve
scipy.sparse.linalg.eigen
scipy.sparse.linalg.isolve
All functions and other objects in these namespaces that were meant to be
public are accessible from their respective public namespace (e.g.
scipy.signal
). The design principle is that any public object must be
accessible from a single namespace only; there are a few exceptions, mostly for
historical reasons (e.g., stats
and stats.distributions
overlap).
For other libraries aiming to provide a SciPy-compatible API, it is now
unambiguous what namespace structure to follow. See
gh-14360 <https://github.com/scipy/scipy/issues/14360>
_ for more details.
Other deprecations
NumericalInverseHermite
has been deprecated from scipy.stats
and moved
to the scipy.stats.sampling
submodule. It now uses the C implementation of
the UNU.RAN library so the result of methods like ppf
may vary slightly.
Parameter tol
has been deprecated and renamed to u_resolution
. The
parameter max_intervals
has also been deprecated and will be removed in a
future release of SciPy.
Backwards incompatible changes
- SciPy has raised the minimum compiler versions to GCC 6.3 on linux and
VS2019 on windows. In particular, this means that SciPy may now use C99 and
C++14 features. For more details see
here <https://docs.scipy.org/doc/scipy/reference/dev/toolchain.html>
_. - The result for empty bins for
scipy.stats.binned_statistic
with the builtin
'std'
metric is nownan
, for consistency withnp.std
. - The function
scipy.spatial.distance.wminkowski
has been removed. To achieve
the same results as before, please use theminkowski
distance function
with the (optional)w=
keyword-argument for the given weight.
Other changes
Some Fortran 77 code was modernized to be compatible with NAG's nagfor Fortran
compiler (see, e.g., PR 13229 <https://github.com/scipy/scipy/pull/13229>
_).
threadpoolctl
may now be used by our test suite to substantially improve
the efficiency of parallel test suite runs.
Authors
- @endolith
- adamadanandy +
- akeemlh +
- Anton Akhmerov
- Marvin Albert +
- alegresor +
- Andrew Annex +
- Pantelis Antonoudiou +
- Ross Barnowski +
- Christoph Baumgarten
- Stephen Becker +
- Nickolai Belakovski
- Peter Bell
- berberto +
- Georgii Bocharov +
- Evgeni Burovski
- Matthias Bussonnier
- CJ Carey
- Justin Charlong +
- Dennis Collaris +
- David Cottrell +
- cruyffturn +
- da-woods +
- Anirudh Dagar
- Tiger Du +
- Thomas Duvernay
- Dani El-Ayyass +
- Castedo Ellerman +
- Donnie Erb +
- Andreas Esders-Kopecky +
- Livio F +
- Isuru Fernando
- Evelyn Fitzgerald +
- Sara Fridovich-Keil +
- Mark E Fuller +
- Ralf Gommers
- Kevin Richard Green +
- guiweber +
- Nitish Gupta +
- h-vetinari
- Matt Haberland
- J. Hariharan +
- Charles Harris
- Trever Hines
- Ian Hunt-Isaak +
- ich +
- Itrimel +
- Jan-Hendrik Müller +
- Jebby993 +
- Evan W Jones +
- Nathaniel Jones +
- Jeffrey Kelling +
- Malik Idrees Hasan Khan +
- Sergey B Kirpichev
- Kadatatlu Kishore +
- Andrew Knyazev
- Ravin Kumar +
- Peter Mahler Larsen
- Eric Larson
- Antony Lee
- Gregory R. Lee
- Tim Leslie
- lezcano +
- Xingyu Liu
- Christian Lorentzen
- Lorenzo +
- Smit Lunagariya +
- Lv101Magikarp +
- Yair M +
- Cong Ma
- Lorenzo Maffioli +
- majiang +
- Brian McFee +
- Nicholas McKibben
- John Speed Meyers +
- millivolt9 +
- Jarrod Millman
- Harsh Mishra +
- Boaz Mohar +
- naelsondouglas +
- Andrew Nelson
- Nico Schlömer
- Thomas Nowotny +
- nullptr +
- Teddy Ort +
- Nick Papior
- ParticularMiner +
- Dima Pasechnik
- Tirth Patel
- Matti Picus
- Ilhan Polat
- Adrian Price-Whelan +
- Quentin Barthélemy +
- Sundar R +
- Judah Rand +
- Tyler Reddy
- Renal-Of-Loon +
- Frederic Renner +
- Pamphile Roy
- Bharath Saiguhan +
- Atsushi Sakai
- Eric Schanet +
- Sebastian Wallkötter
- serge-sans-paille
- Reshama Shaikh +
- Namami Shanker
- Walter Simson +
- Gagandeep Singh +
- Leo C. Stein +
- Albert Steppi
- Kai Striega
- Diana Sukhoverkhova
- Søren Fuglede Jørgensen
- Masayuki Takagi +
- Mike Taves
- Ben Thompson +
- Bas van Beek
- Jacob Vanderplas
- Dhruv Vats +
- H. Vetinari +
- Thomas Viehmann +
- Pauli Virtanen
- Vlad +
- Arthur Volant
- Samuel Wallan
- Stefan van der Walt
- Warren Weckesser
- Josh Wilson
- Haoyin Xu +
- Rory Yorke
- Egor Zemlyanoy
- Gang Zhao +
- 赵丰 (Zhao Feng) +
A total of 133 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.