chore(deps): update dependency scipy to ~1.8 #3
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "renovate/scipy-1.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
~1.5
->~1.8
Release Notes
scipy/scipy
v1.8.0
Compare Source
SciPy 1.8.0 Release Notes
SciPy
1.8.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.8.x branch, and on adding new features on the master branch.
This release requires Python
3.8+
andNumPy 1.17.3
or greater.For running on PyPy, PyPy3
6.0+
is required.Highlights of this release
work is ongoing, and users should expect minor API refinements over
the next few releases.
is exposed via
scipy.sparse.svds
withsolver='PROPACK'
. It is currentlydefault-off due to potential issues on Windows that we aim to
resolve in the next release, but can be optionally enabled at runtime for
friendly testing with an environment variable setting of
USE_PROPACK=1
.scipy.stats.sampling
submodule that leverages theUNU.RAN
Clibrary to sample from arbitrary univariate non-uniform continuous and
discrete distributions
their names have been deprecated.
New features
scipy.fft
improvementsAdded an
orthogonalize=None
parameter to the real transforms inscipy.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 singleregistration call and no longer requiring a context manager.
scipy.integrate
improvementsscipy.integrate.quad_vec
introduces a new optional keyword-only argument,args
.args
takes in a tuple of extra arguments if any (default isargs=()
), which is then internally used to pass into the callable function(needing these extra arguments) which we wish to integrate.
scipy.interpolate
improvementsscipy.interpolate.BSpline
has a new method,design_matrix
, whichconstructs a design matrix of b-splines in the sparse CSR format.
A new method
from_cubic
inBSpline
class allows to convert aCubicSpline
object toBSpline
object.scipy.linalg
improvementsscipy.linalg
gained three new public array structure investigation functions.scipy.linalg.bandwidth
returns information about the bandedness of an arrayand can be used to test for triangular structure discovery, while
scipy.linalg.issymmetric
andscipy.linalg.ishermitian
test the array forexact and approximate symmetric/Hermitian structure.
scipy.optimize
improvementsscipy.optimize.check_grad
introduces two new optional keyword only arguments,direction
andseed
.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 arandom direction vector will be used for the same purpose.
seed
(default is
None
) can be used for reproducing the return value ofcheck_grad
function. It will be used only whendirection='random'
.The
scipy.optimize.minimize
TNC
method has been rewritten to use Cythonbindings. This also fixes an issue with the callback altering the state of the
optimization.
Added optional parameters
target_accept_rate
andstepwise_factor
foradapative step size adjustment in
basinhopping
.The
epsilon
argument toapprox_fprime
is now optional so that it mayhave a default value consistent with most other functions in
scipy.optimize
.scipy.signal
improvementsAdd
analog
argument, defaultFalse
, tozpk2sos
, and add new pairingoption
'minimal'
to construct analog and minimal discrete SOS arrays.tf2sos
uses zpk2sos; addanalog
argument here as well, and pass it onto
zpk2sos
.savgol_coeffs
andsavgol_filter
now work for even window lengths.Added the Chirp Z-transform and Zoom FFT available as
scipy.signal.CZT
andscipy.signal.ZoomFFT
.scipy.sparse
improvementsAn 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 defaultvalue for
method
which means that Dinic's algorithm is used for computingmaximum 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 inscipy.sparse.linalg.lsmr
to match with default values inscipy.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
withsolver='PROPACK'
. For some problems,this may be faster and/or more accurate than the default, ARPACK. PROPACK
functionality is currently opt-in--you must specify
USE_PROPACK=1
atruntime to use it due to potential issues on Windows
that we aim to resolve in the next release.
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
improvementsscipy.spatial.transform.Rotation
now supports item assignment and has a newconcatenate
method.Add
scipy.spatial.distance.kulczynski1
in favour ofscipy.spatial.distance.kulsinski
which will be deprecated in the nextrelease.
scipy.spatial.distance.minkowski
now also supports0<p<1
.scipy.special
improvementsThe new function
scipy.special.log_expit
computes the logarithm of thelogistic 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 theCarlson symmetric elliptic integrals <https://dlmf.nist.gov/19.16>
_, whichhave 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 ofthird 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. Approximatelycorrect values are now returned for
z
nearexp(+-i*pi/3)
, fixing#​8054 <https://github.com/scipy/scipy/issues/8054>
. Evaluation for suchz
is now calculated through a series derived by
López and Temme (2013) <https://arxiv.org/abs/1306.2046>
that converges inthese 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 withmpmath's hyp2f1 implementation <https://mpmath.org/doc/current/functions/hypergeometric.html>
,which fixes
#​7340 <https://github.com/scipy/scipy/issues/7340>
. These fixeswere 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
improvementsscipy.stats.qmc.LatinHypercube
introduces two new optional keyword-onlyarguments,
optimization
andstrength
.optimization
is eitherNone
orrandom-cd
. In the latter, random permutations are performed toimprove the centered discrepancy.
strength
is either 1 or 2. 1 correspondsto 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 sequencewas ported to Cython.
The
alternative
parameter was added to thekendalltau
andsomersd
functions to allow one-sided hypothesis testing. Similarly, the masked
versions of
skewtest
,kurtosistest
,ttest_1samp
,ttest_ind
,and
ttest_rel
now also have analternative
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 libraryUNU.RAN <http://statmath.wu.ac.at/software/unuran/>
_ are used forperformance. The generators added are:
The
binned_statistic
set of functions now have improved performance forthe
std
,min
,max
, andmedian
statistic calculations.somersd
and_tau_b
now have faster Pythran-based implementations.Some general efficiency improvements to handling of
nan
values inseveral
stats
functions.Added the Tukey-Kramer test as
scipy.stats.tukey_hsd
.Improved performance of
scipy.stats.argus
rvs
method.Added the parameter
keepdims
toscipy.stats.variation
and prevent theundesirable return of a masked array from the function in some cases.
permutation_test
performs an exact or randomized permutation test of agiven 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 beaccessible from a single namespace only; there are a few exceptions, mostly for
historical reasons (e.g.,
stats
andstats.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 fromscipy.stats
and movedto the
scipy.stats.sampling
submodule. It now uses the C implementation ofthe UNU.RAN library so the result of methods like
ppf
may vary slightly.Parameter
tol
has been deprecated and renamed tou_resolution
. Theparameter
max_intervals
has also been deprecated and will be removed in afuture release of SciPy.
Backwards incompatible changes
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>
_.scipy.stats.binned_statistic
with the builtin'std'
metric is nownan
, for consistency withnp.std
.scipy.spatial.distance.wminkowski
has been removed. To achievethe same results as before, please use the
minkowski
distance functionwith 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 improvethe efficiency of parallel test suite runs.
Authors
A total of 139 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.7.3
Compare Source
SciPy 1.7.3 Release Notes
SciPy
1.7.3
is a bug-fix release that provides binary wheelsfor MacOS arm64 with Python
3.8
,3.9
, and3.10
. The MacOS arm64 wheelsare only available for MacOS version
12.0
and greater, as explainedin Issue 14688.
Authors
A total of 6 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.7.2
Compare Source
SciPy 1.7.2 Release Notes
SciPy
1.7.2
is a bug-fix release with no new featurescompared to
1.7.1
. Notably, the release includes wheelsfor Python
3.10
, and wheels are now built with a newerversion of OpenBLAS,
0.3.17
. Python3.10
wheels are providedfor MacOS x86_64 (thin, not universal2 or arm64 at this time),
and Windows/Linux 64-bit. Many wheels are now built with newer
versions of manylinux, which may require newer versions of pip.
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.7.1
Compare Source
SciPy 1.7.1 Release Notes
SciPy
1.7.1
is a bug-fix release with no new featurescompared to
1.7.0
.Authors
A total of 9 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.7.0
Compare Source
SciPy 1.7.0 Release Notes
SciPy
1.7.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.7.x branch, and on adding new features on the master branch.
This release requires Python
3.7+
and NumPy1.16.5
or greater.For running on PyPy, PyPy3
6.0+
is required.Highlights of this release
scipy.stats.qmc
, was addedNumPy and other ecosystem libraries.
improvements for long-standing weaknesses in
scipy.stats
scipy.stats
has six new distributions, eight new (or overhauled)hypothesis tests, a new function for bootstrapping, a class that enables
fast random variate sampling and percentile point function evaluation,
and many other enhancements.
cdist
andpdist
distance calculations are faster for several metrics,especially weighted cases, thanks to a rewrite to a new C++ backend framework
RBFInterpolator
, wasadded to address issues with the
Rbf
class.We gratefully acknowledge the Chan-Zuckerberg Initiative Essential Open Source
Software for Science program for supporting many of the improvements to
scipy.stats
.New features
scipy.cluster
improvementsAn optional argument,
seed
, has been added tokmeans
andkmeans2
toset the random generator and random state.
scipy.interpolate
improvementsImproved input validation and error messages for
fitpack.bispev
andfitpack.parder
for scenarios that previously caused substantial confusionfor users.
The class
RBFInterpolator
was added to supersede theRbf
class. The newclass has usage that more closely follows other interpolator classes, corrects
sign errors that caused unexpected smoothing behavior, includes polynomial
terms in the interpolant (which are necessary for some RBF choices), and
supports interpolation using only the k-nearest neighbors for memory
efficiency.
scipy.linalg
improvementsAn LAPACK wrapper was added for access to the
tgexc
subroutine.scipy.ndimage
improvementsscipy.ndimage.affine_transform
is now able to infer theoutput_shape
fromthe
out
array.scipy.optimize
improvementsThe optional parameter
bounds
was added to_minimize_neldermead
to support bounds constraintsfor the Nelder-Mead solver.
trustregion
methodstrust-krylov
,dogleg
andtrust-ncg
can nowestimate
hess
by finite difference using one of["2-point", "3-point", "cs"]
.halton
was added as asampling_method
inscipy.optimize.shgo
.sobol
was fixed and is now usingscipy.stats.qmc.Sobol
.halton
andsobol
were added asinit
methods inscipy.optimize.differential_evolution.
differential_evolution
now accepts anx0
parameter to provide aninitial guess for the minimization.
least_squares
has a modest performance improvement when SciPy is builtwith Pythran transpiler enabled.
When
linprog
is used withmethod
'highs'
,'highs-ipm'
, or'highs-ds'
, the result object now reports the marginals (AKA shadowprices, dual values) and residuals associated with each constraint.
scipy.signal
improvementsget_window
supportsgeneral_cosine
andgeneral_hamming
windowfunctions.
scipy.signal.medfilt2d
now releases the GIL where appropriate to enableperformance gains via multithreaded calculations.
scipy.sparse
improvementsAddition of
dia_matrix
sparse matrices is now faster.scipy.spatial
improvementsdistance.cdist
anddistance.pdist
performance has greatly improved forcertain weighted metrics. Namely:
minkowski
,euclidean
,chebyshev
,canberra
, andcityblock
.Modest performance improvements for many of the unweighted
cdist
andpdist
metrics noted above.The parameter
seed
was added toscipy.spatial.vq.kmeans
andscipy.spatial.vq.kmeans2
.The parameters
axis
andkeepdims
where added toscipy.spatial.distance.jensenshannon
.The
rotation
methodsfrom_rotvec
andas_rotvec
now accept adegrees
argument to specify usage of degrees instead of radians.scipy.special
improvementsWright's generalized Bessel function for positive arguments was added as
scipy.special.wright_bessel.
An implementation of the inverse of the Log CDF of the Normal Distribution is
now available via
scipy.special.ndtri_exp
.scipy.stats
improvementsHypothesis Tests
The Mann-Whitney-Wilcoxon test,
mannwhitneyu
, has been rewritten. It nowsupports n-dimensional input, an exact test method when there are no ties,
and improved documentation. Please see "Other changes" for adjustments to
default behavior.
The new function
scipy.stats.binomtest
replacesscipy.stats.binom_test
. Thenew function returns an object that calculates a confidence intervals of the
proportion parameter. Also, performance was improved from O(n) to O(log(n)) by
using binary search.
The two-sample version of the Cramer-von Mises test is implemented in
scipy.stats.cramervonmises_2samp
.The Alexander-Govern test is implemented in the new function
scipy.stats.alexandergovern
.The new functions
scipy.stats.barnard_exact
andscipy.stats. boschloo_exact
respectively perform Barnard's exact test and Boschloo's exact test
for 2x2 contingency tables.
The new function
scipy.stats.page_trend_test
performs Page's test for orderedalternatives.
The new function
scipy.stats.somersd
performs Somers' D test for ordinalassociation between two variables.
An option,
permutations
, has been added inscipy.stats.ttest_ind
toperform permutation t-tests. A
trim
option was also added to performa trimmed (Yuen's) t-test.
The
alternative
parameter was added to theskewtest
,kurtosistest
,ranksums
,mood
,ansari
,linregress
, andspearmanr
functionsto allow one-sided hypothesis testing.
Sample statistics
The new function
scipy.stats.differential_entropy
estimates the differentialentropy of a continuous distribution from a sample.
The
boxcox
andboxcox_normmax
now allow the user to control theoptimizer used to minimize the negative log-likelihood function.
A new function
scipy.stats.contingency.relative_risk
calculates therelative risk, or risk ratio, of a 2x2 contingency table. The object
returned has a method to compute the confidence interval of the relative risk.
Performance improvements in the
skew
andkurtosis
functions achievedby removal of repeated/redundant calculations.
Substantial performance improvements in
scipy.stats.mstats.hdquantiles_sd
.The new function
scipy.stats.contingency.association
computes severalmeasures of association for a contingency table: Pearsons contingency
coefficient, Cramer's V, and Tschuprow's T.
The parameter
nan_policy
was added toscipy.stats.zmap
to provide optionsfor handling the occurrence of
nan
in the input data.The parameter
ddof
was added toscipy.stats.variation
andscipy.stats.mstats.variation
.The parameter
weights
was added toscipy.stats.gmean
.Statistical Distributions
We now vendor and leverage the Boost C++ library to address a number of
previously reported issues in
stats
. Notably,beta
,binom
,nbinom
now have Boost backends, and it is straightforward to leveragethe backend for additional functions.
The skew Cauchy probability distribution has been implemented as
scipy.stats.skewcauchy
.The Zipfian probability distribution has been implemented as
scipy.stats.zipfian
.The new distributions
nchypergeom_fisher
andnchypergeom_wallenius
implement the Fisher and Wallenius versions of the noncentral hypergeometric
distribution, respectively.
The generalized hyperbolic distribution was added in
scipy.stats.genhyperbolic
.The studentized range distribution was added in
scipy.stats.studentized_range
.scipy.stats.argus
now has improved handling for small parameter values.Better argument handling/preparation has resulted in performance improvements
for many distributions.
The
cosine
distribution has added ufuncs forppf
,cdf
,sf
, andisf
methods including numerical precision improvements at the edges of thesupport of the distribution.
An option to fit the distribution to data by the method of moments has been
added to the
fit
method of the univariate continuous distributions.Other
scipy.stats.bootstrap
has been added to allow estimation of the confidenceinterval and standard error of a statistic.
The new function
scipy.stats.contingency.crosstab
computes a contingencytable (i.e. a table of counts of unique entries) for the given data.
scipy.stats.NumericalInverseHermite
enables fast random variate samplingand percentile point function evaluation of an arbitrary univariate statistical
distribution.
New
scipy.stats.qmc
moduleThis new module provides Quasi-Monte Carlo (QMC) generators and associated
helper functions.
It provides a generic class
scipy.stats.qmc.QMCEngine
which defines a QMCengine/sampler. An engine is state aware: it can be continued, advanced and
reset. 3 base samplers are available:
scipy.stats.qmc.Sobol
the well known Sobol low discrepancy sequence.Several warnings have been added to guide the user into properly using this
sampler. The sequence is scrambled by default.
scipy.stats.qmc.Halton
: Halton low discrepancy sequence. The sequence isscrambled by default.
scipy.stats.qmc.LatinHypercube
: plain LHS design.And 2 special samplers are available:
scipy.stats.qmc.MultinomialQMC
: sampling from a multinomial distributionusing any of the base
scipy.stats.qmc.QMCEngine
.scipy.stats.qmc.MultivariateNormalQMC
: sampling from a multivariate Normalusing any of the base
scipy.stats.qmc.QMCEngine
.The module also provide the following helpers:
scipy.stats.qmc.discrepancy
: assess the quality of a set of points in termsof space coverage.
scipy.stats.qmc.update_discrepancy
: can be used in an optimization loop toconstruct a good set of points.
scipy.stats.qmc.scale
: easily scale a set of points from (to) the unitinterval to (from) a given range.
Deprecated features
scipy.linalg
deprecationsscipy.linalg.pinv2
is deprecated and its functionality is completelysubsumed into
scipy.linalg.pinv
rcond
,cond
keywords ofscipy.linalg.pinv
andscipy.linalg.pinvh
were not working and now are deprecated. They are nowreplaced with functioning
atol
andrtol
keywords with clear usage.scipy.spatial
deprecationsscipy.spatial.distance
metrics expect 1d input vectors but will callnp.squeeze
on their inputs to accept any extra length-1 dimensions. Thatbehaviour is now deprecated.
Other changes
We now accept and leverage performance improvements from the ahead-of-time
Python-to-C++ transpiler, Pythran, which can be optionally disabled (via
export SCIPY_USE_PYTHRAN=0
) but is enabled by default at build time.There are two changes to the default behavior of
scipy.stats.mannwhitenyu
:alternative=None
was deprecated; explicitalternative
specification was required. Use of the new default value ofalternative
, "two-sided", is now permitted.small samples without ties, the p-values returned are exact by default.
Support has been added for PEP 621 (project metadata in
pyproject.toml
)We now support a Gitpod environment to reduce the barrier to entry for SciPy
development; for more details see :ref:
quickstart-gitpod
.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.
v1.6.3
Compare Source
SciPy 1.6.3 Release Notes
SciPy
1.6.3
is a bug-fix release with no new featurescompared to
1.6.2
.Authors
A total of 8 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.6.2
Compare Source
SciPy 1.6.2 Release Notes
SciPy
1.6.2
is a bug-fix release with no new featurescompared to
1.6.1
. This is also the first SciPy releaseto place upper bounds on some dependencies to improve
the long-term repeatability of source builds.
Authors
A total of 6 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.6.1
Compare Source
SciPy 1.6.1 Release Notes
SciPy
1.6.1
is a bug-fix release with no new featurescompared to
1.6.0
.Please note that for SciPy wheels to correctly install with pip on
macOS 11, pip
>= 20.3.3
is needed.Authors
A total of 11 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.6.0
Compare Source
SciPy 1.6.0 Release Notes
SciPy
1.6.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.6.x
branch, and on adding new features on the master branch.This release requires Python
3.7+
and NumPy1.16.5
or greater.For running on PyPy, PyPy3
6.0+
is required.Highlights of this release
scipy.ndimage
improvements: Fixes and ehancements to boundary extensionmodes for interpolation functions. Support for complex-valued inputs in many
filtering and interpolation functions. New
grid_mode
option forscipy.ndimage.zoom
to enable results consistent with scikit-image'srescale
.scipy.optimize.linprog
has fast, new methods for large, sparse problemsfrom the
HiGHS
library.scipy.stats
improvements including new distributions, a new test, andenhancements to existing distributions and tests
New features
scipy.special
improvementsscipy.special
now has improved support for 64-bitLAPACK
backendscipy.odr
improvementsscipy.odr
now has support for 64-bit integerBLAS
scipy.odr.ODR
has gained an optionaloverwrite
argument so that existingfiles may be overwritten.
scipy.integrate
improvementsSome renames of functions with poor names were done, with the old names
retained without being in the reference guide for backwards compatibility
reasons:
integrate.simps
was renamed tointegrate.simpson
integrate.trapz
was renamed tointegrate.trapezoid
integrate.cumtrapz
was renamed tointegrate.cumulative_trapezoid
scipy.cluster
improvementsscipy.cluster.hierarchy.DisjointSet
has been added for incrementalconnectivity queries.
scipy.cluster.hierarchy.dendrogram
return value now also includes leaf colorinformation in
leaves_color_list
.scipy.interpolate
improvementsscipy.interpolate.interp1d
has a new methodnearest-up
, similar to theexisting method
nearest
but rounds half-integers up instead of down.scipy.io
improvementsSupport has been added for reading arbitrary bit depth integer PCM WAV files
from 1- to 32-bit, including the commonly-requested 24-bit depth.
scipy.linalg
improvementsThe new function
scipy.linalg.matmul_toeplitz
uses the FFT to compute theproduct of a Toeplitz matrix with another matrix.
scipy.linalg.sqrtm
andscipy.linalg.logm
have performance improvementsthanks to additional Cython code.
Python
LAPACK
wrappers have been added forpptrf
,pptrs
,ppsv
,pptri
, andppcon
.scipy.linalg.norm
and thesvd
family of functions will now use 64-bitinteger backends when available.
scipy.ndimage
improvementsscipy.ndimage.convolve
,scipy.ndimage.correlate
and their 1d counterpartsnow accept both complex-valued images and/or complex-valued filter kernels. All
convolution-based filters also now accept complex-valued inputs
(e.g.
gaussian_filter
,uniform_filter
, etc.).Multiple fixes and enhancements to boundary handling were introduced to
scipy.ndimage
interpolation functions (i.e.affine_transform
,geometric_transform
,map_coordinates
,rotate
,shift
,zoom
).A new boundary mode,
grid-wrap
was added which wraps images periodically,using a period equal to the shape of the input image grid. This is in contrast
to the existing
wrap
mode which uses a period that is one sample smallerthan the original signal extent along each dimension.
A long-standing bug in the
reflect
boundary condition has been fixed andthe mode
grid-mirror
was introduced as a synonym forreflect
.A new boundary mode,
grid-constant
is now available. This is similar tothe existing ndimage
constant
mode, but interpolation will still performedat coordinate values outside of the original image extent. This
grid-constant
mode is consistent with OpenCV'sBORDER_CONSTANT
modeand scikit-image's
constant
mode.Spline pre-filtering (used internally by
ndimage
interpolation functionswhen
order >= 2
), now supports all boundary modes rather than alwaysdefaulting to mirror boundary conditions. The standalone functions
spline_filter
andspline_filter1d
have analytical boundary conditionsthat match modes
mirror
,grid-wrap
andreflect
.scipy.ndimage
interpolation functions now accept complex-valued inputs. Inthis case, the interpolation is applied independently to the real and
imaginary components.
The
ndimage
tutorials(https://docs.scipy.org/doc/scipy/reference/tutorial/ndimage.html) have been
updated with new figures to better clarify the exact behavior of all of the
interpolation boundary modes.
scipy.ndimage.zoom
now has agrid_mode
option that changes the coordinateof the center of the first pixel along an axis from 0 to 0.5. This allows
resizing in a manner that is consistent with the behavior of scikit-image's
resize
andrescale
functions (and OpenCV'scv2.resize
).scipy.optimize
improvementsscipy.optimize.linprog
has fast, new methods for large, sparse problems fromthe
HiGHS
C++ library.method='highs-ds'
uses a high performance dualrevised simplex implementation (HSOL),
method='highs-ipm'
uses aninterior-point method with crossover, and
method='highs'
chooses betweenthe two automatically. These methods are typically much faster and often exceed
the accuracy of other
linprog
methods, so we recommend explicitlyspecifying one of these three method values when using
linprog
.scipy.optimize.quadratic_assignment
has been added for approximate solutionof the quadratic assignment problem.
scipy.optimize.linear_sum_assignment
now has a substantially reduced overheadfor small cost matrix sizes
scipy.optimize.least_squares
has improved performance when the user providesthe jacobian as a sparse jacobian already in
csr_matrix
formatscipy.optimize.linprog
now has anrr_method
argument for specificationof the method used for redundancy handling, and a new method for this purpose
is available based on the interpolative decomposition approach.
scipy.signal
improvementsscipy.signal.gammatone
has been added to design FIR or IIR filters thatmodel the human auditory system.
scipy.signal.iircomb
has been added to design IIR peaking/notching combfilters that can boost/attenuate a frequency from a signal.
scipy.signal.sosfilt
performance has been improved to avoid some previously-observed slowdowns
scipy.signal.windows.taylor
has been added--the Taylor window function iscommonly used in radar digital signal processing
scipy.signal.gauss_spline
now supportslist
type input for consistencywith other related SciPy functions
scipy.signal.correlation_lags
has been added to allow calculation of the lag/displacement indices array for 1D cross-correlation.
scipy.sparse
improvementsA solver for the minimum weight full matching problem for bipartite graphs,
also known as the linear assignment problem, has been added in
scipy.sparse.csgraph.min_weight_full_bipartite_matching
. In particular, thisprovides functionality analogous to that of
scipy.optimize.linear_sum_assignment
, but with improved performance for sparseinputs, and the ability to handle inputs whose dense representations would not
fit in memory.
The time complexity of
scipy.sparse.block_diag
has been improved dramaticallyfrom quadratic to linear.
scipy.sparse.linalg
improvementsThe vendored version of
SuperLU
has been updatedscipy.fft
improvementsThe vendored
pocketfft
library now supports compiling with ARM neon vectorextensions and has improved thread pool behavior.
scipy.spatial
improvementsThe python implementation of
KDTree
has been dropped andKDTree
is nowimplemented in terms of
cKDTree
. You can now expectcKDTree
-likeperformance by default. This also means
sys.setrecursionlimit
no longerneeds to be increased for querying large trees.
transform.Rotation
has been updated with support for Modified RodriguesParameters alongside the existing rotation representations (PR gh-12667).
scipy.spatial.transform.Rotation
has been partially cythonized, with someperformance improvements observed
scipy.spatial.distance.cdist
has improved performance with theminkowski
metric, especially for p-norm values of 1 or 2.
scipy.stats
improvementsNew distributions have been added to
scipy.stats
:scipy.stats.laplace_asymmetric
.scipy.stats.nhypergeom
.scipy.stats.multivariate_t
.scipy.stats.multivariate_hypergeom
.The
fit
method has been overridden for several distributions (laplace
,pareto
,rayleigh
,invgauss
,logistic
,gumbel_l
,gumbel_r
); they now use analytical, distribution-specific maximumlikelihood estimation results for greater speed and accuracy than the generic
(numerical optimization) implementation.
The one-sample Cramér-von Mises test has been added as
scipy.stats.cramervonmises
.An option to compute one-sided p-values was added to
scipy.stats.ttest_1samp
,scipy.stats.ttest_ind_from_stats
,scipy.stats.ttest_ind
andscipy.stats.ttest_rel
.The function
scipy.stats.kendalltau
now has an option to compute Kendall'stau-c (also known as Stuart's tau-c), and support has been added for exact
p-value calculations for sample sizes
> 171
.stats.trapz
was renamed tostats.trapezoid
, with the former name retainedas an alias for backwards compatibility reasons.
The function
scipy.stats.linregress
now includes the standard error of theintercept in its return value.
The
_logpdf
,_sf
, and_isf
methods have been added toscipy.stats.nakagami
;_sf
and_isf
methods also added toscipy.stats.gumbel_r
The
sf
method has been added toscipy.stats.levy
andscipy.stats.levy_l
for improved precision.
scipy.stats.binned_statistic_dd
performance improvements for the followingcomputed statistics:
max
,min
,median
, andstd
.We gratefully acknowledge the Chan-Zuckerberg Initiative Essential Open Source
Software for Science program for supporting many of these improvements to
scipy.stats
.Deprecated features
scipy.spatial
changesCalling
KDTree.query
withk=None
to find all neighbours is deprecated.Use
KDTree.query_ball_point
instead.distance.wminkowski
was deprecated; usedistance.minkowski
and supplyweights with the
w
keyword instead.Backwards incompatible changes
scipy
changesUsing
scipy.fft
as a function aliasingnumpy.fft.fft
was removed afterbeing deprecated in SciPy
1.4.0
. As a result, thescipy.fft
submodulemust be explicitly imported now, in line with other SciPy subpackages.
scipy.signal
changesThe output of
decimate
,lfilter_zi
,lfiltic
,sos2tf
, andsosfilt_zi
have been changed to matchnumpy.result_type
of their inputs.The window function
slepian
was removed. It had been deprecated since SciPy1.1
.scipy.spatial
changescKDTree.query
now returns 64-bit rather than 32-bit integers on Windows,making behaviour consistent between platforms (PR gh-12673).
scipy.stats
changesThe
frechet_l
andfrechet_r
distributions were removed. They weredeprecated since SciPy
1.0
.Other changes
setup_requires
was removed fromsetup.py
. This means that usersinvoking
python setup.py install
without having numpy already installedwill now get an error, rather than having numpy installed for them via
easy_install
. This install method was always fragile and problematic, usersare encouraged to use
pip
when installing from source.scipy.optimize.dual_annealing
accept_reject
calculationthat caused uphill jumps to be accepted less frequently.
scipy.stats.rv_continuous
,scipy.stats.rv_discrete
, andscipy.stats.rv_frozen
has been significantlyreduced (gh12550). Inheriting subclasses should note that
__setstate__
nolonger calls
__init__
upon unpickling.Authors
A total of 122 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: 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 has been generated by Renovate Bot.
2a8f002361
to6a1a4a58ab