7 research outputs found

    scipy/scipy: SciPy 1.12.0rc1

    No full text
    <h1>SciPy 1.12.0 Release Notes</h1> <p>Note: SciPy <code>1.12.0</code> is not released yet!</p> <p>SciPy <code>1.12.0</code> is the culmination of <code>6</code> 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 <code>python -Wd</code> and check for <code>DeprecationWarning</code> s). Our development attention will now shift to bug-fix releases on the <code>1.12.x</code> branch, and on adding new features on the main branch.</p> <p>This release requires Python <code>3.9+</code> and NumPy <code>1.22.4</code> or greater.</p> <p>For running on PyPy, PyPy3 <code>6.0+</code> is required.</p> <h1>Highlights of this release</h1> <ul> <li>Experimental support for the array API standard has been added to part of <code>scipy.special</code>, and to all of <code>scipy.fft</code> and <code>scipy.cluster</code>. There are likely to be bugs and early feedback for usage with CuPy arrays, PyTorch tensors, and other array API compatible libraries is appreciated. Use the <code>SCIPY_ARRAY_API</code> environment variable for testing.</li> <li>A new class, <code>ShortTimeFFT</code>, provides a more versatile implementation of the short-time Fourier transform (STFT), its inverse (ISTFT) as well as the (cross-) spectrogram. It utilizes an improved algorithm for calculating the ISTFT.</li> <li>Several new constructors have been added for sparse arrays, and many operations now additionally support sparse arrays, further facilitating the migration from sparse matrices.</li> <li>A large portion of the <code>scipy.stats</code> API now has improved support for handling <code>NaN</code> values, masked arrays, and more fine-grained shape-handling. The accuracy and performance of a number of <code>stats</code> methods have been improved, and a number of new statistical tests and distributions have been added.</li> </ul> <h1>New features</h1> <h1><code>scipy.cluster</code> improvements</h1> <ul> <li>Experimental support added for the array API standard; PyTorch tensors, CuPy arrays and array API compatible array libraries are now accepted (GPU support is limited to functions with pure Python implementations). CPU arrays which can be converted to and from NumPy are supported module-wide and returned arrays will match the input type. This behaviour is enabled by setting the <code>SCIPY_ARRAY_API</code> environment variable before importing <code>scipy</code>. This experimental support is still under development and likely to contain bugs - testing is very welcome.</li> </ul> <h1><code>scipy.fft</code> improvements</h1> <ul> <li>Experimental support added for the array API standard; functions which are part of the <code>fft</code> array API standard extension module, as well as the Fast Hankel Transforms and the basic FFTs which are not in the extension module, now accept PyTorch tensors, CuPy arrays and array API compatible array libraries. CPU arrays which can be converted to and from NumPy arrays are supported module-wide and returned arrays will match the input type. This behaviour is enabled by setting the <code>SCIPY_ARRAY_API</code> environment variable before importing <code>scipy</code>. This experimental support is still under development and likely to contain bugs - testing is very welcome.</li> </ul> <h1><code>scipy.integrate</code> improvements</h1> <ul> <li>Added <code>scipy.integrate.cumulative_simpson</code> for cumulative quadrature from sampled data using Simpson's 1/3 rule.</li> </ul> <h1><code>scipy.interpolate</code> improvements</h1> <ul> <li>New class <code>NdBSpline</code> represents tensor-product splines in N dimensions. This class only knows how to evaluate a tensor product given coefficients and knot vectors. This way it generalizes <code>BSpline</code> for 1D data to N-D, and parallels <code>NdPPoly</code> (which represents N-D tensor product polynomials). Evaluations exploit the localized nature of b-splines.</li> <li><code>NearestNDInterpolator.__call__</code> accepts <code>**query_options</code>, which are passed through to the <code>KDTree.query</code> call to find nearest neighbors. This allows, for instance, to limit the neighbor search distance and parallelize the query using the <code>workers</code> keyword.</li> <li><code>BarycentricInterpolator</code> now allows computing the derivatives.</li> <li>It is now possible to change interpolation values in an existing <code>CloughTocher2DInterpolator</code> instance, while also saving the barycentric coordinates of interpolation points.</li> </ul> <h1><code>scipy.linalg</code> improvements</h1> <ul> <li>Access to new low-level LAPACK functions is provided via <code>dtgsyl</code> and <code>stgsyl</code>.</li> </ul> <h1><code>scipy.ndimage</code> improvements</h1> <h1><code>scipy.optimize</code> improvements</h1> <ul> <li><code>scipy.optimize.nnls</code> is rewritten in Python and now implements the so-called fnnls or fast nnls.</li> <li>The result object of <code>scipy.optimize.root</code> and <code>scipy.optimize.root_scalar</code> now reports the method used.</li> <li>The <code>callback</code> method of <code>scipy.optimize.differential_evolution</code> can now be passed more detailed information via the <code>intermediate_results</code> keyword parameter. Also, the evolution <code>strategy</code> now accepts a callable for additional customization. The performance of <code>differential_evolution</code> has also been improved.</li> <li><code>minimize</code> method <code>Newton-CG</code> has been made slightly more efficient.</li> <li><code>minimize</code> method <code>BFGS</code> now accepts an initial estimate for the inverse of the Hessian, which allows for more efficient workflows in some circumstances. The new parameter is <code>hess_inv0</code>.</li> <li><code>minimize</code> methods <code>CG</code>, <code>Newton-CG</code>, and <code>BFGS</code> now accept parameters <code>c1</code> and <code>c2</code>, allowing specification of the Armijo and curvature rule parameters, respectively.</li> <li><code>curve_fit</code> performance has improved due to more efficient memoization of the callable function.</li> <li><code>isotonic_regression</code> has been added to allow nonparametric isotonic regression.</li> </ul> <h1><code>scipy.signal</code> improvements</h1> <ul> <li><code>freqz</code>, <code>freqz_zpk</code>, and <code>group_delay</code> are now more accurate when <code>fs</code> has a default value.</li> <li>The new class <code>ShortTimeFFT</code> provides a more versatile implementation of the short-time Fourier transform (STFT), its inverse (ISTFT) as well as the (cross-) spectrogram. It utilizes an improved algorithm for calculating the ISTFT based on dual windows and provides more fine-grained control of the parametrization especially in regard to scaling and phase-shift. Functionality was implemented to ease working with signal and STFT chunks. A section has been added to the "SciPy User Guide" providing algorithmic details. The functions <code>stft</code>, <code>istft</code> and <code>spectrogram</code> have been marked as legacy.</li> </ul> <h1><code>scipy.sparse</code> improvements</h1> <ul> <li><code>sparse.linalg</code> iterative solvers <code>sparse.linalg.cg</code>, <code>sparse.linalg.cgs</code>, <code>sparse.linalg.bicg</code>, <code>sparse.linalg.bicgstab</code>, <code>sparse.linalg.gmres</code>, and <code>sparse.linalg.qmr</code> are rewritten in Python.</li> <li>Updated vendored SuperLU version to <code>6.0.1</code>, along with a few additional fixes.</li> <li>Sparse arrays have gained additional constructors: <code>eye_array</code>, <code>random_array</code>, <code>block_array</code>, and <code>identity</code>. <code>kron</code> and <code>kronsum</code> have been adjusted to additionally support operation on sparse arrays.</li> <li>Sparse matrices now support a transpose with <code>axes=(1, 0)</code>, to mirror the <code>.T</code> method.</li> <li><code>LaplacianNd</code> now allows selection of the largest subset of eigenvalues, and additionally now supports retrieval of the corresponding eigenvectors. The performance of <code>LaplacianNd</code> has also been improved.</li> <li>The performance of <code>dok_matrix</code> and <code>dok_array</code> has been improved, and their inheritance behavior should be more robust.</li> <li><code>hstack</code>, <code>vstack</code>, and <code>block_diag</code> now work with sparse arrays, and preserve the input sparse type.</li> <li>A new function, <code>scipy.sparse.linalg.matrix_power</code>, has been added, allowing for exponentiation of sparse arrays.</li> </ul> <h1><code>scipy.spatial</code> improvements</h1> <ul> <li>Two new methods were implemented for <code>spatial.transform.Rotation</code>: <code>__pow__</code> to raise a rotation to integer or fractional power and <code>approx_equal</code> to check if two rotations are approximately equal.</li> <li>The method <code>Rotation.align_vectors</code> was extended to solve a constrained alignment problem where two vectors are required to be aligned precisely. Also when given a single pair of vectors, the algorithm now returns the rotation with minimal magnitude, which can be considered as a minor backward incompatible change.</li> <li>A new representation for <code>spatial.transform.Rotation</code> called Davenport angles is available through <code>from_davenport</code> and <code>as_davenport</code> methods.</li> <li>Performance improvements have been added to <code>distance.hamming</code> and <code>distance.correlation</code>.</li> <li>Improved performance of <code>SphericalVoronoi</code> <code>sort_vertices_of_regions</code> and two dimensional area calculations.</li> </ul> <h1><code>scipy.special</code> improvements</h1> <ul> <li>Added <code>scipy.special.stirling2</code> for computation of Stirling numbers of the second kind. Both exact calculation and an asymptotic approximation (the default) are supported via <code>exact=True</code> and <code>exact=False</code> (the default) respectively.</li> <li>Added <code>scipy.special.betaincc</code> for computation of the complementary incomplete Beta function and <code>scipy.special.betainccinv</code> for computation of its inverse.</li> <li>Improved precision of <code>scipy.special.betainc</code> and <code>scipy.special.betaincinv</code></li> <li>Experimental support added for alternative backends: functions <code>scipy.special.log_ndtr</code>, <code>scipy.special.ndtr</code>, <code>scipy.special.ndtri</code>, <code>scipy.special.erf</code>, <code>scipy.special.erfc</code>, <code>scipy.special.i0</code>, <code>scipy.special.i0e</code>, <code>scipy.special.i1</code>, <code>scipy.special.i1e</code>, <code>scipy.special.gammaln</code>, <code>scipy.special.gammainc</code>, <code>scipy.special.gammaincc</code>, <code>scipy.special.logit</code>, and <code>scipy.special.expit</code> now accept PyTorch tensors and CuPy arrays. These features are still under development and likely to contain bugs, so they are disabled by default; enable them by setting a <code>SCIPY_ARRAY_API</code> environment variable to <code>1</code> before importing <code>scipy</code>. Testing is appreciated!</li> </ul> <h1><code>scipy.stats</code> improvements</h1> <ul> <li>Added <code>scipy.stats.quantile_test</code>, a nonparametric test of whether a hypothesized value is the quantile associated with a specified probability. The <code>confidence_interval</code> method of the result object gives a confidence interval of the quantile.</li> <li><code>scipy.stats.wasserstein_distance</code> now computes the Wasserstein distance in the multidimensional case.</li> <li><code>scipy.stats.sampling.FastGeneratorInversion</code> provides a convenient interface to fast random sampling via numerical inversion of distribution CDFs.</li> <li><code>scipy.stats.geometric_discrepancy</code> adds geometric/topological discrepancy metrics for random samples.</li> <li><code>scipy.stats.multivariate_normal</code> now has a <code>fit</code> method for fitting distribution parameters to data via maximum likelihood estimation.</li> <li><code>scipy.stats.bws_test</code> performs the Baumgartner-Weiss-Schindler test of whether two-samples were drawn from the same distribution.</li> <li><code>scipy.stats.jf_skew_t</code> implements the Jones and Faddy skew-t distribution.</li> <li><code>scipy.stats.anderson_ksamp</code> now supports a permutation version of the test using the <code>method</code> parameter.</li> <li>The <code>fit</code> methods of <code>scipy.stats.halfcauchy</code>, <code>scipy.stats.halflogistic</code>, and <code>scipy.stats.halfnorm</code> are faster and more accurate.</li> <li><code>scipy.stats.beta</code> <code>entropy</code> accuracy has been improved for extreme values of distribution parameters.</li> <li>The accuracy of <code>sf</code> and/or <code>isf</code> methods have been improved for several distributions: <code>scipy.stats.burr</code>, <code>scipy.stats.hypsecant</code>, <code>scipy.stats.kappa3</code>, <code>scipy.stats.loglaplace</code>, <code>scipy.stats.lognorm</code>, <code>scipy.stats.lomax</code>, <code>scipy.stats.pearson3</code>, <code>scipy.stats.rdist</code>, and <code>scipy.stats.pareto</code>.</li> <li>The following functions now support parameters <code>axis</code>, <code>nan_policy</code>, and <code>keep_dims</code>: <code>scipy.stats.entropy</code>, <code>scipy.stats.differential_entropy</code>, <code>scipy.stats.variation</code>, <code>scipy.stats.ansari</code>, <code>scipy.stats.bartlett</code>, <code>scipy.stats.levene</code>, <code>scipy.stats.fligner</code>, <code>scipy.stats.cirmean, </code>scipy.stats.circvar<code>, </code>scipy.stats.circstd<code>, </code>scipy.stats.tmean<code>, </code>scipy.stats.tvar<code>, </code>scipy.stats.tstd<code>, </code>scipy.stats.tmin<code>, </code>scipy.stats.tmax<code>, and </code>scipy.stats.tsem`.</li> <li>The <code>logpdf</code> and <code>fit</code> methods of <code>scipy.stats.skewnorm</code> have been improved.</li> <li>The beta negative binomial distribution is implemented as <code>scipy.stats.betanbinom</code>.</li> <li>The speed of <code>scipy.stats.invwishart</code> <code>rvs</code> and <code>logpdf</code> have been improved.</li> <li>A source of intermediate overflow in <code>scipy.stats.boxcox_normmax</code> with <code>method='mle'</code> has been eliminated, and the returned value of <code>lmbda</code> is constrained such that the transformed data will not overflow.</li> <li><code>scipy.stats.nakagami</code> <code>stats</code> is more accurate and reliable.</li> <li>A source of intermediate overflow in <code>scipy.norminvgauss.pdf</code> has been eliminated.</li> <li>Added support for masked arrays to <code>stats.circmean</code>, <code>stats.circvar</code>, <code>stats.circstd</code>, and <code>stats.entropy</code>.</li> <li><code>dirichlet</code> has gained a new covariance (<code>cov</code>) method.</li> <li>Improved accuracy of <code>multivariate_t</code> entropy with large degrees of freedom.</li> <li><code>loggamma</code> has an improved <code>entropy</code> method.</li> </ul> <h1>Deprecated features</h1> <ul> <li><p>Error messages have been made clearer for objects that don't exist in the public namespace and warnings sharpened for private attributes that are not supposed to be imported at all.</p> </li> <li><p><code>scipy.signal.cmplx_sort</code> has been deprecated and will be removed in SciPy 1.14. A replacement you can use is provided in the deprecation message.</p> </li> <li><p>Values the the argument <code>initial</code> of <code>scipy.integrate.cumulative_trapezoid</code> other than <code>0</code> and <code>None</code> are now deprecated.</p> </li> <li><p><code>scipy.stats.rvs_ratio_uniforms</code> is deprecated in favour of <code>scipy.stats.sampling.RatioUniforms</code></p> </li> <li><p><code>scipy.integrate.quadrature</code> and <code>scipy.integrate.romberg</code> have been deprecated due to accuracy issues and interface shortcomings. They will be removed in SciPy 1.14. Please use <code>scipy.integrate.quad</code> instead.</p> </li> <li><p>Coinciding with upcoming changes to function signatures (e.g. removal of a deprecated keyword), we are deprecating positional use of keyword arguments for the affected functions, which will raise an error starting with SciPy 1.14. In some cases, this has delayed the originally announced removal date, to give time to respond to the second part of the deprecation. Affected functions are:</p> <ul> <li><code>linalg.{eigh, eigvalsh, pinv}</code></li> <li><code>integrate.simpson</code></li> <li><code>signal.{firls, firwin, firwin2, remez}</code></li> <li><code>sparse.linalg.{bicg, bicgstab, cg, cgs, gcrotmk, gmres, lgmres, minres, qmr, tfqmr}</code></li> <li><code>special.comb</code></li> <li><code>stats.kendalltau</code></li> </ul> </li> <li><p>All wavelet functions have been deprecated, as PyWavelets provides suitable implementations; affected functions are: <code>signal.{daub, qmf, cascade, morlet, morlet2, ricker, cwt}</code></p> </li> </ul> <h1>Expired Deprecations</h1> <p>There is an ongoing effort to follow through on long-standing deprecations. The following previously deprecated features are affected:</p> <ul> <li>The <code>centered</code> keyword of <code>stats.qmc.LatinHypercube</code> has been removed. Use <code>scrambled=False</code> instead of <code>centered=True</code>.</l

    scipy/scipy: SciPy 1.12.0

    No full text
    <h1>SciPy 1.12.0 Release Notes</h1> <p>SciPy <code>1.12.0</code> is the culmination of <code>6</code> 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 <code>python -Wd</code> and check for <code>DeprecationWarning</code> s). Our development attention will now shift to bug-fix releases on the 1.12.x branch, and on adding new features on the main branch.</p> <p>This release requires Python <code>3.9+</code> and NumPy <code>1.22.4</code> or greater.</p> <p>For running on PyPy, PyPy3 <code>6.0+</code> is required.</p> <h1>Highlights of this release</h1> <ul> <li>Experimental support for the array API standard has been added to part of <code>scipy.special</code>, and to all of <code>scipy.fft</code> and <code>scipy.cluster</code>. There are likely to be bugs and early feedback for usage with CuPy arrays, PyTorch tensors, and other array API compatible libraries is appreciated. Use the <code>SCIPY_ARRAY_API</code> environment variable for testing.</li> <li>A new class, <code>ShortTimeFFT</code>, provides a more versatile implementation of the short-time Fourier transform (STFT), its inverse (ISTFT) as well as the (cross-) spectrogram. It utilizes an improved algorithm for calculating the ISTFT.</li> <li>Several new constructors have been added for sparse arrays, and many operations now additionally support sparse arrays, further facilitating the migration from sparse matrices.</li> <li>A large portion of the <code>scipy.stats</code> API now has improved support for handling <code>NaN</code> values, masked arrays, and more fine-grained shape-handling. The accuracy and performance of a number of <code>stats</code> methods have been improved, and a number of new statistical tests and distributions have been added.</li> </ul> <h1>New features</h1> <h1><code>scipy.cluster</code> improvements</h1> <ul> <li>Experimental support added for the array API standard; PyTorch tensors, CuPy arrays and array API compatible array libraries are now accepted (GPU support is limited to functions with pure Python implementations). CPU arrays which can be converted to and from NumPy are supported module-wide and returned arrays will match the input type. This behaviour is enabled by setting the <code>SCIPY_ARRAY_API</code> environment variable before importing <code>scipy</code>. This experimental support is still under development and likely to contain bugs - testing is very welcome.</li> </ul> <h1><code>scipy.fft</code> improvements</h1> <ul> <li>Experimental support added for the array API standard; functions which are part of the <code>fft</code> array API standard extension module, as well as the Fast Hankel Transforms and the basic FFTs which are not in the extension module, now accept PyTorch tensors, CuPy arrays and array API compatible array libraries. CPU arrays which can be converted to and from NumPy arrays are supported module-wide and returned arrays will match the input type. This behaviour is enabled by setting the <code>SCIPY_ARRAY_API</code> environment variable before importing <code>scipy</code>. This experimental support is still under development and likely to contain bugs - testing is very welcome.</li> </ul> <h1><code>scipy.integrate</code> improvements</h1> <ul> <li>Added <code>scipy.integrate.cumulative_simpson</code> for cumulative quadrature from sampled data using Simpson's 1/3 rule.</li> </ul> <h1><code>scipy.interpolate</code> improvements</h1> <ul> <li>New class <code>NdBSpline</code> represents tensor-product splines in N dimensions. This class only knows how to evaluate a tensor product given coefficients and knot vectors. This way it generalizes <code>BSpline</code> for 1D data to N-D, and parallels <code>NdPPoly</code> (which represents N-D tensor product polynomials). Evaluations exploit the localized nature of b-splines.</li> <li><code>NearestNDInterpolator.__call__</code> accepts <code>**query_options</code>, which are passed through to the <code>KDTree.query</code> call to find nearest neighbors. This allows, for instance, to limit the neighbor search distance and parallelize the query using the <code>workers</code> keyword.</li> <li><code>BarycentricInterpolator</code> now allows computing the derivatives.</li> <li>It is now possible to change interpolation values in an existing <code>CloughTocher2DInterpolator</code> instance, while also saving the barycentric coordinates of interpolation points.</li> </ul> <h1><code>scipy.linalg</code> improvements</h1> <ul> <li>Access to new low-level LAPACK functions is provided via <code>dtgsyl</code> and <code>stgsyl</code>.</li> </ul> <h1><code>scipy.optimize</code> improvements</h1> <ul> <li><code>scipy.optimize.isotonic_regression</code> has been added to allow nonparametric isotonic regression.</li> <li><code>scipy.optimize.nnls</code> is rewritten in Python and now implements the so-called fnnls or fast nnls, making it more efficient for high-dimensional problems.</li> <li>The result object of <code>scipy.optimize.root</code> and <code>scipy.optimize.root_scalar</code> now reports the method used.</li> <li>The <code>callback</code> method of <code>scipy.optimize.differential_evolution</code> can now be passed more detailed information via the <code>intermediate_results</code> keyword parameter. Also, the evolution <code>strategy</code> now accepts a callable for additional customization. The performance of <code>differential_evolution</code> has also been improved.</li> <li><code>scipy.optimize.minimize</code> method <code>Newton-CG</code> now supports functions that return sparse Hessian matrices/arrays for the <code>hess</code> parameter and is slightly more efficient.</li> <li><code>scipy.optimize.minimize</code> method <code>BFGS</code> now accepts an initial estimate for the inverse of the Hessian, which allows for more efficient workflows in some circumstances. The new parameter is <code>hess_inv0</code>.</li> <li><code>scipy.optimize.minimize</code> methods <code>CG</code>, <code>Newton-CG</code>, and <code>BFGS</code> now accept parameters <code>c1</code> and <code>c2</code>, allowing specification of the Armijo and curvature rule parameters, respectively.</li> <li><code>scipy.optimize.curve_fit</code> performance has improved due to more efficient memoization of the callable function.</li> </ul> <h1><code>scipy.signal</code> improvements</h1> <ul> <li><code>freqz</code>, <code>freqz_zpk</code>, and <code>group_delay</code> are now more accurate when <code>fs</code> has a default value.</li> <li>The new class <code>ShortTimeFFT</code> provides a more versatile implementation of the short-time Fourier transform (STFT), its inverse (ISTFT) as well as the (cross-) spectrogram. It utilizes an improved algorithm for calculating the ISTFT based on dual windows and provides more fine-grained control of the parametrization especially in regard to scaling and phase-shift. Functionality was implemented to ease working with signal and STFT chunks. A section has been added to the "SciPy User Guide" providing algorithmic details. The functions <code>stft</code>, <code>istft</code> and <code>spectrogram</code> have been marked as legacy.</li> </ul> <h1><code>scipy.sparse</code> improvements</h1> <ul> <li><code>sparse.linalg</code> iterative solvers <code>sparse.linalg.cg</code>, <code>sparse.linalg.cgs</code>, <code>sparse.linalg.bicg</code>, <code>sparse.linalg.bicgstab</code>, <code>sparse.linalg.gmres</code>, and <code>sparse.linalg.qmr</code> are rewritten in Python.</li> <li>Updated vendored SuperLU version to <code>6.0.1</code>, along with a few additional fixes.</li> <li>Sparse arrays have gained additional constructors: <code>eye_array</code>, <code>random_array</code>, <code>block_array</code>, and <code>identity</code>. <code>kron</code> and <code>kronsum</code> have been adjusted to additionally support operation on sparse arrays.</li> <li>Sparse matrices now support a transpose with <code>axes=(1, 0)</code>, to mirror the <code>.T</code> method.</li> <li><code>LaplacianNd</code> now allows selection of the largest subset of eigenvalues, and additionally now supports retrieval of the corresponding eigenvectors. The performance of <code>LaplacianNd</code> has also been improved.</li> <li>The performance of <code>dok_matrix</code> and <code>dok_array</code> has been improved, and their inheritance behavior should be more robust.</li> <li><code>hstack</code>, <code>vstack</code>, and <code>block_diag</code> now work with sparse arrays, and preserve the input sparse type.</li> <li>A new function, <code>scipy.sparse.linalg.matrix_power</code>, has been added, allowing for exponentiation of sparse arrays.</li> </ul> <h1><code>scipy.spatial</code> improvements</h1> <ul> <li>Two new methods were implemented for <code>spatial.transform.Rotation</code>: <code>__pow__</code> to raise a rotation to integer or fractional power and <code>approx_equal</code> to check if two rotations are approximately equal.</li> <li>The method <code>Rotation.align_vectors</code> was extended to solve a constrained alignment problem where two vectors are required to be aligned precisely. Also when given a single pair of vectors, the algorithm now returns the rotation with minimal magnitude, which can be considered as a minor backward incompatible change.</li> <li>A new representation for <code>spatial.transform.Rotation</code> called Davenport angles is available through <code>from_davenport</code> and <code>as_davenport</code> methods.</li> <li>Performance improvements have been added to <code>distance.hamming</code> and <code>distance.correlation</code>.</li> <li>Improved performance of <code>SphericalVoronoi</code> <code>sort_vertices_of_regions</code> and two dimensional area calculations.</li> </ul> <h1><code>scipy.special</code> improvements</h1> <ul> <li>Added <code>scipy.special.stirling2</code> for computation of Stirling numbers of the second kind. Both exact calculation and an asymptotic approximation (the default) are supported via <code>exact=True</code> and <code>exact=False</code> (the default) respectively.</li> <li>Added <code>scipy.special.betaincc</code> for computation of the complementary incomplete Beta function and <code>scipy.special.betainccinv</code> for computation of its inverse.</li> <li>Improved precision of <code>scipy.special.betainc</code> and <code>scipy.special.betaincinv</code>.</li> <li>Experimental support added for alternative backends: functions <code>scipy.special.log_ndtr</code>, <code>scipy.special.ndtr</code>, <code>scipy.special.ndtri</code>, <code>scipy.special.erf</code>, <code>scipy.special.erfc</code>, <code>scipy.special.i0</code>, <code>scipy.special.i0e</code>, <code>scipy.special.i1</code>, <code>scipy.special.i1e</code>, <code>scipy.special.gammaln</code>, <code>scipy.special.gammainc</code>, <code>scipy.special.gammaincc</code>, <code>scipy.special.logit</code>, and <code>scipy.special.expit</code> now accept PyTorch tensors and CuPy arrays. These features are still under development and likely to contain bugs, so they are disabled by default; enable them by setting a <code>SCIPY_ARRAY_API</code> environment variable to <code>1</code> before importing <code>scipy</code>. Testing is appreciated!</li> </ul> <h1><code>scipy.stats</code> improvements</h1> <ul> <li>Added <code>scipy.stats.quantile_test</code>, a nonparametric test of whether a hypothesized value is the quantile associated with a specified probability. The <code>confidence_interval</code> method of the result object gives a confidence interval of the quantile.</li> <li><code>scipy.stats.sampling.FastGeneratorInversion</code> provides a convenient interface to fast random sampling via numerical inversion of distribution CDFs.</li> <li><code>scipy.stats.geometric_discrepancy</code> adds geometric/topological discrepancy metrics for random samples.</li> <li><code>scipy.stats.multivariate_normal</code> now has a <code>fit</code> method for fitting distribution parameters to data via maximum likelihood estimation.</li> <li><code>scipy.stats.bws_test</code> performs the Baumgartner-Weiss-Schindler test of whether two-samples were drawn from the same distribution.</li> <li><code>scipy.stats.jf_skew_t</code> implements the Jones and Faddy skew-t distribution.</li> <li><code>scipy.stats.anderson_ksamp</code> now supports a permutation version of the test using the <code>method</code> parameter.</li> <li>The <code>fit</code> methods of <code>scipy.stats.halfcauchy</code>, <code>scipy.stats.halflogistic</code>, and <code>scipy.stats.halfnorm</code> are faster and more accurate.</li> <li><code>scipy.stats.beta</code> <code>entropy</code> accuracy has been improved for extreme values of distribution parameters.</li> <li>The accuracy of <code>sf</code> and/or <code>isf</code> methods have been improved for several distributions: <code>scipy.stats.burr</code>, <code>scipy.stats.hypsecant</code>, <code>scipy.stats.kappa3</code>, <code>scipy.stats.loglaplace</code>, <code>scipy.stats.lognorm</code>, <code>scipy.stats.lomax</code>, <code>scipy.stats.pearson3</code>, <code>scipy.stats.rdist</code>, and <code>scipy.stats.pareto</code>.</li> <li>The following functions now support parameters <code>axis</code>, <code>nan_policy</code>, and <code>keep_dims</code>: <code>scipy.stats.entropy</code>, <code>scipy.stats.differential_entropy</code>, <code>scipy.stats.variation</code>, <code>scipy.stats.ansari</code>, <code>scipy.stats.bartlett</code>, <code>scipy.stats.levene</code>, <code>scipy.stats.fligner</code>, <code>scipy.stats.circmean</code>, <code>scipy.stats.circvar</code>, <code>scipy.stats.circstd</code>, <code>scipy.stats.tmean</code>, <code>scipy.stats.tvar</code>, <code>scipy.stats.tstd</code>, <code>scipy.stats.tmin</code>, <code>scipy.stats.tmax</code>, and <code>scipy.stats.tsem</code>.</li> <li>The <code>logpdf</code> and <code>fit</code> methods of <code>scipy.stats.skewnorm</code> have been improved.</li> <li>The beta negative binomial distribution is implemented as <code>scipy.stats.betanbinom</code>.</li> <li>Improved performance of <code>scipy.stats.invwishart</code> <code>rvs</code> and <code>logpdf</code>.</li> <li>A source of intermediate overflow in <code>scipy.stats.boxcox_normmax</code> with <code>method='mle'</code> has been eliminated, and the returned value of <code>lmbda</code> is constrained such that the transformed data will not overflow.</li> <li><code>scipy.stats.nakagami</code> <code>stats</code> is more accurate and reliable.</li> <li>A source of intermediate overflow in <code>scipy.norminvgauss.pdf</code> has been eliminated.</li> <li>Added support for masked arrays to <code>scipy.stats.circmean</code>, <code>scipy.stats.circvar</code>, <code>scipy.stats.circstd</code>, and <code>scipy.stats.entropy</code>.</li> <li><code>scipy.stats.dirichlet</code> has gained a new covariance (<code>cov</code>) method.</li> <li>Improved accuracy of <code>entropy</code> method of <code>scipy.stats.multivariate_t</code> for large degrees of freedom.</li> <li><code>scipy.stats.loggamma</code> has an improved <code>entropy</code> method.</li> </ul> <h1>Deprecated features</h1> <ul> <li><p>Error messages have been made clearer for objects that don't exist in the public namespace and warnings sharpened for private attributes that are not supposed to be imported at all.</p> </li> <li><p><code>scipy.signal.cmplx_sort</code> has been deprecated and will be removed in SciPy 1.15. A replacement you can use is provided in the deprecation message.</p> </li> <li><p>Values the the argument <code>initial</code> of <code>scipy.integrate.cumulative_trapezoid</code> other than <code>0</code> and <code>None</code> are now deprecated.</p> </li> <li><p><code>scipy.stats.rvs_ratio_uniforms</code> is deprecated in favour of <code>scipy.stats.sampling.RatioUniforms</code></p> </li> <li><p><code>scipy.integrate.quadrature</code> and <code>scipy.integrate.romberg</code> have been deprecated due to accuracy issues and interface shortcomings. They will be removed in SciPy 1.15. Please use <code>scipy.integrate.quad</code> instead.</p> </li> <li><p>Coinciding with upcoming changes to function signatures (e.g. removal of a deprecated keyword), we are deprecating positional use of keyword arguments for the affected functions, which will raise an error starting with SciPy 1.14. In some cases, this has delayed the originally announced removal date, to give time to respond to the second part of the deprecation. Affected functions are:</p> <ul> <li><code>linalg.{eigh, eigvalsh, pinv}</code></li> <li><code>integrate.simpson</code></li> <li><code>signal.{firls, firwin, firwin2, remez}</code></li> <li><code>sparse.linalg.{bicg, bicgstab, cg, cgs, gcrotmk, gmres, lgmres, minres, qmr, tfqmr}</code></li> <li><code>special.comb</code></li> <li><code>stats.kendalltau</code></li> </ul> </li> <li><p>All wavelet functions have been deprecated, as PyWavelets provides suitable implementations; affected functions are: <code>signal.{daub, qmf, cascade, morlet, morlet2, ricker, cwt}</code></p> </li> <li><p><code>scipy.integrate.trapz</code>, <code>scipy.integrate.cumtrapz</code>, and <code>scipy.integrate.simps</code> have been deprecated in favour of <code>scipy.integrate.trapezoid</code>, <code>scipy.integrate.cumulative_trapezoid</code>, and <code>scipy.integrate.simpson</code> respectively and will be removed in SciPy 1.14.</p&g
    corecore