- SciPy 0.19.0 Release Notes
- New features
- Foreign function interface improvements
- scipy.linalg improvements
- scipy.spatial improvements
- scipy.ndimage improvements
- scipy.optimize improvements
- scipy.signal improvements
- scipy.fftpack improvements
- scipy.cluster improvements
- scipy.sparse improvements
- scipy.special improvements
- scipy.stats improvements
- scipy.interpolate improvements
- scipy.integrate improvements
- Deprecated features
- Backwards incompatible changes
- Other changes
- New features
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, scipy.LowLevelCallable.
- Cython API for scalar, typed versions of the universal functions from the scipy.special module, via cimport scipy.special.cython_special.
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 pointers, PyCapsules, Numba jitted functions and more. See gh-6509 for details.
The function scipy.linalg.solve obtained two more keywords assume_a and 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 debug keyword, which had no function but only printing the overwrite_<a, b> values, is deprecated.
The function 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 transformations.
The functions scipy.linalg.solve_continuous_are and 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.
The function scipy.spatial.distance.directed_hausdorff was added to calculate the directed Hausdorff distance.
The callback function C API supports PyCapsules in Python 2.7
Multidimensional filters now allow having different extrapolation modes for different axes.
The scipy.optimize.basinhopping global minimizer obtained a new keyword, seed, which can be used to seed the random number generator and obtain repeatable minimizations.
The keyword sigma in scipy.optimize.curve_fit was overloaded to also accept the covariance matrix of errors in the data.
The function scipy.signal.correlate and 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 approach.
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 original signal: scipy.signal.stft and scipy.signal.istft. This implementation also fixes the previously incorrect ouput of scipy.signal.spectrogram when complex output data were requested.
The function scipy.signal.sosfreqz was added to compute the frequency response from second-order sections.
The function scipy.signal.unit_impulse was added to conveniently generate an impulse function.
The 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.
The function scipy.signal.minimum_phase was added to convert linear-phase FIR filters to minimum phase.
The functions scipy.signal.upfirdn and 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.
Methods "centroid" and "median" of scipy.cluster.hierarchy.linkage have been significantly sped up. Long-standing issues with using linkage on large input data (over 16 GB) have been resolved.
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.
New function scipy.sparse.csgraph.structural_rank computes the structural rank of a graph with a given sparsity pattern.
New function 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 the scipy.special tutorial for details.
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 functions scipy.special.jacobi and scipy.special.eval_jacobi. To preserve back-compatibility the old names have been left as aliases.
Wright Omega function is implemented as scipy.special.wrightomega.
The function scipy.stats.weightedtau was added. It provides a weighted version of Kendall’s tau.
New class scipy.stats.multinomial implements the multinomial distribution.
New class scipy.stats.rv_histogram constructs a continuous univariate distribution with a piecewise linear CDF from a binned data sample.
New class scipy.stats.argus implements the Argus distribution.
New class scipy.interpolate.BSpline represents splines. BSpline objects 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)
spl* functions, scipy.interpolate.splev, scipy.interpolate.splint, scipy.interpolate.splder and 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 manipulating (t, c, k) tuples directly.
New function scipy.interpolate.make_interp_spline constructs an interpolating spline given data points and boundary conditions.
New function scipy.interpolate.make_lsq_spline constructs a least-squares spline approximation given data points.
scipy.special.errprint is deprecated. Improved functionality is available in scipy.special.seterr.
The deprecated 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.
The function scipy.signal.find_peaks_cwt now returns an array instead of a list.
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.
The function 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 --upgrade-strategy=only-if-needed for pip >= 8.2; that behavior will become the default in the next major version of pip).
Numerical values returned by scipy.interpolate.interp1d with kind="cubic" and "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.