SciPy 0.19.0 Release Notes#
SciPy 0.19.0 is the culmination of 7 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. Moreover, our development attention will now shift to bug-fix releases on the 0.19.x branch, and on adding new features on the master branch.
This release requires Python 2.7 or 3.4-3.6 and NumPy 1.8.2 or greater.
Highlights of this release include:
A unified foreign function interface layer,
Cython API for scalar, typed versions of the universal functions from the
scipy.specialmodule, via cimport scipy.special.cython_special.
Foreign function interface improvements#
scipy.LowLevelCallable provides a new unified interface for wrapping
low-level compiled callback functions in the Python space. It supports
Cython imported “api” functions, ctypes function pointers, CFFI function
PyCapsules, Numba jitted functions and more.
See gh-6509 for details.
scipy.linalg.solve obtained two more keywords
transposed. The underlying LAPACK routines are replaced with “expert”
versions and now can also be used to solve symmetric, hermitian and positive
definite coefficient matrices. Moreover, ill-conditioned matrices now cause
a warning to be emitted with the estimated condition number information. Old
sym_pos keyword is kept for backwards compatibility reasons however it
is identical to using
assume_a='pos'. Moreover, the
which had no function but only printing the
overwrite_<a, b> values, is
scipy.linalg.matrix_balance was added to perform the so-called
matrix balancing using the LAPACK xGEBAL routine family. This can be used to
approximately equate the row and column norms through diagonal similarity
scipy.linalg.solve_discrete_are have numerically more stable algorithms.
These functions can also solve generalized algebraic matrix Riccati equations.
Moreover, both gained a
balanced keyword to turn balancing on and off.
scipy.spatial.SphericalVoronoi.sort_vertices_of_regions has been re-written in
Cython to improve performance.
scipy.spatial.SphericalVoronoi can handle > 200 k points (at least 10 million)
and has improved performance.
added to calculate the directed Hausdorff distance.
count_neighbors method of
scipy.spatial.cKDTree gained an ability to
perform weighted pair counting via the new keywords
cumulative. See gh-5647 for
scipy.spatial.distance.cdist now support
non-double custom metrics.
The callback function C API supports PyCapsules in Python 2.7
Multidimensional filters now allow having different extrapolation modes for different axes.
scipy.optimize.basinhopping global minimizer obtained a new keyword,
seed, which can be used to seed the random number generator and obtain
The keyword sigma in
scipy.optimize.curve_fit was overloaded to also accept
the covariance matrix of errors in the data.
scipy.signal.convolve have a new
optional parameter method. The default value of auto estimates the fastest
of two computation methods, the direct approach and the Fourier transform
A new function has been added to choose the convolution/correlation method,
scipy.signal.choose_conv_method which may be appropriate if convolutions or
correlations are performed on many arrays of the same size.
New functions have been added to calculate complex short time fourier
transforms of an input signal, and to invert the transform to recover the
implementation also fixes the previously incorrect output of
scipy.signal.spectrogram when complex output data were requested.
scipy.signal.sosfreqz was added to compute the frequency
response from second-order sections.
scipy.signal.unit_impulse was added to conveniently
generate an impulse function.
scipy.signal.iirnotch was added to design second-order
IIR notch filters that can be used to remove a frequency component from
a signal. The dual function
scipy.signal.iirpeak was added to
compute the coefficients of a second-order IIR peak (resonant) filter.
scipy.signal.minimum_phase was added to convert linear-phase
FIR filters to minimum phase.
scipy.signal.resample_poly are now
substantially faster when operating on some n-dimensional arrays when n > 1.
The largest reduction in computation time is realized in cases where the size
of the array is small (<1k samples or so) along the axis to be filtered.
Fast Fourier transform routines now accept np.float16 inputs and upcast them to np.float32. Previously, they would raise an error.
have been significantly sped up. Long-standing issues with using
large input data (over 16 GB) have been resolved.
scipy.sparse.load_npz were added,
providing simple serialization for some sparse formats.
The prune method of classes bsr_matrix, csc_matrix, and csr_matrix was updated to reallocate backing arrays under certain conditions, reducing memory usage.
The methods argmin and argmax were added to classes coo_matrix, csc_matrix, csr_matrix, and bsr_matrix.
scipy.sparse.csgraph.structural_rank computes the structural
rank of a graph with a given sparsity pattern.
scipy.sparse.linalg.spsolve_triangular solves a sparse linear
system with a triangular left hand side matrix.
Scalar, typed versions of universal functions from
scipy.special are available
in the Cython space via
cimport from the new module
scipy.special.cython_special. These scalar functions can be expected to be
significantly faster then the universal functions for scalar arguments. See
scipy.special tutorial for details.
Better control over special-function errors is offered by the
scipy.special.seterr and the
The names of orthogonal polynomial root functions have been changed to
be consistent with other functions relating to orthogonal
polynomials. For example,
scipy.special.j_roots has been renamed
scipy.special.roots_jacobi for consistency with the related
preserve back-compatibility the old names have been left as aliases.
Wright Omega function is implemented as
scipy.stats.weightedtau was added. It provides a weighted
version of Kendall’s tau.
scipy.stats.multinomial implements the multinomial distribution.
scipy.stats.rv_histogram constructs a continuous univariate
distribution with a piecewise linear CDF from a binned data sample.
scipy.stats.argus implements the Argus distribution.
scipy.interpolate.BSpline represents splines.
contain knots and coefficients and can evaluate the spline. The format is
consistent with FITPACK, so that one can do, for example:
>>> t, c, k = splrep(x, y, s=0) >>> spl = BSpline(t, c, k) >>> np.allclose(spl(x), y)
scipy.interpolate.splantider, accept both
BSpline objects and
(t, c, k) tuples for backwards compatibility.
For multidimensional splines,
c.ndim > 1,
BSpline objects are consistent
with piecewise polynomials,
scipy.interpolate.PPoly. This means that
BSpline objects are not immediately consistent with
scipy.interpolate.splprep, and one cannot do
>>> BSpline(*splprep([x, y])). Consult the
scipy.interpolate test suite
for examples of the precise equivalence.
In new code, prefer using
scipy.interpolate.BSpline objects instead of
(t, c, k) tuples directly.
scipy.interpolate.make_interp_spline constructs an interpolating
spline given data points and boundary conditions.
scipy.interpolate.make_lsq_spline constructs a least-squares
spline approximation given data points.
scipy.integrate.fixed_quad supports vector-valued functions.
scipy.interpolate.splmake, scipy.interpolate.spleval and scipy.interpolate.spline are deprecated. The format used by splmake/spleval was inconsistent with splrep/splev which was confusing to users.
scipy.special.errprint is deprecated. Improved functionality is
arguments not needed by the chosen metric is deprecated. Also, metrics
“old_cosine” and “old_cos” are deprecated.
Backwards incompatible changes#
scipy.weave submodule was removed.
scipy.spatial.distance.squareform now returns arrays of the same dtype as
the input, instead of always float64.
scipy.special.errprint now returns a boolean.
scipy.signal.find_peaks_cwt now returns an array instead of
scipy.stats.kendalltau now computes the correct p-value in case the
input contains ties. The p-value is also identical to that computed by
scipy.stats.mstats.kendalltau and by R. If the input does not
contain ties there is no change w.r.t. the previous implementation.
scipy.linalg.block_diag will not ignore zero-sized matrices anymore.
Instead it will insert rows or columns of zeros of the appropriate size.
See gh-4908 for more details.
SciPy wheels will now report their dependency on
numpy on all platforms.
This change was made because Numpy wheels are available, and because the pip
upgrade behavior is finally changing for the better (use
pip >= 8.2; that behavior will
become the default in the next major version of
Numerical values returned by
"quadratic" may change relative to previous scipy versions. If your
code depended on specific numeric values (i.e., on implementation
details of the interpolators), you may want to double-check your results.