Search for a command to run...
# 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, <code>scipy.LowLevelCallable</code>. Cython API for scalar, typed versions of the universal functions from the <code>scipy.special</code> module, via <code>cimport scipy.special.cython_special</code>. New features Foreign function interface improvements <code>scipy.LowLevelCallable</code> 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, <code>PyCapsules</code>, Numba jitted functions and more. See <code>gh-6509 <https://github.com/scipy/scipy/pull/6509></code>_ for details. <code>scipy.linalg</code> improvements The function <code>scipy.linalg.solve</code> obtained two more keywords <code>assume_a</code> and <code>transposed</code>. 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 <code>sym_pos</code> keyword is kept for backwards compatibility reasons however it is identical to using <code>assume_a='pos'</code>. Moreover, the <code>debug</code> keyword, which had no function but only printing the <code>overwrite_<a, b></code> values, is deprecated. The function <code>scipy.linalg.matrix_balance</code> 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 <code>scipy.linalg.solve_continuous_are</code> and <code>scipy.linalg.solve_discrete_are</code> have numerically more stable algorithms. These functions can also solve generalized algebraic matrix Riccati equations. Moreover, both gained a <code>balanced</code> keyword to turn balancing on and off. <code>scipy.spatial</code> improvements <code>scipy.spatial.SphericalVoronoi.sort_vertices_of_regions</code> has been re-written in Cython to improve performance. <code>scipy.spatial.SphericalVoronoi</code> can handle > 200 k points (at least 10 million) and has improved performance. The function <code>scipy.spatial.distance.directed_hausdorff</code> was added to calculate the directed Hausdorff distance. <code>count_neighbors</code> method of <code>scipy.spatial.cKDTree</code> gained an ability to perform weighted pair counting via the new keywords <code>weights</code> and <code>cumulative</code>. See <code>gh-5647 <https://github.com/scipy/scipy/pull/5647></code>_ for details. <code>scipy.spatial.distance.pdist</code> and <code>scipy.spatial.distance.cdist</code> now support non-double custom metrics. <code>scipy.ndimage</code> improvements The callback function C API supports PyCapsules in Python 2.7 Multidimensional filters now allow having different extrapolation modes for different axes. <code>scipy.optimize</code> improvements The <code>scipy.optimize.basinhopping</code> global minimizer obtained a new keyword, <code>seed</code>, which can be used to seed the random number generator and obtain repeatable minimizations. The keyword <code>sigma</code> in <code>scipy.optimize.curve_fit</code> was overloaded to also accept the covariance matrix of errors in the data. <code>scipy.signal</code> improvements The function <code>scipy.signal.correlate</code> and <code>scipy.signal.convolve</code> have a new optional parameter <code>method</code>. The default value of <code>auto</code> 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, <code>scipy.signal.choose_conv_method</code> 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: <code>scipy.signal.stft</code> and <code>scipy.signal.istft</code>. This implementation also fixes the previously incorrect ouput of <code>scipy.signal.spectrogram</code> when complex output data were requested. The function <code>scipy.signal.sosfreqz</code> was added to compute the frequency response from second-order sections. The function <code>scipy.signal.unit_impulse</code> was added to conveniently generate an impulse function. The function <code>scipy.signal.iirnotch</code> was added to design second-order IIR notch filters that can be used to remove a frequency component from a signal. The dual function <code>scipy.signal.iirpeak</code> was added to compute the coefficients of a second-order IIR peak (resonant) filter. The function <code>scipy.signal.minimum_phase</code> was added to convert linear-phase FIR filters to minimum phase. The functions <code>scipy.signal.upfirdn</code> and <code>scipy.signal.resample_poly</code> 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. <code>scipy.fftpack</code> improvements Fast Fourier transform routines now accept <code>np.float16</code> inputs and upcast them to <code>np.float32</code>. Previously, they would raise an error. <code>scipy.cluster</code> improvements Methods <code>"centroid"</code> and <code>"median"</code> of <code>scipy.cluster.hierarchy.linkage</code> have been significantly sped up. Long-standing issues with using <code>linkage</code> on large input data (over 16 GB) have been resolved. <code>scipy.sparse</code> improvements The functions <code>scipy.sparse.save_npz</code> and <code>scipy.sparse.load_npz</code> were added, providing simple serialization for some sparse formats. The <code>prune</code> method of classes <code>bsr_matrix</code>, <code>csc_matrix</code>, and <code>csr_matrix</code> was updated to reallocate backing arrays under certain conditions, reducing memory usage. The methods <code>argmin</code> and <code>argmax</code> were added to classes <code>coo_matrix</code>, <code>csc_matrix</code>, <code>csr_matrix</code>, and <code>bsr_matrix</code>. New function <code>scipy.sparse.csgraph.structural_rank</code> computes the structural rank of a graph with a given sparsity pattern. New function <code>scipy.sparse.linalg.spsolve_triangular</code> solves a sparse linear system with a triangular left hand side matrix. <code>scipy.special</code> improvements Scalar, typed versions of universal functions from <code>scipy.special</code> are available in the Cython space via <code>cimport</code> from the new module <code>scipy.special.cython_special</code>. These scalar functions can be expected to be significantly faster then the universal functions for scalar arguments. See the <code>scipy.special</code> tutorial for details. Better control over special-function errors is offered by the functions <code>scipy.special.geterr</code> and <code>scipy.special.seterr</code> and the context manager <code>scipy.special.errstate</code>. The names of orthogonal polynomial root functions have been changed to be consistent with other functions relating to orthogonal polynomials. For example, <code>scipy.special.j_roots</code> has been renamed <code>scipy.special.roots_jacobi</code> for consistency with the related functions <code>scipy.special.jacobi</code> and <code>scipy.special.eval_jacobi</code>. To preserve back-compatibility the old names have been left as aliases. Wright Omega function is implemented as <code>scipy.special.wrightomega</code>. <code>scipy.stats</code> improvements The function <code>scipy.stats.weightedtau</code> was added. It provides a weighted version of Kendall's tau. New class <code>scipy.stats.multinomial</code> implements the multinomial distribution. New class <code>scipy.stats.rv_histogram</code> constructs a continuous univariate distribution with a piecewise linear CDF from a binned data sample. New class <code>scipy.stats.argus</code> implements the Argus distribution. <code>scipy.interpolate</code> improvements New class <code>scipy.interpolate.BSpline</code> represents splines. <code>BSpline</code> objects contain knots and coefficients and can evaluate the spline. The format is consistent with FITPACK, so that one can do, for example:: <code>>>> t, c, k = splrep(x, y, s=0) >>> spl = BSpline(t, c, k) >>> np.allclose(spl(x), y) </code> <code>spl*</code> functions, <code>scipy.interpolate.splev</code>, <code>scipy.interpolate.splint</code>, <code>scipy.interpolate.splder</code> and <code>scipy.interpolate.splantider</code>, accept both <code>BSpline</code> objects and <code>(t, c, k)</code> tuples for backwards compatibility. For multidimensional splines, <code>c.ndim > 1</code>, <code>BSpline</code> objects are consistent with piecewise polynomials, <code>scipy.interpolate.PPoly</code>. This means that <code>BSpline</code> objects are not immediately consistent with <code>scipy.interpolate.splprep</code>, and one <em>cannot</em> do <code>>>> BSpline(*splprep([x, y])[0])</code>. Consult the <code>scipy.interpolate</code> test suite for