scipy 1.16.2__cp313-cp313-win_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scipy/__config__.py +161 -0
- scipy/__init__.py +150 -0
- scipy/_cyutility.cp313-win_arm64.lib +0 -0
- scipy/_cyutility.cp313-win_arm64.pyd +0 -0
- scipy/_distributor_init.py +18 -0
- scipy/_lib/__init__.py +14 -0
- scipy/_lib/_array_api.py +931 -0
- scipy/_lib/_array_api_compat_vendor.py +9 -0
- scipy/_lib/_array_api_no_0d.py +103 -0
- scipy/_lib/_bunch.py +229 -0
- scipy/_lib/_ccallback.py +251 -0
- scipy/_lib/_ccallback_c.cp313-win_arm64.lib +0 -0
- scipy/_lib/_ccallback_c.cp313-win_arm64.pyd +0 -0
- scipy/_lib/_disjoint_set.py +254 -0
- scipy/_lib/_docscrape.py +761 -0
- scipy/_lib/_elementwise_iterative_method.py +346 -0
- scipy/_lib/_fpumode.cp313-win_arm64.lib +0 -0
- scipy/_lib/_fpumode.cp313-win_arm64.pyd +0 -0
- scipy/_lib/_gcutils.py +105 -0
- scipy/_lib/_pep440.py +487 -0
- scipy/_lib/_sparse.py +41 -0
- scipy/_lib/_test_ccallback.cp313-win_arm64.lib +0 -0
- scipy/_lib/_test_ccallback.cp313-win_arm64.pyd +0 -0
- scipy/_lib/_test_deprecation_call.cp313-win_arm64.lib +0 -0
- scipy/_lib/_test_deprecation_call.cp313-win_arm64.pyd +0 -0
- scipy/_lib/_test_deprecation_def.cp313-win_arm64.lib +0 -0
- scipy/_lib/_test_deprecation_def.cp313-win_arm64.pyd +0 -0
- scipy/_lib/_testutils.py +373 -0
- scipy/_lib/_threadsafety.py +58 -0
- scipy/_lib/_tmpdirs.py +86 -0
- scipy/_lib/_uarray/LICENSE +29 -0
- scipy/_lib/_uarray/__init__.py +116 -0
- scipy/_lib/_uarray/_backend.py +707 -0
- scipy/_lib/_uarray/_uarray.cp313-win_arm64.lib +0 -0
- scipy/_lib/_uarray/_uarray.cp313-win_arm64.pyd +0 -0
- scipy/_lib/_util.py +1283 -0
- scipy/_lib/array_api_compat/__init__.py +22 -0
- scipy/_lib/array_api_compat/_internal.py +59 -0
- scipy/_lib/array_api_compat/common/__init__.py +1 -0
- scipy/_lib/array_api_compat/common/_aliases.py +727 -0
- scipy/_lib/array_api_compat/common/_fft.py +213 -0
- scipy/_lib/array_api_compat/common/_helpers.py +1058 -0
- scipy/_lib/array_api_compat/common/_linalg.py +232 -0
- scipy/_lib/array_api_compat/common/_typing.py +192 -0
- scipy/_lib/array_api_compat/cupy/__init__.py +13 -0
- scipy/_lib/array_api_compat/cupy/_aliases.py +156 -0
- scipy/_lib/array_api_compat/cupy/_info.py +336 -0
- scipy/_lib/array_api_compat/cupy/_typing.py +31 -0
- scipy/_lib/array_api_compat/cupy/fft.py +36 -0
- scipy/_lib/array_api_compat/cupy/linalg.py +49 -0
- scipy/_lib/array_api_compat/dask/__init__.py +0 -0
- scipy/_lib/array_api_compat/dask/array/__init__.py +12 -0
- scipy/_lib/array_api_compat/dask/array/_aliases.py +376 -0
- scipy/_lib/array_api_compat/dask/array/_info.py +416 -0
- scipy/_lib/array_api_compat/dask/array/fft.py +21 -0
- scipy/_lib/array_api_compat/dask/array/linalg.py +72 -0
- scipy/_lib/array_api_compat/numpy/__init__.py +28 -0
- scipy/_lib/array_api_compat/numpy/_aliases.py +190 -0
- scipy/_lib/array_api_compat/numpy/_info.py +366 -0
- scipy/_lib/array_api_compat/numpy/_typing.py +30 -0
- scipy/_lib/array_api_compat/numpy/fft.py +35 -0
- scipy/_lib/array_api_compat/numpy/linalg.py +143 -0
- scipy/_lib/array_api_compat/torch/__init__.py +22 -0
- scipy/_lib/array_api_compat/torch/_aliases.py +855 -0
- scipy/_lib/array_api_compat/torch/_info.py +369 -0
- scipy/_lib/array_api_compat/torch/_typing.py +3 -0
- scipy/_lib/array_api_compat/torch/fft.py +85 -0
- scipy/_lib/array_api_compat/torch/linalg.py +121 -0
- scipy/_lib/array_api_extra/__init__.py +38 -0
- scipy/_lib/array_api_extra/_delegation.py +171 -0
- scipy/_lib/array_api_extra/_lib/__init__.py +1 -0
- scipy/_lib/array_api_extra/_lib/_at.py +463 -0
- scipy/_lib/array_api_extra/_lib/_backends.py +46 -0
- scipy/_lib/array_api_extra/_lib/_funcs.py +937 -0
- scipy/_lib/array_api_extra/_lib/_lazy.py +357 -0
- scipy/_lib/array_api_extra/_lib/_testing.py +278 -0
- scipy/_lib/array_api_extra/_lib/_utils/__init__.py +1 -0
- scipy/_lib/array_api_extra/_lib/_utils/_compat.py +74 -0
- scipy/_lib/array_api_extra/_lib/_utils/_compat.pyi +45 -0
- scipy/_lib/array_api_extra/_lib/_utils/_helpers.py +559 -0
- scipy/_lib/array_api_extra/_lib/_utils/_typing.py +10 -0
- scipy/_lib/array_api_extra/_lib/_utils/_typing.pyi +105 -0
- scipy/_lib/array_api_extra/testing.py +359 -0
- scipy/_lib/cobyqa/__init__.py +20 -0
- scipy/_lib/cobyqa/framework.py +1240 -0
- scipy/_lib/cobyqa/main.py +1506 -0
- scipy/_lib/cobyqa/models.py +1529 -0
- scipy/_lib/cobyqa/problem.py +1296 -0
- scipy/_lib/cobyqa/settings.py +132 -0
- scipy/_lib/cobyqa/subsolvers/__init__.py +14 -0
- scipy/_lib/cobyqa/subsolvers/geometry.py +387 -0
- scipy/_lib/cobyqa/subsolvers/optim.py +1203 -0
- scipy/_lib/cobyqa/utils/__init__.py +18 -0
- scipy/_lib/cobyqa/utils/exceptions.py +22 -0
- scipy/_lib/cobyqa/utils/math.py +77 -0
- scipy/_lib/cobyqa/utils/versions.py +67 -0
- scipy/_lib/decorator.py +399 -0
- scipy/_lib/deprecation.py +274 -0
- scipy/_lib/doccer.py +366 -0
- scipy/_lib/messagestream.cp313-win_arm64.lib +0 -0
- scipy/_lib/messagestream.cp313-win_arm64.pyd +0 -0
- scipy/_lib/pyprima/__init__.py +212 -0
- scipy/_lib/pyprima/cobyla/__init__.py +0 -0
- scipy/_lib/pyprima/cobyla/cobyla.py +559 -0
- scipy/_lib/pyprima/cobyla/cobylb.py +714 -0
- scipy/_lib/pyprima/cobyla/geometry.py +226 -0
- scipy/_lib/pyprima/cobyla/initialize.py +215 -0
- scipy/_lib/pyprima/cobyla/trustregion.py +492 -0
- scipy/_lib/pyprima/cobyla/update.py +289 -0
- scipy/_lib/pyprima/common/__init__.py +0 -0
- scipy/_lib/pyprima/common/_bounds.py +34 -0
- scipy/_lib/pyprima/common/_linear_constraints.py +46 -0
- scipy/_lib/pyprima/common/_nonlinear_constraints.py +54 -0
- scipy/_lib/pyprima/common/_project.py +173 -0
- scipy/_lib/pyprima/common/checkbreak.py +93 -0
- scipy/_lib/pyprima/common/consts.py +47 -0
- scipy/_lib/pyprima/common/evaluate.py +99 -0
- scipy/_lib/pyprima/common/history.py +38 -0
- scipy/_lib/pyprima/common/infos.py +30 -0
- scipy/_lib/pyprima/common/linalg.py +435 -0
- scipy/_lib/pyprima/common/message.py +290 -0
- scipy/_lib/pyprima/common/powalg.py +131 -0
- scipy/_lib/pyprima/common/preproc.py +277 -0
- scipy/_lib/pyprima/common/present.py +5 -0
- scipy/_lib/pyprima/common/ratio.py +54 -0
- scipy/_lib/pyprima/common/redrho.py +47 -0
- scipy/_lib/pyprima/common/selectx.py +296 -0
- scipy/_lib/tests/__init__.py +0 -0
- scipy/_lib/tests/test__gcutils.py +110 -0
- scipy/_lib/tests/test__pep440.py +67 -0
- scipy/_lib/tests/test__testutils.py +32 -0
- scipy/_lib/tests/test__threadsafety.py +51 -0
- scipy/_lib/tests/test__util.py +641 -0
- scipy/_lib/tests/test_array_api.py +322 -0
- scipy/_lib/tests/test_bunch.py +169 -0
- scipy/_lib/tests/test_ccallback.py +196 -0
- scipy/_lib/tests/test_config.py +45 -0
- scipy/_lib/tests/test_deprecation.py +10 -0
- scipy/_lib/tests/test_doccer.py +143 -0
- scipy/_lib/tests/test_import_cycles.py +18 -0
- scipy/_lib/tests/test_public_api.py +482 -0
- scipy/_lib/tests/test_scipy_version.py +28 -0
- scipy/_lib/tests/test_tmpdirs.py +48 -0
- scipy/_lib/tests/test_warnings.py +137 -0
- scipy/_lib/uarray.py +31 -0
- scipy/cluster/__init__.py +31 -0
- scipy/cluster/_hierarchy.cp313-win_arm64.lib +0 -0
- scipy/cluster/_hierarchy.cp313-win_arm64.pyd +0 -0
- scipy/cluster/_optimal_leaf_ordering.cp313-win_arm64.lib +0 -0
- scipy/cluster/_optimal_leaf_ordering.cp313-win_arm64.pyd +0 -0
- scipy/cluster/_vq.cp313-win_arm64.lib +0 -0
- scipy/cluster/_vq.cp313-win_arm64.pyd +0 -0
- scipy/cluster/hierarchy.py +4348 -0
- scipy/cluster/tests/__init__.py +0 -0
- scipy/cluster/tests/hierarchy_test_data.py +145 -0
- scipy/cluster/tests/test_disjoint_set.py +202 -0
- scipy/cluster/tests/test_hierarchy.py +1238 -0
- scipy/cluster/tests/test_vq.py +434 -0
- scipy/cluster/vq.py +832 -0
- scipy/conftest.py +683 -0
- scipy/constants/__init__.py +358 -0
- scipy/constants/_codata.py +2266 -0
- scipy/constants/_constants.py +369 -0
- scipy/constants/codata.py +21 -0
- scipy/constants/constants.py +53 -0
- scipy/constants/tests/__init__.py +0 -0
- scipy/constants/tests/test_codata.py +78 -0
- scipy/constants/tests/test_constants.py +83 -0
- scipy/datasets/__init__.py +90 -0
- scipy/datasets/_download_all.py +71 -0
- scipy/datasets/_fetchers.py +225 -0
- scipy/datasets/_registry.py +26 -0
- scipy/datasets/_utils.py +81 -0
- scipy/datasets/tests/__init__.py +0 -0
- scipy/datasets/tests/test_data.py +128 -0
- scipy/differentiate/__init__.py +27 -0
- scipy/differentiate/_differentiate.py +1129 -0
- scipy/differentiate/tests/__init__.py +0 -0
- scipy/differentiate/tests/test_differentiate.py +694 -0
- scipy/fft/__init__.py +114 -0
- scipy/fft/_backend.py +196 -0
- scipy/fft/_basic.py +1650 -0
- scipy/fft/_basic_backend.py +197 -0
- scipy/fft/_debug_backends.py +22 -0
- scipy/fft/_fftlog.py +223 -0
- scipy/fft/_fftlog_backend.py +200 -0
- scipy/fft/_helper.py +348 -0
- scipy/fft/_pocketfft/LICENSE.md +25 -0
- scipy/fft/_pocketfft/__init__.py +9 -0
- scipy/fft/_pocketfft/basic.py +251 -0
- scipy/fft/_pocketfft/helper.py +249 -0
- scipy/fft/_pocketfft/pypocketfft.cp313-win_arm64.lib +0 -0
- scipy/fft/_pocketfft/pypocketfft.cp313-win_arm64.pyd +0 -0
- scipy/fft/_pocketfft/realtransforms.py +109 -0
- scipy/fft/_pocketfft/tests/__init__.py +0 -0
- scipy/fft/_pocketfft/tests/test_basic.py +1011 -0
- scipy/fft/_pocketfft/tests/test_real_transforms.py +505 -0
- scipy/fft/_realtransforms.py +706 -0
- scipy/fft/_realtransforms_backend.py +63 -0
- scipy/fft/tests/__init__.py +0 -0
- scipy/fft/tests/mock_backend.py +96 -0
- scipy/fft/tests/test_backend.py +98 -0
- scipy/fft/tests/test_basic.py +504 -0
- scipy/fft/tests/test_fftlog.py +215 -0
- scipy/fft/tests/test_helper.py +558 -0
- scipy/fft/tests/test_multithreading.py +84 -0
- scipy/fft/tests/test_real_transforms.py +247 -0
- scipy/fftpack/__init__.py +103 -0
- scipy/fftpack/_basic.py +428 -0
- scipy/fftpack/_helper.py +115 -0
- scipy/fftpack/_pseudo_diffs.py +554 -0
- scipy/fftpack/_realtransforms.py +598 -0
- scipy/fftpack/basic.py +20 -0
- scipy/fftpack/convolve.cp313-win_arm64.lib +0 -0
- scipy/fftpack/convolve.cp313-win_arm64.pyd +0 -0
- scipy/fftpack/helper.py +19 -0
- scipy/fftpack/pseudo_diffs.py +22 -0
- scipy/fftpack/realtransforms.py +19 -0
- scipy/fftpack/tests/__init__.py +0 -0
- scipy/fftpack/tests/fftw_double_ref.npz +0 -0
- scipy/fftpack/tests/fftw_longdouble_ref.npz +0 -0
- scipy/fftpack/tests/fftw_single_ref.npz +0 -0
- scipy/fftpack/tests/test.npz +0 -0
- scipy/fftpack/tests/test_basic.py +877 -0
- scipy/fftpack/tests/test_helper.py +54 -0
- scipy/fftpack/tests/test_import.py +33 -0
- scipy/fftpack/tests/test_pseudo_diffs.py +388 -0
- scipy/fftpack/tests/test_real_transforms.py +836 -0
- scipy/integrate/__init__.py +122 -0
- scipy/integrate/_bvp.py +1160 -0
- scipy/integrate/_cubature.py +729 -0
- scipy/integrate/_dop.cp313-win_arm64.lib +0 -0
- scipy/integrate/_dop.cp313-win_arm64.pyd +0 -0
- scipy/integrate/_ivp/__init__.py +8 -0
- scipy/integrate/_ivp/base.py +290 -0
- scipy/integrate/_ivp/bdf.py +478 -0
- scipy/integrate/_ivp/common.py +451 -0
- scipy/integrate/_ivp/dop853_coefficients.py +193 -0
- scipy/integrate/_ivp/ivp.py +755 -0
- scipy/integrate/_ivp/lsoda.py +224 -0
- scipy/integrate/_ivp/radau.py +572 -0
- scipy/integrate/_ivp/rk.py +601 -0
- scipy/integrate/_ivp/tests/__init__.py +0 -0
- scipy/integrate/_ivp/tests/test_ivp.py +1287 -0
- scipy/integrate/_ivp/tests/test_rk.py +37 -0
- scipy/integrate/_lebedev.py +5450 -0
- scipy/integrate/_lsoda.cp313-win_arm64.lib +0 -0
- scipy/integrate/_lsoda.cp313-win_arm64.pyd +0 -0
- scipy/integrate/_ode.py +1395 -0
- scipy/integrate/_odepack.cp313-win_arm64.lib +0 -0
- scipy/integrate/_odepack.cp313-win_arm64.pyd +0 -0
- scipy/integrate/_odepack_py.py +273 -0
- scipy/integrate/_quad_vec.py +674 -0
- scipy/integrate/_quadpack.cp313-win_arm64.lib +0 -0
- scipy/integrate/_quadpack.cp313-win_arm64.pyd +0 -0
- scipy/integrate/_quadpack_py.py +1283 -0
- scipy/integrate/_quadrature.py +1336 -0
- scipy/integrate/_rules/__init__.py +12 -0
- scipy/integrate/_rules/_base.py +518 -0
- scipy/integrate/_rules/_gauss_kronrod.py +202 -0
- scipy/integrate/_rules/_gauss_legendre.py +62 -0
- scipy/integrate/_rules/_genz_malik.py +210 -0
- scipy/integrate/_tanhsinh.py +1385 -0
- scipy/integrate/_test_multivariate.cp313-win_arm64.lib +0 -0
- scipy/integrate/_test_multivariate.cp313-win_arm64.pyd +0 -0
- scipy/integrate/_test_odeint_banded.cp313-win_arm64.lib +0 -0
- scipy/integrate/_test_odeint_banded.cp313-win_arm64.pyd +0 -0
- scipy/integrate/_vode.cp313-win_arm64.lib +0 -0
- scipy/integrate/_vode.cp313-win_arm64.pyd +0 -0
- scipy/integrate/dop.py +15 -0
- scipy/integrate/lsoda.py +15 -0
- scipy/integrate/odepack.py +17 -0
- scipy/integrate/quadpack.py +23 -0
- scipy/integrate/tests/__init__.py +0 -0
- scipy/integrate/tests/test__quad_vec.py +211 -0
- scipy/integrate/tests/test_banded_ode_solvers.py +305 -0
- scipy/integrate/tests/test_bvp.py +714 -0
- scipy/integrate/tests/test_cubature.py +1375 -0
- scipy/integrate/tests/test_integrate.py +840 -0
- scipy/integrate/tests/test_odeint_jac.py +74 -0
- scipy/integrate/tests/test_quadpack.py +680 -0
- scipy/integrate/tests/test_quadrature.py +730 -0
- scipy/integrate/tests/test_tanhsinh.py +1171 -0
- scipy/integrate/vode.py +15 -0
- scipy/interpolate/__init__.py +228 -0
- scipy/interpolate/_bary_rational.py +715 -0
- scipy/interpolate/_bsplines.py +2469 -0
- scipy/interpolate/_cubic.py +973 -0
- scipy/interpolate/_dfitpack.cp313-win_arm64.lib +0 -0
- scipy/interpolate/_dfitpack.cp313-win_arm64.pyd +0 -0
- scipy/interpolate/_dierckx.cp313-win_arm64.lib +0 -0
- scipy/interpolate/_dierckx.cp313-win_arm64.pyd +0 -0
- scipy/interpolate/_fitpack.cp313-win_arm64.lib +0 -0
- scipy/interpolate/_fitpack.cp313-win_arm64.pyd +0 -0
- scipy/interpolate/_fitpack2.py +2397 -0
- scipy/interpolate/_fitpack_impl.py +811 -0
- scipy/interpolate/_fitpack_py.py +898 -0
- scipy/interpolate/_fitpack_repro.py +996 -0
- scipy/interpolate/_interpnd.cp313-win_arm64.lib +0 -0
- scipy/interpolate/_interpnd.cp313-win_arm64.pyd +0 -0
- scipy/interpolate/_interpolate.py +2266 -0
- scipy/interpolate/_ndbspline.py +415 -0
- scipy/interpolate/_ndgriddata.py +329 -0
- scipy/interpolate/_pade.py +67 -0
- scipy/interpolate/_polyint.py +1025 -0
- scipy/interpolate/_ppoly.cp313-win_arm64.lib +0 -0
- scipy/interpolate/_ppoly.cp313-win_arm64.pyd +0 -0
- scipy/interpolate/_rbf.py +290 -0
- scipy/interpolate/_rbfinterp.py +550 -0
- scipy/interpolate/_rbfinterp_pythran.cp313-win_arm64.lib +0 -0
- scipy/interpolate/_rbfinterp_pythran.cp313-win_arm64.pyd +0 -0
- scipy/interpolate/_rgi.py +764 -0
- scipy/interpolate/_rgi_cython.cp313-win_arm64.lib +0 -0
- scipy/interpolate/_rgi_cython.cp313-win_arm64.pyd +0 -0
- scipy/interpolate/dfitpack.py +24 -0
- scipy/interpolate/fitpack.py +31 -0
- scipy/interpolate/fitpack2.py +29 -0
- scipy/interpolate/interpnd.py +24 -0
- scipy/interpolate/interpolate.py +30 -0
- scipy/interpolate/ndgriddata.py +23 -0
- scipy/interpolate/polyint.py +24 -0
- scipy/interpolate/rbf.py +18 -0
- scipy/interpolate/tests/__init__.py +0 -0
- scipy/interpolate/tests/data/bug-1310.npz +0 -0
- scipy/interpolate/tests/data/estimate_gradients_hang.npy +0 -0
- scipy/interpolate/tests/data/gcvspl.npz +0 -0
- scipy/interpolate/tests/test_bary_rational.py +368 -0
- scipy/interpolate/tests/test_bsplines.py +3754 -0
- scipy/interpolate/tests/test_fitpack.py +519 -0
- scipy/interpolate/tests/test_fitpack2.py +1431 -0
- scipy/interpolate/tests/test_gil.py +64 -0
- scipy/interpolate/tests/test_interpnd.py +452 -0
- scipy/interpolate/tests/test_interpolate.py +2630 -0
- scipy/interpolate/tests/test_ndgriddata.py +308 -0
- scipy/interpolate/tests/test_pade.py +107 -0
- scipy/interpolate/tests/test_polyint.py +972 -0
- scipy/interpolate/tests/test_rbf.py +246 -0
- scipy/interpolate/tests/test_rbfinterp.py +534 -0
- scipy/interpolate/tests/test_rgi.py +1151 -0
- scipy/io/__init__.py +116 -0
- scipy/io/_fast_matrix_market/__init__.py +600 -0
- scipy/io/_fast_matrix_market/_fmm_core.cp313-win_arm64.lib +0 -0
- scipy/io/_fast_matrix_market/_fmm_core.cp313-win_arm64.pyd +0 -0
- scipy/io/_fortran.py +354 -0
- scipy/io/_harwell_boeing/__init__.py +7 -0
- scipy/io/_harwell_boeing/_fortran_format_parser.py +316 -0
- scipy/io/_harwell_boeing/hb.py +571 -0
- scipy/io/_harwell_boeing/tests/__init__.py +0 -0
- scipy/io/_harwell_boeing/tests/test_fortran_format.py +74 -0
- scipy/io/_harwell_boeing/tests/test_hb.py +70 -0
- scipy/io/_idl.py +917 -0
- scipy/io/_mmio.py +968 -0
- scipy/io/_netcdf.py +1104 -0
- scipy/io/_test_fortran.cp313-win_arm64.lib +0 -0
- scipy/io/_test_fortran.cp313-win_arm64.pyd +0 -0
- scipy/io/arff/__init__.py +28 -0
- scipy/io/arff/_arffread.py +873 -0
- scipy/io/arff/arffread.py +19 -0
- scipy/io/arff/tests/__init__.py +0 -0
- scipy/io/arff/tests/data/iris.arff +225 -0
- scipy/io/arff/tests/data/missing.arff +8 -0
- scipy/io/arff/tests/data/nodata.arff +11 -0
- scipy/io/arff/tests/data/quoted_nominal.arff +13 -0
- scipy/io/arff/tests/data/quoted_nominal_spaces.arff +13 -0
- scipy/io/arff/tests/data/test1.arff +10 -0
- scipy/io/arff/tests/data/test10.arff +8 -0
- scipy/io/arff/tests/data/test11.arff +11 -0
- scipy/io/arff/tests/data/test2.arff +15 -0
- scipy/io/arff/tests/data/test3.arff +6 -0
- scipy/io/arff/tests/data/test4.arff +11 -0
- scipy/io/arff/tests/data/test5.arff +26 -0
- scipy/io/arff/tests/data/test6.arff +12 -0
- scipy/io/arff/tests/data/test7.arff +15 -0
- scipy/io/arff/tests/data/test8.arff +12 -0
- scipy/io/arff/tests/data/test9.arff +14 -0
- scipy/io/arff/tests/test_arffread.py +421 -0
- scipy/io/harwell_boeing.py +17 -0
- scipy/io/idl.py +17 -0
- scipy/io/matlab/__init__.py +66 -0
- scipy/io/matlab/_byteordercodes.py +75 -0
- scipy/io/matlab/_mio.py +375 -0
- scipy/io/matlab/_mio4.py +632 -0
- scipy/io/matlab/_mio5.py +901 -0
- scipy/io/matlab/_mio5_params.py +281 -0
- scipy/io/matlab/_mio5_utils.cp313-win_arm64.lib +0 -0
- scipy/io/matlab/_mio5_utils.cp313-win_arm64.pyd +0 -0
- scipy/io/matlab/_mio_utils.cp313-win_arm64.lib +0 -0
- scipy/io/matlab/_mio_utils.cp313-win_arm64.pyd +0 -0
- scipy/io/matlab/_miobase.py +435 -0
- scipy/io/matlab/_streams.cp313-win_arm64.lib +0 -0
- scipy/io/matlab/_streams.cp313-win_arm64.pyd +0 -0
- scipy/io/matlab/byteordercodes.py +17 -0
- scipy/io/matlab/mio.py +16 -0
- scipy/io/matlab/mio4.py +17 -0
- scipy/io/matlab/mio5.py +19 -0
- scipy/io/matlab/mio5_params.py +18 -0
- scipy/io/matlab/mio5_utils.py +17 -0
- scipy/io/matlab/mio_utils.py +17 -0
- scipy/io/matlab/miobase.py +16 -0
- scipy/io/matlab/streams.py +16 -0
- scipy/io/matlab/tests/__init__.py +0 -0
- scipy/io/matlab/tests/data/bad_miuint32.mat +0 -0
- scipy/io/matlab/tests/data/bad_miutf8_array_name.mat +0 -0
- scipy/io/matlab/tests/data/big_endian.mat +0 -0
- scipy/io/matlab/tests/data/broken_utf8.mat +0 -0
- scipy/io/matlab/tests/data/corrupted_zlib_checksum.mat +0 -0
- scipy/io/matlab/tests/data/corrupted_zlib_data.mat +0 -0
- scipy/io/matlab/tests/data/debigged_m4.mat +0 -0
- scipy/io/matlab/tests/data/japanese_utf8.txt +5 -0
- scipy/io/matlab/tests/data/little_endian.mat +0 -0
- scipy/io/matlab/tests/data/logical_sparse.mat +0 -0
- scipy/io/matlab/tests/data/malformed1.mat +0 -0
- scipy/io/matlab/tests/data/miuint32_for_miint32.mat +0 -0
- scipy/io/matlab/tests/data/miutf8_array_name.mat +0 -0
- scipy/io/matlab/tests/data/nasty_duplicate_fieldnames.mat +0 -0
- scipy/io/matlab/tests/data/one_by_zero_char.mat +0 -0
- scipy/io/matlab/tests/data/parabola.mat +0 -0
- scipy/io/matlab/tests/data/single_empty_string.mat +0 -0
- scipy/io/matlab/tests/data/some_functions.mat +0 -0
- scipy/io/matlab/tests/data/sqr.mat +0 -0
- scipy/io/matlab/tests/data/test3dmatrix_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/test3dmatrix_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/test3dmatrix_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/test3dmatrix_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/test_empty_struct.mat +0 -0
- scipy/io/matlab/tests/data/test_mat4_le_floats.mat +0 -0
- scipy/io/matlab/tests/data/test_skip_variable.mat +0 -0
- scipy/io/matlab/tests/data/testbool_8_WIN64.mat +0 -0
- scipy/io/matlab/tests/data/testcell_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testcell_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcell_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcell_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcellnest_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testcellnest_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcellnest_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcellnest_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcomplex_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testcomplex_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testcomplex_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcomplex_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcomplex_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testdouble_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testdouble_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testdouble_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testdouble_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testdouble_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testemptycell_5.3_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testemptycell_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testemptycell_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testemptycell_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testfunc_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testhdf5_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testmatrix_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testmatrix_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testmatrix_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testmatrix_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testmatrix_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testminus_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testminus_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testminus_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testminus_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testminus_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testmulti_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testmulti_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testmulti_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testobject_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testobject_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testobject_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testobject_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testonechar_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testonechar_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testonechar_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testonechar_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testonechar_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testscalarcell_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsimplecell.mat +0 -0
- scipy/io/matlab/tests/data/testsparse_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testsparse_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testsparse_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparse_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparse_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparsecomplex_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testsparsecomplex_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testsparsecomplex_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparsecomplex_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparsecomplex_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparsefloat_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststring_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststring_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststring_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststring_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststring_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststringarray_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststringarray_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststringarray_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststringarray_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststringarray_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststruct_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststruct_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststruct_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststruct_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructarr_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststructarr_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructarr_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructarr_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructnest_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststructnest_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructnest_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructnest_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testunicode_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testunicode_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testvec_4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/test_byteordercodes.py +29 -0
- scipy/io/matlab/tests/test_mio.py +1399 -0
- scipy/io/matlab/tests/test_mio5_utils.py +179 -0
- scipy/io/matlab/tests/test_mio_funcs.py +51 -0
- scipy/io/matlab/tests/test_mio_utils.py +45 -0
- scipy/io/matlab/tests/test_miobase.py +32 -0
- scipy/io/matlab/tests/test_pathological.py +33 -0
- scipy/io/matlab/tests/test_streams.py +241 -0
- scipy/io/mmio.py +17 -0
- scipy/io/netcdf.py +17 -0
- scipy/io/tests/__init__.py +0 -0
- scipy/io/tests/data/Transparent Busy.ani +0 -0
- scipy/io/tests/data/array_float32_1d.sav +0 -0
- scipy/io/tests/data/array_float32_2d.sav +0 -0
- scipy/io/tests/data/array_float32_3d.sav +0 -0
- scipy/io/tests/data/array_float32_4d.sav +0 -0
- scipy/io/tests/data/array_float32_5d.sav +0 -0
- scipy/io/tests/data/array_float32_6d.sav +0 -0
- scipy/io/tests/data/array_float32_7d.sav +0 -0
- scipy/io/tests/data/array_float32_8d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_1d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_2d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_3d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_4d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_5d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_6d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_7d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_8d.sav +0 -0
- scipy/io/tests/data/example_1.nc +0 -0
- scipy/io/tests/data/example_2.nc +0 -0
- scipy/io/tests/data/example_3_maskedvals.nc +0 -0
- scipy/io/tests/data/fortran-3x3d-2i.dat +0 -0
- scipy/io/tests/data/fortran-mixed.dat +0 -0
- scipy/io/tests/data/fortran-sf8-11x1x10.dat +0 -0
- scipy/io/tests/data/fortran-sf8-15x10x22.dat +0 -0
- scipy/io/tests/data/fortran-sf8-1x1x1.dat +0 -0
- scipy/io/tests/data/fortran-sf8-1x1x5.dat +0 -0
- scipy/io/tests/data/fortran-sf8-1x1x7.dat +0 -0
- scipy/io/tests/data/fortran-sf8-1x3x5.dat +0 -0
- scipy/io/tests/data/fortran-si4-11x1x10.dat +0 -0
- scipy/io/tests/data/fortran-si4-15x10x22.dat +0 -0
- scipy/io/tests/data/fortran-si4-1x1x1.dat +0 -0
- scipy/io/tests/data/fortran-si4-1x1x5.dat +0 -0
- scipy/io/tests/data/fortran-si4-1x1x7.dat +0 -0
- scipy/io/tests/data/fortran-si4-1x3x5.dat +0 -0
- scipy/io/tests/data/invalid_pointer.sav +0 -0
- scipy/io/tests/data/null_pointer.sav +0 -0
- scipy/io/tests/data/scalar_byte.sav +0 -0
- scipy/io/tests/data/scalar_byte_descr.sav +0 -0
- scipy/io/tests/data/scalar_complex32.sav +0 -0
- scipy/io/tests/data/scalar_complex64.sav +0 -0
- scipy/io/tests/data/scalar_float32.sav +0 -0
- scipy/io/tests/data/scalar_float64.sav +0 -0
- scipy/io/tests/data/scalar_heap_pointer.sav +0 -0
- scipy/io/tests/data/scalar_int16.sav +0 -0
- scipy/io/tests/data/scalar_int32.sav +0 -0
- scipy/io/tests/data/scalar_int64.sav +0 -0
- scipy/io/tests/data/scalar_string.sav +0 -0
- scipy/io/tests/data/scalar_uint16.sav +0 -0
- scipy/io/tests/data/scalar_uint32.sav +0 -0
- scipy/io/tests/data/scalar_uint64.sav +0 -0
- scipy/io/tests/data/struct_arrays.sav +0 -0
- scipy/io/tests/data/struct_arrays_byte_idl80.sav +0 -0
- scipy/io/tests/data/struct_arrays_replicated.sav +0 -0
- scipy/io/tests/data/struct_arrays_replicated_3d.sav +0 -0
- scipy/io/tests/data/struct_inherit.sav +0 -0
- scipy/io/tests/data/struct_pointer_arrays.sav +0 -0
- scipy/io/tests/data/struct_pointer_arrays_replicated.sav +0 -0
- scipy/io/tests/data/struct_pointer_arrays_replicated_3d.sav +0 -0
- scipy/io/tests/data/struct_pointers.sav +0 -0
- scipy/io/tests/data/struct_pointers_replicated.sav +0 -0
- scipy/io/tests/data/struct_pointers_replicated_3d.sav +0 -0
- scipy/io/tests/data/struct_scalars.sav +0 -0
- scipy/io/tests/data/struct_scalars_replicated.sav +0 -0
- scipy/io/tests/data/struct_scalars_replicated_3d.sav +0 -0
- scipy/io/tests/data/test-1234Hz-le-1ch-10S-20bit-extra.wav +0 -0
- scipy/io/tests/data/test-44100Hz-2ch-32bit-float-be.wav +0 -0
- scipy/io/tests/data/test-44100Hz-2ch-32bit-float-le.wav +0 -0
- scipy/io/tests/data/test-44100Hz-be-1ch-4bytes.wav +0 -0
- scipy/io/tests/data/test-44100Hz-le-1ch-4bytes-early-eof-no-data.wav +0 -0
- scipy/io/tests/data/test-44100Hz-le-1ch-4bytes-early-eof.wav +0 -0
- scipy/io/tests/data/test-44100Hz-le-1ch-4bytes-incomplete-chunk.wav +0 -0
- scipy/io/tests/data/test-44100Hz-le-1ch-4bytes-rf64.wav +0 -0
- scipy/io/tests/data/test-44100Hz-le-1ch-4bytes.wav +0 -0
- scipy/io/tests/data/test-48000Hz-2ch-64bit-float-le-wavex.wav +0 -0
- scipy/io/tests/data/test-8000Hz-be-3ch-5S-24bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-1ch-1byte-ulaw.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-2ch-1byteu.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-24bit-inconsistent.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-24bit-rf64.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-24bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-36bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-45bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-53bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-64bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-4ch-9S-12bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-5ch-9S-5bit.wav +0 -0
- scipy/io/tests/data/various_compressed.sav +0 -0
- scipy/io/tests/test_fortran.py +264 -0
- scipy/io/tests/test_idl.py +483 -0
- scipy/io/tests/test_mmio.py +831 -0
- scipy/io/tests/test_netcdf.py +550 -0
- scipy/io/tests/test_paths.py +93 -0
- scipy/io/tests/test_wavfile.py +501 -0
- scipy/io/wavfile.py +938 -0
- scipy/linalg/__init__.pxd +1 -0
- scipy/linalg/__init__.py +236 -0
- scipy/linalg/_basic.py +2146 -0
- scipy/linalg/_blas_subroutines.h +164 -0
- scipy/linalg/_cythonized_array_utils.cp313-win_arm64.lib +0 -0
- scipy/linalg/_cythonized_array_utils.cp313-win_arm64.pyd +0 -0
- scipy/linalg/_cythonized_array_utils.pxd +40 -0
- scipy/linalg/_cythonized_array_utils.pyi +16 -0
- scipy/linalg/_decomp.py +1645 -0
- scipy/linalg/_decomp_cholesky.py +413 -0
- scipy/linalg/_decomp_cossin.py +236 -0
- scipy/linalg/_decomp_interpolative.cp313-win_arm64.lib +0 -0
- scipy/linalg/_decomp_interpolative.cp313-win_arm64.pyd +0 -0
- scipy/linalg/_decomp_ldl.py +356 -0
- scipy/linalg/_decomp_lu.py +401 -0
- scipy/linalg/_decomp_lu_cython.cp313-win_arm64.lib +0 -0
- scipy/linalg/_decomp_lu_cython.cp313-win_arm64.pyd +0 -0
- scipy/linalg/_decomp_lu_cython.pyi +6 -0
- scipy/linalg/_decomp_polar.py +113 -0
- scipy/linalg/_decomp_qr.py +494 -0
- scipy/linalg/_decomp_qz.py +452 -0
- scipy/linalg/_decomp_schur.py +336 -0
- scipy/linalg/_decomp_svd.py +545 -0
- scipy/linalg/_decomp_update.cp313-win_arm64.lib +0 -0
- scipy/linalg/_decomp_update.cp313-win_arm64.pyd +0 -0
- scipy/linalg/_expm_frechet.py +417 -0
- scipy/linalg/_fblas.cp313-win_arm64.lib +0 -0
- scipy/linalg/_fblas.cp313-win_arm64.pyd +0 -0
- scipy/linalg/_flapack.cp313-win_arm64.lib +0 -0
- scipy/linalg/_flapack.cp313-win_arm64.pyd +0 -0
- scipy/linalg/_lapack_subroutines.h +1521 -0
- scipy/linalg/_linalg_pythran.cp313-win_arm64.lib +0 -0
- scipy/linalg/_linalg_pythran.cp313-win_arm64.pyd +0 -0
- scipy/linalg/_matfuncs.py +1050 -0
- scipy/linalg/_matfuncs_expm.cp313-win_arm64.lib +0 -0
- scipy/linalg/_matfuncs_expm.cp313-win_arm64.pyd +0 -0
- scipy/linalg/_matfuncs_expm.pyi +6 -0
- scipy/linalg/_matfuncs_inv_ssq.py +886 -0
- scipy/linalg/_matfuncs_schur_sqrtm.cp313-win_arm64.lib +0 -0
- scipy/linalg/_matfuncs_schur_sqrtm.cp313-win_arm64.pyd +0 -0
- scipy/linalg/_matfuncs_sqrtm.py +107 -0
- scipy/linalg/_matfuncs_sqrtm_triu.cp313-win_arm64.lib +0 -0
- scipy/linalg/_matfuncs_sqrtm_triu.cp313-win_arm64.pyd +0 -0
- scipy/linalg/_misc.py +191 -0
- scipy/linalg/_procrustes.py +113 -0
- scipy/linalg/_sketches.py +189 -0
- scipy/linalg/_solve_toeplitz.cp313-win_arm64.lib +0 -0
- scipy/linalg/_solve_toeplitz.cp313-win_arm64.pyd +0 -0
- scipy/linalg/_solvers.py +862 -0
- scipy/linalg/_special_matrices.py +1322 -0
- scipy/linalg/_testutils.py +65 -0
- scipy/linalg/basic.py +23 -0
- scipy/linalg/blas.py +495 -0
- scipy/linalg/cython_blas.cp313-win_arm64.lib +0 -0
- scipy/linalg/cython_blas.cp313-win_arm64.pyd +0 -0
- scipy/linalg/cython_blas.pxd +169 -0
- scipy/linalg/cython_blas.pyx +1432 -0
- scipy/linalg/cython_lapack.cp313-win_arm64.lib +0 -0
- scipy/linalg/cython_lapack.cp313-win_arm64.pyd +0 -0
- scipy/linalg/cython_lapack.pxd +1528 -0
- scipy/linalg/cython_lapack.pyx +12045 -0
- scipy/linalg/decomp.py +23 -0
- scipy/linalg/decomp_cholesky.py +21 -0
- scipy/linalg/decomp_lu.py +21 -0
- scipy/linalg/decomp_qr.py +20 -0
- scipy/linalg/decomp_schur.py +21 -0
- scipy/linalg/decomp_svd.py +21 -0
- scipy/linalg/interpolative.py +989 -0
- scipy/linalg/lapack.py +1081 -0
- scipy/linalg/matfuncs.py +23 -0
- scipy/linalg/misc.py +21 -0
- scipy/linalg/special_matrices.py +22 -0
- scipy/linalg/tests/__init__.py +0 -0
- scipy/linalg/tests/_cython_examples/extending.pyx +23 -0
- scipy/linalg/tests/_cython_examples/meson.build +34 -0
- scipy/linalg/tests/data/carex_15_data.npz +0 -0
- scipy/linalg/tests/data/carex_18_data.npz +0 -0
- scipy/linalg/tests/data/carex_19_data.npz +0 -0
- scipy/linalg/tests/data/carex_20_data.npz +0 -0
- scipy/linalg/tests/data/carex_6_data.npz +0 -0
- scipy/linalg/tests/data/gendare_20170120_data.npz +0 -0
- scipy/linalg/tests/test_basic.py +2074 -0
- scipy/linalg/tests/test_batch.py +588 -0
- scipy/linalg/tests/test_blas.py +1127 -0
- scipy/linalg/tests/test_cython_blas.py +118 -0
- scipy/linalg/tests/test_cython_lapack.py +22 -0
- scipy/linalg/tests/test_cythonized_array_utils.py +130 -0
- scipy/linalg/tests/test_decomp.py +3189 -0
- scipy/linalg/tests/test_decomp_cholesky.py +268 -0
- scipy/linalg/tests/test_decomp_cossin.py +314 -0
- scipy/linalg/tests/test_decomp_ldl.py +137 -0
- scipy/linalg/tests/test_decomp_lu.py +308 -0
- scipy/linalg/tests/test_decomp_polar.py +110 -0
- scipy/linalg/tests/test_decomp_update.py +1701 -0
- scipy/linalg/tests/test_extending.py +46 -0
- scipy/linalg/tests/test_fblas.py +607 -0
- scipy/linalg/tests/test_interpolative.py +232 -0
- scipy/linalg/tests/test_lapack.py +3620 -0
- scipy/linalg/tests/test_matfuncs.py +1125 -0
- scipy/linalg/tests/test_matmul_toeplitz.py +136 -0
- scipy/linalg/tests/test_procrustes.py +214 -0
- scipy/linalg/tests/test_sketches.py +118 -0
- scipy/linalg/tests/test_solve_toeplitz.py +150 -0
- scipy/linalg/tests/test_solvers.py +844 -0
- scipy/linalg/tests/test_special_matrices.py +636 -0
- scipy/misc/__init__.py +6 -0
- scipy/misc/common.py +6 -0
- scipy/misc/doccer.py +6 -0
- scipy/ndimage/__init__.py +174 -0
- scipy/ndimage/_ctest.cp313-win_arm64.lib +0 -0
- scipy/ndimage/_ctest.cp313-win_arm64.pyd +0 -0
- scipy/ndimage/_cytest.cp313-win_arm64.lib +0 -0
- scipy/ndimage/_cytest.cp313-win_arm64.pyd +0 -0
- scipy/ndimage/_delegators.py +303 -0
- scipy/ndimage/_filters.py +2422 -0
- scipy/ndimage/_fourier.py +306 -0
- scipy/ndimage/_interpolation.py +1033 -0
- scipy/ndimage/_measurements.py +1689 -0
- scipy/ndimage/_morphology.py +2634 -0
- scipy/ndimage/_nd_image.cp313-win_arm64.lib +0 -0
- scipy/ndimage/_nd_image.cp313-win_arm64.pyd +0 -0
- scipy/ndimage/_ndimage_api.py +16 -0
- scipy/ndimage/_ni_docstrings.py +214 -0
- scipy/ndimage/_ni_label.cp313-win_arm64.lib +0 -0
- scipy/ndimage/_ni_label.cp313-win_arm64.pyd +0 -0
- scipy/ndimage/_ni_support.py +139 -0
- scipy/ndimage/_rank_filter_1d.cp313-win_arm64.lib +0 -0
- scipy/ndimage/_rank_filter_1d.cp313-win_arm64.pyd +0 -0
- scipy/ndimage/_support_alternative_backends.py +84 -0
- scipy/ndimage/filters.py +27 -0
- scipy/ndimage/fourier.py +21 -0
- scipy/ndimage/interpolation.py +22 -0
- scipy/ndimage/measurements.py +24 -0
- scipy/ndimage/morphology.py +27 -0
- scipy/ndimage/tests/__init__.py +12 -0
- scipy/ndimage/tests/data/label_inputs.txt +21 -0
- scipy/ndimage/tests/data/label_results.txt +294 -0
- scipy/ndimage/tests/data/label_strels.txt +42 -0
- scipy/ndimage/tests/dots.png +0 -0
- scipy/ndimage/tests/test_c_api.py +102 -0
- scipy/ndimage/tests/test_datatypes.py +67 -0
- scipy/ndimage/tests/test_filters.py +3083 -0
- scipy/ndimage/tests/test_fourier.py +187 -0
- scipy/ndimage/tests/test_interpolation.py +1491 -0
- scipy/ndimage/tests/test_measurements.py +1592 -0
- scipy/ndimage/tests/test_morphology.py +2950 -0
- scipy/ndimage/tests/test_ni_support.py +78 -0
- scipy/ndimage/tests/test_splines.py +70 -0
- scipy/odr/__init__.py +131 -0
- scipy/odr/__odrpack.cp313-win_arm64.lib +0 -0
- scipy/odr/__odrpack.cp313-win_arm64.pyd +0 -0
- scipy/odr/_add_newdocs.py +34 -0
- scipy/odr/_models.py +315 -0
- scipy/odr/_odrpack.py +1154 -0
- scipy/odr/models.py +20 -0
- scipy/odr/odrpack.py +21 -0
- scipy/odr/tests/__init__.py +0 -0
- scipy/odr/tests/test_odr.py +607 -0
- scipy/optimize/__init__.pxd +1 -0
- scipy/optimize/__init__.py +460 -0
- scipy/optimize/_basinhopping.py +741 -0
- scipy/optimize/_bglu_dense.cp313-win_arm64.lib +0 -0
- scipy/optimize/_bglu_dense.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_bracket.py +706 -0
- scipy/optimize/_chandrupatla.py +551 -0
- scipy/optimize/_cobyla_py.py +297 -0
- scipy/optimize/_cobyqa_py.py +72 -0
- scipy/optimize/_constraints.py +598 -0
- scipy/optimize/_dcsrch.py +728 -0
- scipy/optimize/_differentiable_functions.py +835 -0
- scipy/optimize/_differentialevolution.py +1970 -0
- scipy/optimize/_direct.cp313-win_arm64.lib +0 -0
- scipy/optimize/_direct.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_direct_py.py +280 -0
- scipy/optimize/_dual_annealing.py +732 -0
- scipy/optimize/_elementwise.py +798 -0
- scipy/optimize/_group_columns.cp313-win_arm64.lib +0 -0
- scipy/optimize/_group_columns.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_hessian_update_strategy.py +479 -0
- scipy/optimize/_highspy/__init__.py +0 -0
- scipy/optimize/_highspy/_core.cp313-win_arm64.lib +0 -0
- scipy/optimize/_highspy/_core.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_highspy/_highs_options.cp313-win_arm64.lib +0 -0
- scipy/optimize/_highspy/_highs_options.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_highspy/_highs_wrapper.py +338 -0
- scipy/optimize/_isotonic.py +157 -0
- scipy/optimize/_lbfgsb.cp313-win_arm64.lib +0 -0
- scipy/optimize/_lbfgsb.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_lbfgsb_py.py +634 -0
- scipy/optimize/_linesearch.py +896 -0
- scipy/optimize/_linprog.py +733 -0
- scipy/optimize/_linprog_doc.py +1434 -0
- scipy/optimize/_linprog_highs.py +422 -0
- scipy/optimize/_linprog_ip.py +1141 -0
- scipy/optimize/_linprog_rs.py +572 -0
- scipy/optimize/_linprog_simplex.py +663 -0
- scipy/optimize/_linprog_util.py +1521 -0
- scipy/optimize/_lsap.cp313-win_arm64.lib +0 -0
- scipy/optimize/_lsap.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_lsq/__init__.py +5 -0
- scipy/optimize/_lsq/bvls.py +183 -0
- scipy/optimize/_lsq/common.py +731 -0
- scipy/optimize/_lsq/dogbox.py +345 -0
- scipy/optimize/_lsq/givens_elimination.cp313-win_arm64.lib +0 -0
- scipy/optimize/_lsq/givens_elimination.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_lsq/least_squares.py +1044 -0
- scipy/optimize/_lsq/lsq_linear.py +361 -0
- scipy/optimize/_lsq/trf.py +587 -0
- scipy/optimize/_lsq/trf_linear.py +249 -0
- scipy/optimize/_milp.py +394 -0
- scipy/optimize/_minimize.py +1199 -0
- scipy/optimize/_minpack.cp313-win_arm64.lib +0 -0
- scipy/optimize/_minpack.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_minpack_py.py +1178 -0
- scipy/optimize/_moduleTNC.cp313-win_arm64.lib +0 -0
- scipy/optimize/_moduleTNC.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_nnls.py +96 -0
- scipy/optimize/_nonlin.py +1634 -0
- scipy/optimize/_numdiff.py +963 -0
- scipy/optimize/_optimize.py +4169 -0
- scipy/optimize/_pava_pybind.cp313-win_arm64.lib +0 -0
- scipy/optimize/_pava_pybind.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_qap.py +760 -0
- scipy/optimize/_remove_redundancy.py +522 -0
- scipy/optimize/_root.py +732 -0
- scipy/optimize/_root_scalar.py +538 -0
- scipy/optimize/_shgo.py +1606 -0
- scipy/optimize/_shgo_lib/__init__.py +0 -0
- scipy/optimize/_shgo_lib/_complex.py +1225 -0
- scipy/optimize/_shgo_lib/_vertex.py +460 -0
- scipy/optimize/_slsqp_py.py +603 -0
- scipy/optimize/_slsqplib.cp313-win_arm64.lib +0 -0
- scipy/optimize/_slsqplib.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_spectral.py +260 -0
- scipy/optimize/_tnc.py +438 -0
- scipy/optimize/_trlib/__init__.py +12 -0
- scipy/optimize/_trlib/_trlib.cp313-win_arm64.lib +0 -0
- scipy/optimize/_trlib/_trlib.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_trustregion.py +318 -0
- scipy/optimize/_trustregion_constr/__init__.py +6 -0
- scipy/optimize/_trustregion_constr/canonical_constraint.py +390 -0
- scipy/optimize/_trustregion_constr/equality_constrained_sqp.py +231 -0
- scipy/optimize/_trustregion_constr/minimize_trustregion_constr.py +584 -0
- scipy/optimize/_trustregion_constr/projections.py +411 -0
- scipy/optimize/_trustregion_constr/qp_subproblem.py +637 -0
- scipy/optimize/_trustregion_constr/report.py +49 -0
- scipy/optimize/_trustregion_constr/tests/__init__.py +0 -0
- scipy/optimize/_trustregion_constr/tests/test_canonical_constraint.py +296 -0
- scipy/optimize/_trustregion_constr/tests/test_nested_minimize.py +39 -0
- scipy/optimize/_trustregion_constr/tests/test_projections.py +214 -0
- scipy/optimize/_trustregion_constr/tests/test_qp_subproblem.py +645 -0
- scipy/optimize/_trustregion_constr/tests/test_report.py +34 -0
- scipy/optimize/_trustregion_constr/tr_interior_point.py +361 -0
- scipy/optimize/_trustregion_dogleg.py +122 -0
- scipy/optimize/_trustregion_exact.py +437 -0
- scipy/optimize/_trustregion_krylov.py +65 -0
- scipy/optimize/_trustregion_ncg.py +126 -0
- scipy/optimize/_tstutils.py +972 -0
- scipy/optimize/_zeros.cp313-win_arm64.lib +0 -0
- scipy/optimize/_zeros.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_zeros_py.py +1475 -0
- scipy/optimize/cobyla.py +19 -0
- scipy/optimize/cython_optimize/__init__.py +133 -0
- scipy/optimize/cython_optimize/_zeros.cp313-win_arm64.lib +0 -0
- scipy/optimize/cython_optimize/_zeros.cp313-win_arm64.pyd +0 -0
- scipy/optimize/cython_optimize/_zeros.pxd +33 -0
- scipy/optimize/cython_optimize/c_zeros.pxd +26 -0
- scipy/optimize/cython_optimize.pxd +11 -0
- scipy/optimize/elementwise.py +38 -0
- scipy/optimize/lbfgsb.py +23 -0
- scipy/optimize/linesearch.py +18 -0
- scipy/optimize/minpack.py +27 -0
- scipy/optimize/minpack2.py +17 -0
- scipy/optimize/moduleTNC.py +19 -0
- scipy/optimize/nonlin.py +29 -0
- scipy/optimize/optimize.py +40 -0
- scipy/optimize/slsqp.py +22 -0
- scipy/optimize/tests/__init__.py +0 -0
- scipy/optimize/tests/_cython_examples/extending.pyx +43 -0
- scipy/optimize/tests/_cython_examples/meson.build +32 -0
- scipy/optimize/tests/test__basinhopping.py +535 -0
- scipy/optimize/tests/test__differential_evolution.py +1703 -0
- scipy/optimize/tests/test__dual_annealing.py +416 -0
- scipy/optimize/tests/test__linprog_clean_inputs.py +312 -0
- scipy/optimize/tests/test__numdiff.py +885 -0
- scipy/optimize/tests/test__remove_redundancy.py +228 -0
- scipy/optimize/tests/test__root.py +124 -0
- scipy/optimize/tests/test__shgo.py +1164 -0
- scipy/optimize/tests/test__spectral.py +226 -0
- scipy/optimize/tests/test_bracket.py +896 -0
- scipy/optimize/tests/test_chandrupatla.py +982 -0
- scipy/optimize/tests/test_cobyla.py +195 -0
- scipy/optimize/tests/test_cobyqa.py +252 -0
- scipy/optimize/tests/test_constraint_conversion.py +286 -0
- scipy/optimize/tests/test_constraints.py +255 -0
- scipy/optimize/tests/test_cython_optimize.py +92 -0
- scipy/optimize/tests/test_differentiable_functions.py +1025 -0
- scipy/optimize/tests/test_direct.py +321 -0
- scipy/optimize/tests/test_extending.py +28 -0
- scipy/optimize/tests/test_hessian_update_strategy.py +300 -0
- scipy/optimize/tests/test_isotonic_regression.py +167 -0
- scipy/optimize/tests/test_lbfgsb_hessinv.py +65 -0
- scipy/optimize/tests/test_lbfgsb_setulb.py +122 -0
- scipy/optimize/tests/test_least_squares.py +986 -0
- scipy/optimize/tests/test_linear_assignment.py +116 -0
- scipy/optimize/tests/test_linesearch.py +328 -0
- scipy/optimize/tests/test_linprog.py +2577 -0
- scipy/optimize/tests/test_lsq_common.py +297 -0
- scipy/optimize/tests/test_lsq_linear.py +287 -0
- scipy/optimize/tests/test_milp.py +459 -0
- scipy/optimize/tests/test_minimize_constrained.py +845 -0
- scipy/optimize/tests/test_minpack.py +1194 -0
- scipy/optimize/tests/test_nnls.py +469 -0
- scipy/optimize/tests/test_nonlin.py +572 -0
- scipy/optimize/tests/test_optimize.py +3344 -0
- scipy/optimize/tests/test_quadratic_assignment.py +455 -0
- scipy/optimize/tests/test_regression.py +40 -0
- scipy/optimize/tests/test_slsqp.py +645 -0
- scipy/optimize/tests/test_tnc.py +345 -0
- scipy/optimize/tests/test_trustregion.py +110 -0
- scipy/optimize/tests/test_trustregion_exact.py +351 -0
- scipy/optimize/tests/test_trustregion_krylov.py +170 -0
- scipy/optimize/tests/test_zeros.py +998 -0
- scipy/optimize/tnc.py +22 -0
- scipy/optimize/zeros.py +26 -0
- scipy/signal/__init__.py +316 -0
- scipy/signal/_arraytools.py +264 -0
- scipy/signal/_czt.py +575 -0
- scipy/signal/_delegators.py +568 -0
- scipy/signal/_filter_design.py +5893 -0
- scipy/signal/_fir_filter_design.py +1458 -0
- scipy/signal/_lti_conversion.py +534 -0
- scipy/signal/_ltisys.py +3546 -0
- scipy/signal/_max_len_seq.py +139 -0
- scipy/signal/_max_len_seq_inner.cp313-win_arm64.lib +0 -0
- scipy/signal/_max_len_seq_inner.cp313-win_arm64.pyd +0 -0
- scipy/signal/_peak_finding.py +1310 -0
- scipy/signal/_peak_finding_utils.cp313-win_arm64.lib +0 -0
- scipy/signal/_peak_finding_utils.cp313-win_arm64.pyd +0 -0
- scipy/signal/_polyutils.py +172 -0
- scipy/signal/_savitzky_golay.py +357 -0
- scipy/signal/_short_time_fft.py +2228 -0
- scipy/signal/_signal_api.py +30 -0
- scipy/signal/_signaltools.py +5309 -0
- scipy/signal/_sigtools.cp313-win_arm64.lib +0 -0
- scipy/signal/_sigtools.cp313-win_arm64.pyd +0 -0
- scipy/signal/_sosfilt.cp313-win_arm64.lib +0 -0
- scipy/signal/_sosfilt.cp313-win_arm64.pyd +0 -0
- scipy/signal/_spectral_py.py +2471 -0
- scipy/signal/_spline.cp313-win_arm64.lib +0 -0
- scipy/signal/_spline.cp313-win_arm64.pyd +0 -0
- scipy/signal/_spline.pyi +34 -0
- scipy/signal/_spline_filters.py +848 -0
- scipy/signal/_support_alternative_backends.py +73 -0
- scipy/signal/_upfirdn.py +219 -0
- scipy/signal/_upfirdn_apply.cp313-win_arm64.lib +0 -0
- scipy/signal/_upfirdn_apply.cp313-win_arm64.pyd +0 -0
- scipy/signal/_waveforms.py +687 -0
- scipy/signal/_wavelets.py +29 -0
- scipy/signal/bsplines.py +21 -0
- scipy/signal/filter_design.py +28 -0
- scipy/signal/fir_filter_design.py +21 -0
- scipy/signal/lti_conversion.py +20 -0
- scipy/signal/ltisys.py +25 -0
- scipy/signal/signaltools.py +27 -0
- scipy/signal/spectral.py +21 -0
- scipy/signal/spline.py +18 -0
- scipy/signal/tests/__init__.py +0 -0
- scipy/signal/tests/_scipy_spectral_test_shim.py +311 -0
- scipy/signal/tests/mpsig.py +122 -0
- scipy/signal/tests/test_array_tools.py +111 -0
- scipy/signal/tests/test_bsplines.py +365 -0
- scipy/signal/tests/test_cont2discrete.py +424 -0
- scipy/signal/tests/test_czt.py +221 -0
- scipy/signal/tests/test_dltisys.py +599 -0
- scipy/signal/tests/test_filter_design.py +4744 -0
- scipy/signal/tests/test_fir_filter_design.py +851 -0
- scipy/signal/tests/test_ltisys.py +1225 -0
- scipy/signal/tests/test_max_len_seq.py +71 -0
- scipy/signal/tests/test_peak_finding.py +915 -0
- scipy/signal/tests/test_result_type.py +51 -0
- scipy/signal/tests/test_savitzky_golay.py +363 -0
- scipy/signal/tests/test_short_time_fft.py +1107 -0
- scipy/signal/tests/test_signaltools.py +4735 -0
- scipy/signal/tests/test_spectral.py +2141 -0
- scipy/signal/tests/test_splines.py +427 -0
- scipy/signal/tests/test_upfirdn.py +322 -0
- scipy/signal/tests/test_waveforms.py +400 -0
- scipy/signal/tests/test_wavelets.py +59 -0
- scipy/signal/tests/test_windows.py +987 -0
- scipy/signal/waveforms.py +20 -0
- scipy/signal/wavelets.py +17 -0
- scipy/signal/windows/__init__.py +52 -0
- scipy/signal/windows/_windows.py +2513 -0
- scipy/signal/windows/windows.py +23 -0
- scipy/sparse/__init__.py +350 -0
- scipy/sparse/_base.py +1613 -0
- scipy/sparse/_bsr.py +880 -0
- scipy/sparse/_compressed.py +1328 -0
- scipy/sparse/_construct.py +1454 -0
- scipy/sparse/_coo.py +1581 -0
- scipy/sparse/_csc.py +367 -0
- scipy/sparse/_csparsetools.cp313-win_arm64.lib +0 -0
- scipy/sparse/_csparsetools.cp313-win_arm64.pyd +0 -0
- scipy/sparse/_csr.py +558 -0
- scipy/sparse/_data.py +569 -0
- scipy/sparse/_dia.py +677 -0
- scipy/sparse/_dok.py +669 -0
- scipy/sparse/_extract.py +178 -0
- scipy/sparse/_index.py +444 -0
- scipy/sparse/_lil.py +632 -0
- scipy/sparse/_matrix.py +169 -0
- scipy/sparse/_matrix_io.py +167 -0
- scipy/sparse/_sparsetools.cp313-win_arm64.lib +0 -0
- scipy/sparse/_sparsetools.cp313-win_arm64.pyd +0 -0
- scipy/sparse/_spfuncs.py +76 -0
- scipy/sparse/_sputils.py +632 -0
- scipy/sparse/base.py +24 -0
- scipy/sparse/bsr.py +22 -0
- scipy/sparse/compressed.py +20 -0
- scipy/sparse/construct.py +38 -0
- scipy/sparse/coo.py +23 -0
- scipy/sparse/csc.py +22 -0
- scipy/sparse/csgraph/__init__.py +210 -0
- scipy/sparse/csgraph/_flow.cp313-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_flow.cp313-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_laplacian.py +563 -0
- scipy/sparse/csgraph/_matching.cp313-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_matching.cp313-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_min_spanning_tree.cp313-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_min_spanning_tree.cp313-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_reordering.cp313-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_reordering.cp313-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_shortest_path.cp313-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_shortest_path.cp313-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_tools.cp313-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_tools.cp313-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_traversal.cp313-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_traversal.cp313-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_validation.py +66 -0
- scipy/sparse/csgraph/tests/__init__.py +0 -0
- scipy/sparse/csgraph/tests/test_connected_components.py +119 -0
- scipy/sparse/csgraph/tests/test_conversions.py +61 -0
- scipy/sparse/csgraph/tests/test_flow.py +209 -0
- scipy/sparse/csgraph/tests/test_graph_laplacian.py +368 -0
- scipy/sparse/csgraph/tests/test_matching.py +307 -0
- scipy/sparse/csgraph/tests/test_pydata_sparse.py +197 -0
- scipy/sparse/csgraph/tests/test_reordering.py +70 -0
- scipy/sparse/csgraph/tests/test_shortest_path.py +540 -0
- scipy/sparse/csgraph/tests/test_spanning_tree.py +66 -0
- scipy/sparse/csgraph/tests/test_traversal.py +148 -0
- scipy/sparse/csr.py +22 -0
- scipy/sparse/data.py +18 -0
- scipy/sparse/dia.py +22 -0
- scipy/sparse/dok.py +22 -0
- scipy/sparse/extract.py +23 -0
- scipy/sparse/lil.py +22 -0
- scipy/sparse/linalg/__init__.py +148 -0
- scipy/sparse/linalg/_dsolve/__init__.py +71 -0
- scipy/sparse/linalg/_dsolve/_add_newdocs.py +147 -0
- scipy/sparse/linalg/_dsolve/_superlu.cp313-win_arm64.lib +0 -0
- scipy/sparse/linalg/_dsolve/_superlu.cp313-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_dsolve/linsolve.py +882 -0
- scipy/sparse/linalg/_dsolve/tests/__init__.py +0 -0
- scipy/sparse/linalg/_dsolve/tests/test_linsolve.py +928 -0
- scipy/sparse/linalg/_eigen/__init__.py +22 -0
- scipy/sparse/linalg/_eigen/_svds.py +540 -0
- scipy/sparse/linalg/_eigen/_svds_doc.py +382 -0
- scipy/sparse/linalg/_eigen/arpack/COPYING +45 -0
- scipy/sparse/linalg/_eigen/arpack/__init__.py +20 -0
- scipy/sparse/linalg/_eigen/arpack/_arpack.cp313-win_arm64.lib +0 -0
- scipy/sparse/linalg/_eigen/arpack/_arpack.cp313-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_eigen/arpack/arpack.py +1706 -0
- scipy/sparse/linalg/_eigen/arpack/tests/__init__.py +0 -0
- scipy/sparse/linalg/_eigen/arpack/tests/test_arpack.py +717 -0
- scipy/sparse/linalg/_eigen/lobpcg/__init__.py +16 -0
- scipy/sparse/linalg/_eigen/lobpcg/lobpcg.py +1110 -0
- scipy/sparse/linalg/_eigen/lobpcg/tests/__init__.py +0 -0
- scipy/sparse/linalg/_eigen/lobpcg/tests/test_lobpcg.py +725 -0
- scipy/sparse/linalg/_eigen/tests/__init__.py +0 -0
- scipy/sparse/linalg/_eigen/tests/test_svds.py +886 -0
- scipy/sparse/linalg/_expm_multiply.py +816 -0
- scipy/sparse/linalg/_interface.py +920 -0
- scipy/sparse/linalg/_isolve/__init__.py +20 -0
- scipy/sparse/linalg/_isolve/_gcrotmk.py +503 -0
- scipy/sparse/linalg/_isolve/iterative.py +1051 -0
- scipy/sparse/linalg/_isolve/lgmres.py +230 -0
- scipy/sparse/linalg/_isolve/lsmr.py +486 -0
- scipy/sparse/linalg/_isolve/lsqr.py +589 -0
- scipy/sparse/linalg/_isolve/minres.py +372 -0
- scipy/sparse/linalg/_isolve/tests/__init__.py +0 -0
- scipy/sparse/linalg/_isolve/tests/test_gcrotmk.py +183 -0
- scipy/sparse/linalg/_isolve/tests/test_iterative.py +809 -0
- scipy/sparse/linalg/_isolve/tests/test_lgmres.py +225 -0
- scipy/sparse/linalg/_isolve/tests/test_lsmr.py +185 -0
- scipy/sparse/linalg/_isolve/tests/test_lsqr.py +120 -0
- scipy/sparse/linalg/_isolve/tests/test_minres.py +97 -0
- scipy/sparse/linalg/_isolve/tests/test_utils.py +9 -0
- scipy/sparse/linalg/_isolve/tfqmr.py +179 -0
- scipy/sparse/linalg/_isolve/utils.py +121 -0
- scipy/sparse/linalg/_matfuncs.py +940 -0
- scipy/sparse/linalg/_norm.py +195 -0
- scipy/sparse/linalg/_onenormest.py +467 -0
- scipy/sparse/linalg/_propack/_cpropack.cp313-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_cpropack.cp313-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_propack/_dpropack.cp313-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_dpropack.cp313-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_propack/_spropack.cp313-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_spropack.cp313-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_propack/_zpropack.cp313-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_zpropack.cp313-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_special_sparse_arrays.py +949 -0
- scipy/sparse/linalg/_svdp.py +309 -0
- scipy/sparse/linalg/dsolve.py +22 -0
- scipy/sparse/linalg/eigen.py +21 -0
- scipy/sparse/linalg/interface.py +20 -0
- scipy/sparse/linalg/isolve.py +22 -0
- scipy/sparse/linalg/matfuncs.py +18 -0
- scipy/sparse/linalg/tests/__init__.py +0 -0
- scipy/sparse/linalg/tests/propack_test_data.npz +0 -0
- scipy/sparse/linalg/tests/test_expm_multiply.py +367 -0
- scipy/sparse/linalg/tests/test_interface.py +561 -0
- scipy/sparse/linalg/tests/test_matfuncs.py +592 -0
- scipy/sparse/linalg/tests/test_norm.py +154 -0
- scipy/sparse/linalg/tests/test_onenormest.py +252 -0
- scipy/sparse/linalg/tests/test_propack.py +165 -0
- scipy/sparse/linalg/tests/test_pydata_sparse.py +272 -0
- scipy/sparse/linalg/tests/test_special_sparse_arrays.py +337 -0
- scipy/sparse/sparsetools.py +17 -0
- scipy/sparse/spfuncs.py +17 -0
- scipy/sparse/sputils.py +17 -0
- scipy/sparse/tests/__init__.py +0 -0
- scipy/sparse/tests/data/csc_py2.npz +0 -0
- scipy/sparse/tests/data/csc_py3.npz +0 -0
- scipy/sparse/tests/test_arithmetic1d.py +341 -0
- scipy/sparse/tests/test_array_api.py +561 -0
- scipy/sparse/tests/test_base.py +5870 -0
- scipy/sparse/tests/test_common1d.py +447 -0
- scipy/sparse/tests/test_construct.py +872 -0
- scipy/sparse/tests/test_coo.py +1119 -0
- scipy/sparse/tests/test_csc.py +98 -0
- scipy/sparse/tests/test_csr.py +214 -0
- scipy/sparse/tests/test_dok.py +209 -0
- scipy/sparse/tests/test_extract.py +51 -0
- scipy/sparse/tests/test_indexing1d.py +603 -0
- scipy/sparse/tests/test_matrix_io.py +109 -0
- scipy/sparse/tests/test_minmax1d.py +128 -0
- scipy/sparse/tests/test_sparsetools.py +344 -0
- scipy/sparse/tests/test_spfuncs.py +97 -0
- scipy/sparse/tests/test_sputils.py +424 -0
- scipy/spatial/__init__.py +129 -0
- scipy/spatial/_ckdtree.cp313-win_arm64.lib +0 -0
- scipy/spatial/_ckdtree.cp313-win_arm64.pyd +0 -0
- scipy/spatial/_distance_pybind.cp313-win_arm64.lib +0 -0
- scipy/spatial/_distance_pybind.cp313-win_arm64.pyd +0 -0
- scipy/spatial/_distance_wrap.cp313-win_arm64.lib +0 -0
- scipy/spatial/_distance_wrap.cp313-win_arm64.pyd +0 -0
- scipy/spatial/_geometric_slerp.py +238 -0
- scipy/spatial/_hausdorff.cp313-win_arm64.lib +0 -0
- scipy/spatial/_hausdorff.cp313-win_arm64.pyd +0 -0
- scipy/spatial/_kdtree.py +920 -0
- scipy/spatial/_plotutils.py +274 -0
- scipy/spatial/_procrustes.py +132 -0
- scipy/spatial/_qhull.cp313-win_arm64.lib +0 -0
- scipy/spatial/_qhull.cp313-win_arm64.pyd +0 -0
- scipy/spatial/_qhull.pyi +213 -0
- scipy/spatial/_spherical_voronoi.py +341 -0
- scipy/spatial/_voronoi.cp313-win_arm64.lib +0 -0
- scipy/spatial/_voronoi.cp313-win_arm64.pyd +0 -0
- scipy/spatial/_voronoi.pyi +4 -0
- scipy/spatial/ckdtree.py +18 -0
- scipy/spatial/distance.py +3147 -0
- scipy/spatial/distance.pyi +210 -0
- scipy/spatial/kdtree.py +25 -0
- scipy/spatial/qhull.py +25 -0
- scipy/spatial/qhull_src/COPYING_QHULL.txt +39 -0
- scipy/spatial/tests/__init__.py +0 -0
- scipy/spatial/tests/data/cdist-X1.txt +10 -0
- scipy/spatial/tests/data/cdist-X2.txt +20 -0
- scipy/spatial/tests/data/degenerate_pointset.npz +0 -0
- scipy/spatial/tests/data/iris.txt +150 -0
- scipy/spatial/tests/data/pdist-boolean-inp.txt +20 -0
- scipy/spatial/tests/data/pdist-chebyshev-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-chebyshev-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-cityblock-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-cityblock-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-correlation-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-correlation-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-cosine-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-cosine-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-double-inp.txt +20 -0
- scipy/spatial/tests/data/pdist-euclidean-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-euclidean-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-hamming-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-jaccard-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-jensenshannon-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-jensenshannon-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-minkowski-3.2-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-minkowski-3.2-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-minkowski-5.8-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-seuclidean-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-seuclidean-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-spearman-ml.txt +1 -0
- scipy/spatial/tests/data/random-bool-data.txt +100 -0
- scipy/spatial/tests/data/random-double-data.txt +100 -0
- scipy/spatial/tests/data/random-int-data.txt +100 -0
- scipy/spatial/tests/data/random-uint-data.txt +100 -0
- scipy/spatial/tests/data/selfdual-4d-polytope.txt +27 -0
- scipy/spatial/tests/test__plotutils.py +91 -0
- scipy/spatial/tests/test__procrustes.py +116 -0
- scipy/spatial/tests/test_distance.py +2389 -0
- scipy/spatial/tests/test_hausdorff.py +199 -0
- scipy/spatial/tests/test_kdtree.py +1536 -0
- scipy/spatial/tests/test_qhull.py +1313 -0
- scipy/spatial/tests/test_slerp.py +417 -0
- scipy/spatial/tests/test_spherical_voronoi.py +358 -0
- scipy/spatial/transform/__init__.py +31 -0
- scipy/spatial/transform/_rigid_transform.cp313-win_arm64.lib +0 -0
- scipy/spatial/transform/_rigid_transform.cp313-win_arm64.pyd +0 -0
- scipy/spatial/transform/_rotation.cp313-win_arm64.lib +0 -0
- scipy/spatial/transform/_rotation.cp313-win_arm64.pyd +0 -0
- scipy/spatial/transform/_rotation_groups.py +140 -0
- scipy/spatial/transform/_rotation_spline.py +460 -0
- scipy/spatial/transform/rotation.py +21 -0
- scipy/spatial/transform/tests/__init__.py +0 -0
- scipy/spatial/transform/tests/test_rigid_transform.py +1221 -0
- scipy/spatial/transform/tests/test_rotation.py +2569 -0
- scipy/spatial/transform/tests/test_rotation_groups.py +169 -0
- scipy/spatial/transform/tests/test_rotation_spline.py +183 -0
- scipy/special/__init__.pxd +1 -0
- scipy/special/__init__.py +841 -0
- scipy/special/_add_newdocs.py +9961 -0
- scipy/special/_basic.py +3576 -0
- scipy/special/_comb.cp313-win_arm64.lib +0 -0
- scipy/special/_comb.cp313-win_arm64.pyd +0 -0
- scipy/special/_ellip_harm.py +214 -0
- scipy/special/_ellip_harm_2.cp313-win_arm64.lib +0 -0
- scipy/special/_ellip_harm_2.cp313-win_arm64.pyd +0 -0
- scipy/special/_gufuncs.cp313-win_arm64.lib +0 -0
- scipy/special/_gufuncs.cp313-win_arm64.pyd +0 -0
- scipy/special/_input_validation.py +17 -0
- scipy/special/_lambertw.py +149 -0
- scipy/special/_logsumexp.py +426 -0
- scipy/special/_mptestutils.py +453 -0
- scipy/special/_multiufuncs.py +610 -0
- scipy/special/_orthogonal.py +2592 -0
- scipy/special/_orthogonal.pyi +330 -0
- scipy/special/_precompute/__init__.py +0 -0
- scipy/special/_precompute/cosine_cdf.py +17 -0
- scipy/special/_precompute/expn_asy.py +54 -0
- scipy/special/_precompute/gammainc_asy.py +116 -0
- scipy/special/_precompute/gammainc_data.py +124 -0
- scipy/special/_precompute/hyp2f1_data.py +484 -0
- scipy/special/_precompute/lambertw.py +68 -0
- scipy/special/_precompute/loggamma.py +43 -0
- scipy/special/_precompute/struve_convergence.py +131 -0
- scipy/special/_precompute/utils.py +38 -0
- scipy/special/_precompute/wright_bessel.py +342 -0
- scipy/special/_precompute/wright_bessel_data.py +152 -0
- scipy/special/_precompute/wrightomega.py +41 -0
- scipy/special/_precompute/zetac.py +27 -0
- scipy/special/_sf_error.py +15 -0
- scipy/special/_specfun.cp313-win_arm64.lib +0 -0
- scipy/special/_specfun.cp313-win_arm64.pyd +0 -0
- scipy/special/_special_ufuncs.cp313-win_arm64.lib +0 -0
- scipy/special/_special_ufuncs.cp313-win_arm64.pyd +0 -0
- scipy/special/_spfun_stats.py +106 -0
- scipy/special/_spherical_bessel.py +397 -0
- scipy/special/_support_alternative_backends.py +295 -0
- scipy/special/_test_internal.cp313-win_arm64.lib +0 -0
- scipy/special/_test_internal.cp313-win_arm64.pyd +0 -0
- scipy/special/_test_internal.pyi +9 -0
- scipy/special/_testutils.py +321 -0
- scipy/special/_ufuncs.cp313-win_arm64.lib +0 -0
- scipy/special/_ufuncs.cp313-win_arm64.pyd +0 -0
- scipy/special/_ufuncs.pyi +522 -0
- scipy/special/_ufuncs.pyx +13173 -0
- scipy/special/_ufuncs_cxx.cp313-win_arm64.lib +0 -0
- scipy/special/_ufuncs_cxx.cp313-win_arm64.pyd +0 -0
- scipy/special/_ufuncs_cxx.pxd +142 -0
- scipy/special/_ufuncs_cxx.pyx +427 -0
- scipy/special/_ufuncs_cxx_defs.h +147 -0
- scipy/special/_ufuncs_defs.h +57 -0
- scipy/special/add_newdocs.py +15 -0
- scipy/special/basic.py +87 -0
- scipy/special/cython_special.cp313-win_arm64.lib +0 -0
- scipy/special/cython_special.cp313-win_arm64.pyd +0 -0
- scipy/special/cython_special.pxd +259 -0
- scipy/special/cython_special.pyi +3 -0
- scipy/special/orthogonal.py +45 -0
- scipy/special/sf_error.py +20 -0
- scipy/special/specfun.py +24 -0
- scipy/special/spfun_stats.py +17 -0
- scipy/special/tests/__init__.py +0 -0
- scipy/special/tests/_cython_examples/extending.pyx +12 -0
- scipy/special/tests/_cython_examples/meson.build +34 -0
- scipy/special/tests/data/__init__.py +0 -0
- scipy/special/tests/data/boost.npz +0 -0
- scipy/special/tests/data/gsl.npz +0 -0
- scipy/special/tests/data/local.npz +0 -0
- scipy/special/tests/test_basic.py +4815 -0
- scipy/special/tests/test_bdtr.py +112 -0
- scipy/special/tests/test_boost_ufuncs.py +64 -0
- scipy/special/tests/test_boxcox.py +125 -0
- scipy/special/tests/test_cdflib.py +712 -0
- scipy/special/tests/test_cdft_asymptotic.py +49 -0
- scipy/special/tests/test_cephes_intp_cast.py +29 -0
- scipy/special/tests/test_cosine_distr.py +83 -0
- scipy/special/tests/test_cython_special.py +363 -0
- scipy/special/tests/test_data.py +719 -0
- scipy/special/tests/test_dd.py +42 -0
- scipy/special/tests/test_digamma.py +45 -0
- scipy/special/tests/test_ellip_harm.py +278 -0
- scipy/special/tests/test_erfinv.py +89 -0
- scipy/special/tests/test_exponential_integrals.py +118 -0
- scipy/special/tests/test_extending.py +28 -0
- scipy/special/tests/test_faddeeva.py +85 -0
- scipy/special/tests/test_gamma.py +12 -0
- scipy/special/tests/test_gammainc.py +152 -0
- scipy/special/tests/test_hyp2f1.py +2566 -0
- scipy/special/tests/test_hypergeometric.py +234 -0
- scipy/special/tests/test_iv_ratio.py +249 -0
- scipy/special/tests/test_kolmogorov.py +491 -0
- scipy/special/tests/test_lambertw.py +109 -0
- scipy/special/tests/test_legendre.py +1518 -0
- scipy/special/tests/test_log1mexp.py +85 -0
- scipy/special/tests/test_loggamma.py +70 -0
- scipy/special/tests/test_logit.py +162 -0
- scipy/special/tests/test_logsumexp.py +469 -0
- scipy/special/tests/test_mpmath.py +2293 -0
- scipy/special/tests/test_nan_inputs.py +65 -0
- scipy/special/tests/test_ndtr.py +77 -0
- scipy/special/tests/test_ndtri_exp.py +94 -0
- scipy/special/tests/test_orthogonal.py +821 -0
- scipy/special/tests/test_orthogonal_eval.py +275 -0
- scipy/special/tests/test_owens_t.py +53 -0
- scipy/special/tests/test_pcf.py +24 -0
- scipy/special/tests/test_pdtr.py +48 -0
- scipy/special/tests/test_powm1.py +65 -0
- scipy/special/tests/test_precompute_expn_asy.py +24 -0
- scipy/special/tests/test_precompute_gammainc.py +108 -0
- scipy/special/tests/test_precompute_utils.py +36 -0
- scipy/special/tests/test_round.py +18 -0
- scipy/special/tests/test_sf_error.py +146 -0
- scipy/special/tests/test_sici.py +36 -0
- scipy/special/tests/test_specfun.py +48 -0
- scipy/special/tests/test_spence.py +32 -0
- scipy/special/tests/test_spfun_stats.py +61 -0
- scipy/special/tests/test_sph_harm.py +85 -0
- scipy/special/tests/test_spherical_bessel.py +400 -0
- scipy/special/tests/test_support_alternative_backends.py +248 -0
- scipy/special/tests/test_trig.py +72 -0
- scipy/special/tests/test_ufunc_signatures.py +46 -0
- scipy/special/tests/test_wright_bessel.py +205 -0
- scipy/special/tests/test_wrightomega.py +117 -0
- scipy/special/tests/test_zeta.py +301 -0
- scipy/stats/__init__.py +670 -0
- scipy/stats/_ansari_swilk_statistics.cp313-win_arm64.lib +0 -0
- scipy/stats/_ansari_swilk_statistics.cp313-win_arm64.pyd +0 -0
- scipy/stats/_axis_nan_policy.py +692 -0
- scipy/stats/_biasedurn.cp313-win_arm64.lib +0 -0
- scipy/stats/_biasedurn.cp313-win_arm64.pyd +0 -0
- scipy/stats/_biasedurn.pxd +27 -0
- scipy/stats/_binned_statistic.py +795 -0
- scipy/stats/_binomtest.py +375 -0
- scipy/stats/_bws_test.py +177 -0
- scipy/stats/_censored_data.py +459 -0
- scipy/stats/_common.py +5 -0
- scipy/stats/_constants.py +42 -0
- scipy/stats/_continued_fraction.py +387 -0
- scipy/stats/_continuous_distns.py +12486 -0
- scipy/stats/_correlation.py +210 -0
- scipy/stats/_covariance.py +636 -0
- scipy/stats/_crosstab.py +204 -0
- scipy/stats/_discrete_distns.py +2098 -0
- scipy/stats/_distn_infrastructure.py +4201 -0
- scipy/stats/_distr_params.py +299 -0
- scipy/stats/_distribution_infrastructure.py +5750 -0
- scipy/stats/_entropy.py +428 -0
- scipy/stats/_finite_differences.py +145 -0
- scipy/stats/_fit.py +1351 -0
- scipy/stats/_hypotests.py +2060 -0
- scipy/stats/_kde.py +732 -0
- scipy/stats/_ksstats.py +600 -0
- scipy/stats/_levy_stable/__init__.py +1231 -0
- scipy/stats/_levy_stable/levyst.cp313-win_arm64.lib +0 -0
- scipy/stats/_levy_stable/levyst.cp313-win_arm64.pyd +0 -0
- scipy/stats/_mannwhitneyu.py +492 -0
- scipy/stats/_mgc.py +550 -0
- scipy/stats/_morestats.py +4626 -0
- scipy/stats/_mstats_basic.py +3658 -0
- scipy/stats/_mstats_extras.py +521 -0
- scipy/stats/_multicomp.py +449 -0
- scipy/stats/_multivariate.py +7281 -0
- scipy/stats/_new_distributions.py +452 -0
- scipy/stats/_odds_ratio.py +466 -0
- scipy/stats/_page_trend_test.py +486 -0
- scipy/stats/_probability_distribution.py +1964 -0
- scipy/stats/_qmc.py +2956 -0
- scipy/stats/_qmc_cy.cp313-win_arm64.lib +0 -0
- scipy/stats/_qmc_cy.cp313-win_arm64.pyd +0 -0
- scipy/stats/_qmc_cy.pyi +54 -0
- scipy/stats/_qmvnt.py +454 -0
- scipy/stats/_qmvnt_cy.cp313-win_arm64.lib +0 -0
- scipy/stats/_qmvnt_cy.cp313-win_arm64.pyd +0 -0
- scipy/stats/_quantile.py +335 -0
- scipy/stats/_rcont/__init__.py +4 -0
- scipy/stats/_rcont/rcont.cp313-win_arm64.lib +0 -0
- scipy/stats/_rcont/rcont.cp313-win_arm64.pyd +0 -0
- scipy/stats/_relative_risk.py +263 -0
- scipy/stats/_resampling.py +2352 -0
- scipy/stats/_result_classes.py +40 -0
- scipy/stats/_sampling.py +1314 -0
- scipy/stats/_sensitivity_analysis.py +713 -0
- scipy/stats/_sobol.cp313-win_arm64.lib +0 -0
- scipy/stats/_sobol.cp313-win_arm64.pyd +0 -0
- scipy/stats/_sobol.pyi +54 -0
- scipy/stats/_sobol_direction_numbers.npz +0 -0
- scipy/stats/_stats.cp313-win_arm64.lib +0 -0
- scipy/stats/_stats.cp313-win_arm64.pyd +0 -0
- scipy/stats/_stats.pxd +10 -0
- scipy/stats/_stats_mstats_common.py +322 -0
- scipy/stats/_stats_py.py +11089 -0
- scipy/stats/_stats_pythran.cp313-win_arm64.lib +0 -0
- scipy/stats/_stats_pythran.cp313-win_arm64.pyd +0 -0
- scipy/stats/_survival.py +683 -0
- scipy/stats/_tukeylambda_stats.py +199 -0
- scipy/stats/_unuran/__init__.py +0 -0
- scipy/stats/_unuran/unuran_wrapper.cp313-win_arm64.lib +0 -0
- scipy/stats/_unuran/unuran_wrapper.cp313-win_arm64.pyd +0 -0
- scipy/stats/_unuran/unuran_wrapper.pyi +179 -0
- scipy/stats/_variation.py +126 -0
- scipy/stats/_warnings_errors.py +38 -0
- scipy/stats/_wilcoxon.py +265 -0
- scipy/stats/biasedurn.py +16 -0
- scipy/stats/contingency.py +521 -0
- scipy/stats/distributions.py +24 -0
- scipy/stats/kde.py +18 -0
- scipy/stats/morestats.py +27 -0
- scipy/stats/mstats.py +140 -0
- scipy/stats/mstats_basic.py +42 -0
- scipy/stats/mstats_extras.py +25 -0
- scipy/stats/mvn.py +17 -0
- scipy/stats/qmc.py +236 -0
- scipy/stats/sampling.py +73 -0
- scipy/stats/stats.py +41 -0
- scipy/stats/tests/__init__.py +0 -0
- scipy/stats/tests/common_tests.py +356 -0
- scipy/stats/tests/data/_mvt.py +171 -0
- scipy/stats/tests/data/fisher_exact_results_from_r.py +607 -0
- scipy/stats/tests/data/jf_skew_t_gamlss_pdf_data.npy +0 -0
- scipy/stats/tests/data/levy_stable/stable-Z1-cdf-sample-data.npy +0 -0
- scipy/stats/tests/data/levy_stable/stable-Z1-pdf-sample-data.npy +0 -0
- scipy/stats/tests/data/levy_stable/stable-loc-scale-sample-data.npy +0 -0
- scipy/stats/tests/data/nist_anova/AtmWtAg.dat +108 -0
- scipy/stats/tests/data/nist_anova/SiRstv.dat +85 -0
- scipy/stats/tests/data/nist_anova/SmLs01.dat +249 -0
- scipy/stats/tests/data/nist_anova/SmLs02.dat +1869 -0
- scipy/stats/tests/data/nist_anova/SmLs03.dat +18069 -0
- scipy/stats/tests/data/nist_anova/SmLs04.dat +249 -0
- scipy/stats/tests/data/nist_anova/SmLs05.dat +1869 -0
- scipy/stats/tests/data/nist_anova/SmLs06.dat +18069 -0
- scipy/stats/tests/data/nist_anova/SmLs07.dat +249 -0
- scipy/stats/tests/data/nist_anova/SmLs08.dat +1869 -0
- scipy/stats/tests/data/nist_anova/SmLs09.dat +18069 -0
- scipy/stats/tests/data/nist_linregress/Norris.dat +97 -0
- scipy/stats/tests/data/rel_breitwigner_pdf_sample_data_ROOT.npy +0 -0
- scipy/stats/tests/data/studentized_range_mpmath_ref.json +1499 -0
- scipy/stats/tests/test_axis_nan_policy.py +1388 -0
- scipy/stats/tests/test_binned_statistic.py +568 -0
- scipy/stats/tests/test_censored_data.py +152 -0
- scipy/stats/tests/test_contingency.py +294 -0
- scipy/stats/tests/test_continued_fraction.py +173 -0
- scipy/stats/tests/test_continuous.py +2198 -0
- scipy/stats/tests/test_continuous_basic.py +1053 -0
- scipy/stats/tests/test_continuous_fit_censored.py +683 -0
- scipy/stats/tests/test_correlation.py +80 -0
- scipy/stats/tests/test_crosstab.py +115 -0
- scipy/stats/tests/test_discrete_basic.py +580 -0
- scipy/stats/tests/test_discrete_distns.py +700 -0
- scipy/stats/tests/test_distributions.py +10413 -0
- scipy/stats/tests/test_entropy.py +322 -0
- scipy/stats/tests/test_fast_gen_inversion.py +435 -0
- scipy/stats/tests/test_fit.py +1090 -0
- scipy/stats/tests/test_hypotests.py +1991 -0
- scipy/stats/tests/test_kdeoth.py +676 -0
- scipy/stats/tests/test_marray.py +289 -0
- scipy/stats/tests/test_mgc.py +217 -0
- scipy/stats/tests/test_morestats.py +3259 -0
- scipy/stats/tests/test_mstats_basic.py +2071 -0
- scipy/stats/tests/test_mstats_extras.py +172 -0
- scipy/stats/tests/test_multicomp.py +405 -0
- scipy/stats/tests/test_multivariate.py +4381 -0
- scipy/stats/tests/test_odds_ratio.py +148 -0
- scipy/stats/tests/test_qmc.py +1492 -0
- scipy/stats/tests/test_quantile.py +199 -0
- scipy/stats/tests/test_rank.py +345 -0
- scipy/stats/tests/test_relative_risk.py +95 -0
- scipy/stats/tests/test_resampling.py +2000 -0
- scipy/stats/tests/test_sampling.py +1450 -0
- scipy/stats/tests/test_sensitivity_analysis.py +310 -0
- scipy/stats/tests/test_stats.py +9707 -0
- scipy/stats/tests/test_survival.py +466 -0
- scipy/stats/tests/test_tukeylambda_stats.py +85 -0
- scipy/stats/tests/test_variation.py +216 -0
- scipy/version.py +12 -0
- scipy-1.16.2.dist-info/DELVEWHEEL +2 -0
- scipy-1.16.2.dist-info/LICENSE.txt +912 -0
- scipy-1.16.2.dist-info/METADATA +1061 -0
- scipy-1.16.2.dist-info/RECORD +1530 -0
- scipy-1.16.2.dist-info/WHEEL +4 -0
- scipy.libs/msvcp140-5f1c5dd31916990d94181e07bc3afb32.dll +0 -0
- scipy.libs/scipy_openblas-f3ac85b1f412f7e86514c923dc4058d1.dll +0 -0
@@ -0,0 +1,1287 @@
|
|
1
|
+
from itertools import product
|
2
|
+
from numpy.testing import (assert_, assert_allclose, assert_array_less,
|
3
|
+
assert_equal, assert_no_warnings, suppress_warnings)
|
4
|
+
import pytest
|
5
|
+
from pytest import raises as assert_raises
|
6
|
+
import numpy as np
|
7
|
+
from scipy.optimize._numdiff import group_columns
|
8
|
+
from scipy.integrate import solve_ivp, RK23, RK45, DOP853, Radau, BDF, LSODA
|
9
|
+
from scipy.integrate import OdeSolution
|
10
|
+
from scipy.integrate._ivp.common import num_jac, select_initial_step
|
11
|
+
from scipy.integrate._ivp.base import ConstantDenseOutput
|
12
|
+
from scipy.sparse import coo_matrix, csc_matrix
|
13
|
+
|
14
|
+
|
15
|
+
def fun_zero(t, y):
|
16
|
+
return np.zeros_like(y)
|
17
|
+
|
18
|
+
|
19
|
+
def fun_linear(t, y):
|
20
|
+
return np.array([-y[0] - 5 * y[1], y[0] + y[1]])
|
21
|
+
|
22
|
+
|
23
|
+
def jac_linear():
|
24
|
+
return np.array([[-1, -5], [1, 1]])
|
25
|
+
|
26
|
+
|
27
|
+
def sol_linear(t):
|
28
|
+
return np.vstack((-5 * np.sin(2 * t),
|
29
|
+
2 * np.cos(2 * t) + np.sin(2 * t)))
|
30
|
+
|
31
|
+
|
32
|
+
def fun_rational(t, y):
|
33
|
+
return np.array([y[1] / t,
|
34
|
+
y[1] * (y[0] + 2 * y[1] - 1) / (t * (y[0] - 1))])
|
35
|
+
|
36
|
+
|
37
|
+
def fun_rational_vectorized(t, y):
|
38
|
+
return np.vstack((y[1] / t,
|
39
|
+
y[1] * (y[0] + 2 * y[1] - 1) / (t * (y[0] - 1))))
|
40
|
+
|
41
|
+
|
42
|
+
def jac_rational(t, y):
|
43
|
+
return np.array([
|
44
|
+
[0, 1 / t],
|
45
|
+
[-2 * y[1] ** 2 / (t * (y[0] - 1) ** 2),
|
46
|
+
(y[0] + 4 * y[1] - 1) / (t * (y[0] - 1))]
|
47
|
+
])
|
48
|
+
|
49
|
+
|
50
|
+
def jac_rational_sparse(t, y):
|
51
|
+
return csc_matrix([
|
52
|
+
[0, 1 / t],
|
53
|
+
[-2 * y[1] ** 2 / (t * (y[0] - 1) ** 2),
|
54
|
+
(y[0] + 4 * y[1] - 1) / (t * (y[0] - 1))]
|
55
|
+
])
|
56
|
+
|
57
|
+
|
58
|
+
def sol_rational(t):
|
59
|
+
return np.asarray((t / (t + 10), 10 * t / (t + 10) ** 2))
|
60
|
+
|
61
|
+
|
62
|
+
def fun_medazko(t, y):
|
63
|
+
n = y.shape[0] // 2
|
64
|
+
k = 100
|
65
|
+
c = 4
|
66
|
+
|
67
|
+
phi = 2 if t <= 5 else 0
|
68
|
+
y = np.hstack((phi, 0, y, y[-2]))
|
69
|
+
|
70
|
+
d = 1 / n
|
71
|
+
j = np.arange(n) + 1
|
72
|
+
alpha = 2 * (j * d - 1) ** 3 / c ** 2
|
73
|
+
beta = (j * d - 1) ** 4 / c ** 2
|
74
|
+
|
75
|
+
j_2_p1 = 2 * j + 2
|
76
|
+
j_2_m3 = 2 * j - 2
|
77
|
+
j_2_m1 = 2 * j
|
78
|
+
j_2 = 2 * j + 1
|
79
|
+
|
80
|
+
f = np.empty(2 * n)
|
81
|
+
f[::2] = (alpha * (y[j_2_p1] - y[j_2_m3]) / (2 * d) +
|
82
|
+
beta * (y[j_2_m3] - 2 * y[j_2_m1] + y[j_2_p1]) / d ** 2 -
|
83
|
+
k * y[j_2_m1] * y[j_2])
|
84
|
+
f[1::2] = -k * y[j_2] * y[j_2_m1]
|
85
|
+
|
86
|
+
return f
|
87
|
+
|
88
|
+
|
89
|
+
def medazko_sparsity(n):
|
90
|
+
cols = []
|
91
|
+
rows = []
|
92
|
+
|
93
|
+
i = np.arange(n) * 2
|
94
|
+
|
95
|
+
cols.append(i[1:])
|
96
|
+
rows.append(i[1:] - 2)
|
97
|
+
|
98
|
+
cols.append(i)
|
99
|
+
rows.append(i)
|
100
|
+
|
101
|
+
cols.append(i)
|
102
|
+
rows.append(i + 1)
|
103
|
+
|
104
|
+
cols.append(i[:-1])
|
105
|
+
rows.append(i[:-1] + 2)
|
106
|
+
|
107
|
+
i = np.arange(n) * 2 + 1
|
108
|
+
|
109
|
+
cols.append(i)
|
110
|
+
rows.append(i)
|
111
|
+
|
112
|
+
cols.append(i)
|
113
|
+
rows.append(i - 1)
|
114
|
+
|
115
|
+
cols = np.hstack(cols)
|
116
|
+
rows = np.hstack(rows)
|
117
|
+
|
118
|
+
return coo_matrix((np.ones_like(cols), (cols, rows)))
|
119
|
+
|
120
|
+
|
121
|
+
def fun_complex(t, y):
|
122
|
+
return -y
|
123
|
+
|
124
|
+
|
125
|
+
def jac_complex(t, y):
|
126
|
+
return -np.eye(y.shape[0])
|
127
|
+
|
128
|
+
|
129
|
+
def jac_complex_sparse(t, y):
|
130
|
+
return csc_matrix(jac_complex(t, y))
|
131
|
+
|
132
|
+
|
133
|
+
def sol_complex(t):
|
134
|
+
y = (0.5 + 1j) * np.exp(-t)
|
135
|
+
return y.reshape((1, -1))
|
136
|
+
|
137
|
+
|
138
|
+
def fun_event_dense_output_LSODA(t, y):
|
139
|
+
return y * (t - 2)
|
140
|
+
|
141
|
+
|
142
|
+
def jac_event_dense_output_LSODA(t, y):
|
143
|
+
return t - 2
|
144
|
+
|
145
|
+
|
146
|
+
def sol_event_dense_output_LSODA(t):
|
147
|
+
return np.exp(t ** 2 / 2 - 2 * t + np.log(0.05) - 6)
|
148
|
+
|
149
|
+
|
150
|
+
def compute_error(y, y_true, rtol, atol):
|
151
|
+
e = (y - y_true) / (atol + rtol * np.abs(y_true))
|
152
|
+
return np.linalg.norm(e, axis=0) / np.sqrt(e.shape[0])
|
153
|
+
|
154
|
+
def test_duplicate_timestamps():
|
155
|
+
def upward_cannon(t, y):
|
156
|
+
return [y[1], -9.80665]
|
157
|
+
|
158
|
+
def hit_ground(t, y):
|
159
|
+
return y[0]
|
160
|
+
|
161
|
+
hit_ground.terminal = True
|
162
|
+
hit_ground.direction = -1
|
163
|
+
|
164
|
+
sol = solve_ivp(upward_cannon, [0, np.inf], [0, 0.01],
|
165
|
+
max_step=0.05 * 0.001 / 9.80665,
|
166
|
+
events=hit_ground, dense_output=True)
|
167
|
+
assert_allclose(sol.sol(0.01), np.asarray([-0.00039033, -0.08806632]),
|
168
|
+
rtol=1e-5, atol=1e-8)
|
169
|
+
assert_allclose(sol.t_events, np.asarray([[0.00203943]]), rtol=1e-5, atol=1e-8)
|
170
|
+
assert_allclose(sol.y_events, [np.asarray([[ 0.0, -0.01 ]])], atol=1e-9)
|
171
|
+
assert sol.success
|
172
|
+
assert_equal(sol.status, 1)
|
173
|
+
|
174
|
+
@pytest.mark.thread_unsafe
|
175
|
+
def test_integration():
|
176
|
+
rtol = 1e-3
|
177
|
+
atol = 1e-6
|
178
|
+
y0 = [1/3, 2/9]
|
179
|
+
|
180
|
+
for vectorized, method, t_span, jac in product(
|
181
|
+
[False, True],
|
182
|
+
['RK23', 'RK45', 'DOP853', 'Radau', 'BDF', 'LSODA'],
|
183
|
+
[[5, 9], [5, 1]],
|
184
|
+
[None, jac_rational, jac_rational_sparse]):
|
185
|
+
|
186
|
+
if vectorized:
|
187
|
+
fun = fun_rational_vectorized
|
188
|
+
else:
|
189
|
+
fun = fun_rational
|
190
|
+
|
191
|
+
with suppress_warnings() as sup:
|
192
|
+
sup.filter(UserWarning,
|
193
|
+
"The following arguments have no effect for a chosen "
|
194
|
+
"solver: `jac`")
|
195
|
+
res = solve_ivp(fun, t_span, y0, rtol=rtol,
|
196
|
+
atol=atol, method=method, dense_output=True,
|
197
|
+
jac=jac, vectorized=vectorized)
|
198
|
+
assert_equal(res.t[0], t_span[0])
|
199
|
+
assert_(res.t_events is None)
|
200
|
+
assert_(res.y_events is None)
|
201
|
+
assert_(res.success)
|
202
|
+
assert_equal(res.status, 0)
|
203
|
+
|
204
|
+
if method == 'DOP853':
|
205
|
+
# DOP853 spends more functions evaluation because it doesn't
|
206
|
+
# have enough time to develop big enough step size.
|
207
|
+
assert_(res.nfev < 50)
|
208
|
+
else:
|
209
|
+
assert_(res.nfev < 40)
|
210
|
+
|
211
|
+
if method in ['RK23', 'RK45', 'DOP853', 'LSODA']:
|
212
|
+
assert_equal(res.njev, 0)
|
213
|
+
assert_equal(res.nlu, 0)
|
214
|
+
else:
|
215
|
+
assert_(0 < res.njev < 3)
|
216
|
+
assert_(0 < res.nlu < 10)
|
217
|
+
|
218
|
+
y_true = sol_rational(res.t)
|
219
|
+
e = compute_error(res.y, y_true, rtol, atol)
|
220
|
+
assert_(np.all(e < 5))
|
221
|
+
|
222
|
+
tc = np.linspace(*t_span)
|
223
|
+
yc_true = sol_rational(tc)
|
224
|
+
yc = res.sol(tc)
|
225
|
+
|
226
|
+
e = compute_error(yc, yc_true, rtol, atol)
|
227
|
+
assert_(np.all(e < 5))
|
228
|
+
|
229
|
+
tc = (t_span[0] + t_span[-1]) / 2
|
230
|
+
yc_true = sol_rational(tc)
|
231
|
+
yc = res.sol(tc)
|
232
|
+
|
233
|
+
e = compute_error(yc, yc_true, rtol, atol)
|
234
|
+
assert_(np.all(e < 5))
|
235
|
+
|
236
|
+
assert_allclose(res.sol(res.t), res.y, rtol=1e-15, atol=1e-15)
|
237
|
+
|
238
|
+
|
239
|
+
@pytest.mark.thread_unsafe
|
240
|
+
def test_integration_complex():
|
241
|
+
rtol = 1e-3
|
242
|
+
atol = 1e-6
|
243
|
+
y0 = [0.5 + 1j]
|
244
|
+
t_span = [0, 1]
|
245
|
+
tc = np.linspace(t_span[0], t_span[1])
|
246
|
+
for method, jac in product(['RK23', 'RK45', 'DOP853', 'BDF'],
|
247
|
+
[None, jac_complex, jac_complex_sparse]):
|
248
|
+
with suppress_warnings() as sup:
|
249
|
+
sup.filter(UserWarning,
|
250
|
+
"The following arguments have no effect for a chosen "
|
251
|
+
"solver: `jac`")
|
252
|
+
res = solve_ivp(fun_complex, t_span, y0, method=method,
|
253
|
+
dense_output=True, rtol=rtol, atol=atol, jac=jac)
|
254
|
+
|
255
|
+
assert_equal(res.t[0], t_span[0])
|
256
|
+
assert_(res.t_events is None)
|
257
|
+
assert_(res.y_events is None)
|
258
|
+
assert_(res.success)
|
259
|
+
assert_equal(res.status, 0)
|
260
|
+
|
261
|
+
if method == 'DOP853':
|
262
|
+
assert res.nfev < 35
|
263
|
+
else:
|
264
|
+
assert res.nfev < 25
|
265
|
+
|
266
|
+
if method == 'BDF':
|
267
|
+
assert_equal(res.njev, 1)
|
268
|
+
assert res.nlu < 6
|
269
|
+
else:
|
270
|
+
assert res.njev == 0
|
271
|
+
assert res.nlu == 0
|
272
|
+
|
273
|
+
y_true = sol_complex(res.t)
|
274
|
+
e = compute_error(res.y, y_true, rtol, atol)
|
275
|
+
assert np.all(e < 5)
|
276
|
+
|
277
|
+
yc_true = sol_complex(tc)
|
278
|
+
yc = res.sol(tc)
|
279
|
+
e = compute_error(yc, yc_true, rtol, atol)
|
280
|
+
|
281
|
+
assert np.all(e < 5)
|
282
|
+
|
283
|
+
|
284
|
+
@pytest.mark.fail_slow(5)
|
285
|
+
def test_integration_sparse_difference():
|
286
|
+
n = 200
|
287
|
+
t_span = [0, 20]
|
288
|
+
y0 = np.zeros(2 * n)
|
289
|
+
y0[1::2] = 1
|
290
|
+
sparsity = medazko_sparsity(n)
|
291
|
+
|
292
|
+
for method in ['BDF', 'Radau']:
|
293
|
+
res = solve_ivp(fun_medazko, t_span, y0, method=method,
|
294
|
+
jac_sparsity=sparsity)
|
295
|
+
|
296
|
+
assert_equal(res.t[0], t_span[0])
|
297
|
+
assert_(res.t_events is None)
|
298
|
+
assert_(res.y_events is None)
|
299
|
+
assert_(res.success)
|
300
|
+
assert_equal(res.status, 0)
|
301
|
+
|
302
|
+
assert_allclose(res.y[78, -1], 0.233994e-3, rtol=1e-2)
|
303
|
+
assert_allclose(res.y[79, -1], 0, atol=1e-3)
|
304
|
+
assert_allclose(res.y[148, -1], 0.359561e-3, rtol=1e-2)
|
305
|
+
assert_allclose(res.y[149, -1], 0, atol=1e-3)
|
306
|
+
assert_allclose(res.y[198, -1], 0.117374129e-3, rtol=1e-2)
|
307
|
+
assert_allclose(res.y[199, -1], 0.6190807e-5, atol=1e-3)
|
308
|
+
assert_allclose(res.y[238, -1], 0, atol=1e-3)
|
309
|
+
assert_allclose(res.y[239, -1], 0.9999997, rtol=1e-2)
|
310
|
+
|
311
|
+
|
312
|
+
def test_integration_const_jac():
|
313
|
+
rtol = 1e-3
|
314
|
+
atol = 1e-6
|
315
|
+
y0 = [0, 2]
|
316
|
+
t_span = [0, 2]
|
317
|
+
J = jac_linear()
|
318
|
+
J_sparse = csc_matrix(J)
|
319
|
+
|
320
|
+
for method, jac in product(['Radau', 'BDF'], [J, J_sparse]):
|
321
|
+
res = solve_ivp(fun_linear, t_span, y0, rtol=rtol, atol=atol,
|
322
|
+
method=method, dense_output=True, jac=jac)
|
323
|
+
assert_equal(res.t[0], t_span[0])
|
324
|
+
assert_(res.t_events is None)
|
325
|
+
assert_(res.y_events is None)
|
326
|
+
assert_(res.success)
|
327
|
+
assert_equal(res.status, 0)
|
328
|
+
|
329
|
+
assert_(res.nfev < 100)
|
330
|
+
assert_equal(res.njev, 0)
|
331
|
+
assert_(0 < res.nlu < 15)
|
332
|
+
|
333
|
+
y_true = sol_linear(res.t)
|
334
|
+
e = compute_error(res.y, y_true, rtol, atol)
|
335
|
+
assert_(np.all(e < 10))
|
336
|
+
|
337
|
+
tc = np.linspace(*t_span)
|
338
|
+
yc_true = sol_linear(tc)
|
339
|
+
yc = res.sol(tc)
|
340
|
+
|
341
|
+
e = compute_error(yc, yc_true, rtol, atol)
|
342
|
+
assert_(np.all(e < 15))
|
343
|
+
|
344
|
+
assert_allclose(res.sol(res.t), res.y, rtol=1e-14, atol=1e-14)
|
345
|
+
|
346
|
+
|
347
|
+
@pytest.mark.slow
|
348
|
+
@pytest.mark.parametrize('method', ['Radau', 'BDF', 'LSODA'])
|
349
|
+
def test_integration_stiff(method, num_parallel_threads):
|
350
|
+
rtol = 1e-6
|
351
|
+
atol = 1e-6
|
352
|
+
y0 = [1e4, 0, 0]
|
353
|
+
tspan = [0, 1e8]
|
354
|
+
|
355
|
+
if method == 'LSODA' and num_parallel_threads > 1:
|
356
|
+
pytest.skip(reason='LSODA does not allow for concurrent calls')
|
357
|
+
|
358
|
+
def fun_robertson(t, state):
|
359
|
+
x, y, z = state
|
360
|
+
return [
|
361
|
+
-0.04 * x + 1e4 * y * z,
|
362
|
+
0.04 * x - 1e4 * y * z - 3e7 * y * y,
|
363
|
+
3e7 * y * y,
|
364
|
+
]
|
365
|
+
|
366
|
+
res = solve_ivp(fun_robertson, tspan, y0, rtol=rtol,
|
367
|
+
atol=atol, method=method)
|
368
|
+
|
369
|
+
# If the stiff mode is not activated correctly, these numbers will be much bigger
|
370
|
+
assert res.nfev < 5000
|
371
|
+
assert res.njev < 200
|
372
|
+
|
373
|
+
|
374
|
+
def test_events(num_parallel_threads):
|
375
|
+
def event_rational_1(t, y):
|
376
|
+
return y[0] - y[1] ** 0.7
|
377
|
+
|
378
|
+
def event_rational_2(t, y):
|
379
|
+
return y[1] ** 0.6 - y[0]
|
380
|
+
|
381
|
+
def event_rational_3(t, y):
|
382
|
+
return t - 7.4
|
383
|
+
|
384
|
+
event_rational_3.terminal = True
|
385
|
+
|
386
|
+
for method in ['RK23', 'RK45', 'DOP853', 'Radau', 'BDF', 'LSODA']:
|
387
|
+
if method == 'LSODA' and num_parallel_threads > 1:
|
388
|
+
continue
|
389
|
+
|
390
|
+
res = solve_ivp(fun_rational, [5, 8], [1/3, 2/9], method=method,
|
391
|
+
events=(event_rational_1, event_rational_2))
|
392
|
+
assert_equal(res.status, 0)
|
393
|
+
assert_equal(res.t_events[0].size, 1)
|
394
|
+
assert_equal(res.t_events[1].size, 1)
|
395
|
+
assert_(5.3 < res.t_events[0][0] < 5.7)
|
396
|
+
assert_(7.3 < res.t_events[1][0] < 7.7)
|
397
|
+
|
398
|
+
assert_equal(res.y_events[0].shape, (1, 2))
|
399
|
+
assert_equal(res.y_events[1].shape, (1, 2))
|
400
|
+
assert np.isclose(
|
401
|
+
event_rational_1(res.t_events[0][0], res.y_events[0][0]), 0)
|
402
|
+
assert np.isclose(
|
403
|
+
event_rational_2(res.t_events[1][0], res.y_events[1][0]), 0)
|
404
|
+
|
405
|
+
event_rational_1.direction = 1
|
406
|
+
event_rational_2.direction = 1
|
407
|
+
res = solve_ivp(fun_rational, [5, 8], [1 / 3, 2 / 9], method=method,
|
408
|
+
events=(event_rational_1, event_rational_2))
|
409
|
+
assert_equal(res.status, 0)
|
410
|
+
assert_equal(res.t_events[0].size, 1)
|
411
|
+
assert_equal(res.t_events[1].size, 0)
|
412
|
+
assert_(5.3 < res.t_events[0][0] < 5.7)
|
413
|
+
assert_equal(res.y_events[0].shape, (1, 2))
|
414
|
+
assert_equal(res.y_events[1].shape, (0,))
|
415
|
+
assert np.isclose(
|
416
|
+
event_rational_1(res.t_events[0][0], res.y_events[0][0]), 0)
|
417
|
+
|
418
|
+
event_rational_1.direction = -1
|
419
|
+
event_rational_2.direction = -1
|
420
|
+
res = solve_ivp(fun_rational, [5, 8], [1 / 3, 2 / 9], method=method,
|
421
|
+
events=(event_rational_1, event_rational_2))
|
422
|
+
assert_equal(res.status, 0)
|
423
|
+
assert_equal(res.t_events[0].size, 0)
|
424
|
+
assert_equal(res.t_events[1].size, 1)
|
425
|
+
assert_(7.3 < res.t_events[1][0] < 7.7)
|
426
|
+
assert_equal(res.y_events[0].shape, (0,))
|
427
|
+
assert_equal(res.y_events[1].shape, (1, 2))
|
428
|
+
assert np.isclose(
|
429
|
+
event_rational_2(res.t_events[1][0], res.y_events[1][0]), 0)
|
430
|
+
|
431
|
+
event_rational_1.direction = 0
|
432
|
+
event_rational_2.direction = 0
|
433
|
+
|
434
|
+
res = solve_ivp(fun_rational, [5, 8], [1 / 3, 2 / 9], method=method,
|
435
|
+
events=(event_rational_1, event_rational_2,
|
436
|
+
event_rational_3), dense_output=True)
|
437
|
+
assert_equal(res.status, 1)
|
438
|
+
assert_equal(res.t_events[0].size, 1)
|
439
|
+
assert_equal(res.t_events[1].size, 0)
|
440
|
+
assert_equal(res.t_events[2].size, 1)
|
441
|
+
assert_(5.3 < res.t_events[0][0] < 5.7)
|
442
|
+
assert_(7.3 < res.t_events[2][0] < 7.5)
|
443
|
+
assert_equal(res.y_events[0].shape, (1, 2))
|
444
|
+
assert_equal(res.y_events[1].shape, (0,))
|
445
|
+
assert_equal(res.y_events[2].shape, (1, 2))
|
446
|
+
assert np.isclose(
|
447
|
+
event_rational_1(res.t_events[0][0], res.y_events[0][0]), 0)
|
448
|
+
assert np.isclose(
|
449
|
+
event_rational_3(res.t_events[2][0], res.y_events[2][0]), 0)
|
450
|
+
|
451
|
+
res = solve_ivp(fun_rational, [5, 8], [1 / 3, 2 / 9], method=method,
|
452
|
+
events=event_rational_1, dense_output=True)
|
453
|
+
assert_equal(res.status, 0)
|
454
|
+
assert_equal(res.t_events[0].size, 1)
|
455
|
+
assert_(5.3 < res.t_events[0][0] < 5.7)
|
456
|
+
|
457
|
+
assert_equal(res.y_events[0].shape, (1, 2))
|
458
|
+
assert np.isclose(
|
459
|
+
event_rational_1(res.t_events[0][0], res.y_events[0][0]), 0)
|
460
|
+
|
461
|
+
# Also test that termination by event doesn't break interpolants.
|
462
|
+
tc = np.linspace(res.t[0], res.t[-1])
|
463
|
+
yc_true = sol_rational(tc)
|
464
|
+
yc = res.sol(tc)
|
465
|
+
e = compute_error(yc, yc_true, 1e-3, 1e-6)
|
466
|
+
assert_(np.all(e < 5))
|
467
|
+
|
468
|
+
# Test that the y_event matches solution
|
469
|
+
assert np.allclose(sol_rational(res.t_events[0][0]), res.y_events[0][0],
|
470
|
+
rtol=1e-3, atol=1e-6)
|
471
|
+
|
472
|
+
# Test in backward direction.
|
473
|
+
event_rational_1.direction = 0
|
474
|
+
event_rational_2.direction = 0
|
475
|
+
for method in ['RK23', 'RK45', 'DOP853', 'Radau', 'BDF', 'LSODA']:
|
476
|
+
if method == 'LSODA' and num_parallel_threads > 1:
|
477
|
+
continue
|
478
|
+
|
479
|
+
res = solve_ivp(fun_rational, [8, 5], [4/9, 20/81], method=method,
|
480
|
+
events=(event_rational_1, event_rational_2))
|
481
|
+
assert_equal(res.status, 0)
|
482
|
+
assert_equal(res.t_events[0].size, 1)
|
483
|
+
assert_equal(res.t_events[1].size, 1)
|
484
|
+
assert_(5.3 < res.t_events[0][0] < 5.7)
|
485
|
+
assert_(7.3 < res.t_events[1][0] < 7.7)
|
486
|
+
|
487
|
+
assert_equal(res.y_events[0].shape, (1, 2))
|
488
|
+
assert_equal(res.y_events[1].shape, (1, 2))
|
489
|
+
assert np.isclose(
|
490
|
+
event_rational_1(res.t_events[0][0], res.y_events[0][0]), 0)
|
491
|
+
assert np.isclose(
|
492
|
+
event_rational_2(res.t_events[1][0], res.y_events[1][0]), 0)
|
493
|
+
|
494
|
+
event_rational_1.direction = -1
|
495
|
+
event_rational_2.direction = -1
|
496
|
+
res = solve_ivp(fun_rational, [8, 5], [4/9, 20/81], method=method,
|
497
|
+
events=(event_rational_1, event_rational_2))
|
498
|
+
assert_equal(res.status, 0)
|
499
|
+
assert_equal(res.t_events[0].size, 1)
|
500
|
+
assert_equal(res.t_events[1].size, 0)
|
501
|
+
assert_(5.3 < res.t_events[0][0] < 5.7)
|
502
|
+
|
503
|
+
assert_equal(res.y_events[0].shape, (1, 2))
|
504
|
+
assert_equal(res.y_events[1].shape, (0,))
|
505
|
+
assert np.isclose(
|
506
|
+
event_rational_1(res.t_events[0][0], res.y_events[0][0]), 0)
|
507
|
+
|
508
|
+
event_rational_1.direction = 1
|
509
|
+
event_rational_2.direction = 1
|
510
|
+
res = solve_ivp(fun_rational, [8, 5], [4/9, 20/81], method=method,
|
511
|
+
events=(event_rational_1, event_rational_2))
|
512
|
+
assert_equal(res.status, 0)
|
513
|
+
assert_equal(res.t_events[0].size, 0)
|
514
|
+
assert_equal(res.t_events[1].size, 1)
|
515
|
+
assert_(7.3 < res.t_events[1][0] < 7.7)
|
516
|
+
|
517
|
+
assert_equal(res.y_events[0].shape, (0,))
|
518
|
+
assert_equal(res.y_events[1].shape, (1, 2))
|
519
|
+
assert np.isclose(
|
520
|
+
event_rational_2(res.t_events[1][0], res.y_events[1][0]), 0)
|
521
|
+
|
522
|
+
event_rational_1.direction = 0
|
523
|
+
event_rational_2.direction = 0
|
524
|
+
|
525
|
+
res = solve_ivp(fun_rational, [8, 5], [4/9, 20/81], method=method,
|
526
|
+
events=(event_rational_1, event_rational_2,
|
527
|
+
event_rational_3), dense_output=True)
|
528
|
+
assert_equal(res.status, 1)
|
529
|
+
assert_equal(res.t_events[0].size, 0)
|
530
|
+
assert_equal(res.t_events[1].size, 1)
|
531
|
+
assert_equal(res.t_events[2].size, 1)
|
532
|
+
assert_(7.3 < res.t_events[1][0] < 7.7)
|
533
|
+
assert_(7.3 < res.t_events[2][0] < 7.5)
|
534
|
+
|
535
|
+
assert_equal(res.y_events[0].shape, (0,))
|
536
|
+
assert_equal(res.y_events[1].shape, (1, 2))
|
537
|
+
assert_equal(res.y_events[2].shape, (1, 2))
|
538
|
+
assert np.isclose(
|
539
|
+
event_rational_2(res.t_events[1][0], res.y_events[1][0]), 0)
|
540
|
+
assert np.isclose(
|
541
|
+
event_rational_3(res.t_events[2][0], res.y_events[2][0]), 0)
|
542
|
+
|
543
|
+
# Also test that termination by event doesn't break interpolants.
|
544
|
+
tc = np.linspace(res.t[-1], res.t[0])
|
545
|
+
yc_true = sol_rational(tc)
|
546
|
+
yc = res.sol(tc)
|
547
|
+
e = compute_error(yc, yc_true, 1e-3, 1e-6)
|
548
|
+
assert_(np.all(e < 5))
|
549
|
+
|
550
|
+
assert np.allclose(sol_rational(res.t_events[1][0]), res.y_events[1][0],
|
551
|
+
rtol=1e-3, atol=1e-6)
|
552
|
+
assert np.allclose(sol_rational(res.t_events[2][0]), res.y_events[2][0],
|
553
|
+
rtol=1e-3, atol=1e-6)
|
554
|
+
|
555
|
+
|
556
|
+
def _get_harmonic_oscillator():
|
557
|
+
def f(t, y):
|
558
|
+
return [y[1], -y[0]]
|
559
|
+
|
560
|
+
def event(t, y):
|
561
|
+
return y[0]
|
562
|
+
|
563
|
+
return f, event
|
564
|
+
|
565
|
+
|
566
|
+
@pytest.mark.parametrize('n_events', [3, 4])
|
567
|
+
def test_event_terminal_integer(n_events):
|
568
|
+
f, event = _get_harmonic_oscillator()
|
569
|
+
event.terminal = n_events
|
570
|
+
res = solve_ivp(f, (0, 100), [1, 0], events=event)
|
571
|
+
assert len(res.t_events[0]) == n_events
|
572
|
+
assert len(res.y_events[0]) == n_events
|
573
|
+
assert_allclose(res.y_events[0][:, 0], 0, atol=1e-14)
|
574
|
+
|
575
|
+
|
576
|
+
def test_event_terminal_iv():
|
577
|
+
f, event = _get_harmonic_oscillator()
|
578
|
+
args = (f, (0, 100), [1, 0])
|
579
|
+
|
580
|
+
event.terminal = None
|
581
|
+
res = solve_ivp(*args, events=event)
|
582
|
+
event.terminal = 0
|
583
|
+
ref = solve_ivp(*args, events=event)
|
584
|
+
assert_allclose(res.t_events, ref.t_events)
|
585
|
+
|
586
|
+
message = "The `terminal` attribute..."
|
587
|
+
event.terminal = -1
|
588
|
+
with pytest.raises(ValueError, match=message):
|
589
|
+
solve_ivp(*args, events=event)
|
590
|
+
event.terminal = 3.5
|
591
|
+
with pytest.raises(ValueError, match=message):
|
592
|
+
solve_ivp(*args, events=event)
|
593
|
+
|
594
|
+
|
595
|
+
def test_max_step(num_parallel_threads):
|
596
|
+
rtol = 1e-3
|
597
|
+
atol = 1e-6
|
598
|
+
y0 = [1/3, 2/9]
|
599
|
+
for method in [RK23, RK45, DOP853, Radau, BDF, LSODA]:
|
600
|
+
if method is LSODA and num_parallel_threads > 1:
|
601
|
+
continue
|
602
|
+
for t_span in ([5, 9], [5, 1]):
|
603
|
+
res = solve_ivp(fun_rational, t_span, y0, rtol=rtol,
|
604
|
+
max_step=0.5, atol=atol, method=method,
|
605
|
+
dense_output=True)
|
606
|
+
assert_equal(res.t[0], t_span[0])
|
607
|
+
assert_equal(res.t[-1], t_span[-1])
|
608
|
+
assert_(np.all(np.abs(np.diff(res.t)) <= 0.5 + 1e-15))
|
609
|
+
assert_(res.t_events is None)
|
610
|
+
assert_(res.success)
|
611
|
+
assert_equal(res.status, 0)
|
612
|
+
|
613
|
+
y_true = sol_rational(res.t)
|
614
|
+
e = compute_error(res.y, y_true, rtol, atol)
|
615
|
+
assert_(np.all(e < 5))
|
616
|
+
|
617
|
+
tc = np.linspace(*t_span)
|
618
|
+
yc_true = sol_rational(tc)
|
619
|
+
yc = res.sol(tc)
|
620
|
+
|
621
|
+
e = compute_error(yc, yc_true, rtol, atol)
|
622
|
+
assert_(np.all(e < 5))
|
623
|
+
|
624
|
+
assert_allclose(res.sol(res.t), res.y, rtol=1e-15, atol=1e-15)
|
625
|
+
|
626
|
+
assert_raises(ValueError, method, fun_rational, t_span[0], y0,
|
627
|
+
t_span[1], max_step=-1)
|
628
|
+
|
629
|
+
if method is not LSODA:
|
630
|
+
solver = method(fun_rational, t_span[0], y0, t_span[1],
|
631
|
+
rtol=rtol, atol=atol, max_step=1e-20)
|
632
|
+
message = solver.step()
|
633
|
+
message = solver.step() # First step succeeds but second step fails.
|
634
|
+
assert_equal(solver.status, 'failed')
|
635
|
+
assert_("step size is less" in message)
|
636
|
+
assert_raises(RuntimeError, solver.step)
|
637
|
+
|
638
|
+
|
639
|
+
def test_first_step(num_parallel_threads):
|
640
|
+
rtol = 1e-3
|
641
|
+
atol = 1e-6
|
642
|
+
y0 = [1/3, 2/9]
|
643
|
+
first_step = 0.1
|
644
|
+
for method in [RK23, RK45, DOP853, Radau, BDF, LSODA]:
|
645
|
+
if method is LSODA and num_parallel_threads > 1:
|
646
|
+
continue
|
647
|
+
for t_span in ([5, 9], [5, 1]):
|
648
|
+
res = solve_ivp(fun_rational, t_span, y0, rtol=rtol,
|
649
|
+
max_step=0.5, atol=atol, method=method,
|
650
|
+
dense_output=True, first_step=first_step)
|
651
|
+
|
652
|
+
assert_equal(res.t[0], t_span[0])
|
653
|
+
assert_equal(res.t[-1], t_span[-1])
|
654
|
+
assert_allclose(first_step, np.abs(res.t[1] - 5))
|
655
|
+
assert_(res.t_events is None)
|
656
|
+
assert_(res.success)
|
657
|
+
assert_equal(res.status, 0)
|
658
|
+
|
659
|
+
y_true = sol_rational(res.t)
|
660
|
+
e = compute_error(res.y, y_true, rtol, atol)
|
661
|
+
assert_(np.all(e < 5))
|
662
|
+
|
663
|
+
tc = np.linspace(*t_span)
|
664
|
+
yc_true = sol_rational(tc)
|
665
|
+
yc = res.sol(tc)
|
666
|
+
|
667
|
+
e = compute_error(yc, yc_true, rtol, atol)
|
668
|
+
assert_(np.all(e < 5))
|
669
|
+
|
670
|
+
assert_allclose(res.sol(res.t), res.y, rtol=1e-15, atol=1e-15)
|
671
|
+
|
672
|
+
assert_raises(ValueError, method, fun_rational, t_span[0], y0,
|
673
|
+
t_span[1], first_step=-1)
|
674
|
+
assert_raises(ValueError, method, fun_rational, t_span[0], y0,
|
675
|
+
t_span[1], first_step=5)
|
676
|
+
|
677
|
+
|
678
|
+
def test_t_eval():
|
679
|
+
rtol = 1e-3
|
680
|
+
atol = 1e-6
|
681
|
+
y0 = [1/3, 2/9]
|
682
|
+
for t_span in ([5, 9], [5, 1]):
|
683
|
+
t_eval = np.linspace(t_span[0], t_span[1], 10)
|
684
|
+
res = solve_ivp(fun_rational, t_span, y0, rtol=rtol, atol=atol,
|
685
|
+
t_eval=t_eval)
|
686
|
+
assert_equal(res.t, t_eval)
|
687
|
+
assert_(res.t_events is None)
|
688
|
+
assert_(res.success)
|
689
|
+
assert_equal(res.status, 0)
|
690
|
+
|
691
|
+
y_true = sol_rational(res.t)
|
692
|
+
e = compute_error(res.y, y_true, rtol, atol)
|
693
|
+
assert_(np.all(e < 5))
|
694
|
+
|
695
|
+
t_eval = [5, 5.01, 7, 8, 8.01, 9]
|
696
|
+
res = solve_ivp(fun_rational, [5, 9], y0, rtol=rtol, atol=atol,
|
697
|
+
t_eval=t_eval)
|
698
|
+
assert_equal(res.t, t_eval)
|
699
|
+
assert_(res.t_events is None)
|
700
|
+
assert_(res.success)
|
701
|
+
assert_equal(res.status, 0)
|
702
|
+
|
703
|
+
y_true = sol_rational(res.t)
|
704
|
+
e = compute_error(res.y, y_true, rtol, atol)
|
705
|
+
assert_(np.all(e < 5))
|
706
|
+
|
707
|
+
t_eval = [5, 4.99, 3, 1.5, 1.1, 1.01, 1]
|
708
|
+
res = solve_ivp(fun_rational, [5, 1], y0, rtol=rtol, atol=atol,
|
709
|
+
t_eval=t_eval)
|
710
|
+
assert_equal(res.t, t_eval)
|
711
|
+
assert_(res.t_events is None)
|
712
|
+
assert_(res.success)
|
713
|
+
assert_equal(res.status, 0)
|
714
|
+
|
715
|
+
t_eval = [5.01, 7, 8, 8.01]
|
716
|
+
res = solve_ivp(fun_rational, [5, 9], y0, rtol=rtol, atol=atol,
|
717
|
+
t_eval=t_eval)
|
718
|
+
assert_equal(res.t, t_eval)
|
719
|
+
assert_(res.t_events is None)
|
720
|
+
assert_(res.success)
|
721
|
+
assert_equal(res.status, 0)
|
722
|
+
|
723
|
+
y_true = sol_rational(res.t)
|
724
|
+
e = compute_error(res.y, y_true, rtol, atol)
|
725
|
+
assert_(np.all(e < 5))
|
726
|
+
|
727
|
+
t_eval = [4.99, 3, 1.5, 1.1, 1.01]
|
728
|
+
res = solve_ivp(fun_rational, [5, 1], y0, rtol=rtol, atol=atol,
|
729
|
+
t_eval=t_eval)
|
730
|
+
assert_equal(res.t, t_eval)
|
731
|
+
assert_(res.t_events is None)
|
732
|
+
assert_(res.success)
|
733
|
+
assert_equal(res.status, 0)
|
734
|
+
|
735
|
+
t_eval = [4, 6]
|
736
|
+
assert_raises(ValueError, solve_ivp, fun_rational, [5, 9], y0,
|
737
|
+
rtol=rtol, atol=atol, t_eval=t_eval)
|
738
|
+
|
739
|
+
|
740
|
+
def test_t_eval_dense_output():
|
741
|
+
rtol = 1e-3
|
742
|
+
atol = 1e-6
|
743
|
+
y0 = [1/3, 2/9]
|
744
|
+
t_span = [5, 9]
|
745
|
+
t_eval = np.linspace(t_span[0], t_span[1], 10)
|
746
|
+
res = solve_ivp(fun_rational, t_span, y0, rtol=rtol, atol=atol,
|
747
|
+
t_eval=t_eval)
|
748
|
+
res_d = solve_ivp(fun_rational, t_span, y0, rtol=rtol, atol=atol,
|
749
|
+
t_eval=t_eval, dense_output=True)
|
750
|
+
assert_equal(res.t, t_eval)
|
751
|
+
assert_(res.t_events is None)
|
752
|
+
assert_(res.success)
|
753
|
+
assert_equal(res.status, 0)
|
754
|
+
|
755
|
+
assert_equal(res.t, res_d.t)
|
756
|
+
assert_equal(res.y, res_d.y)
|
757
|
+
assert_(res_d.t_events is None)
|
758
|
+
assert_(res_d.success)
|
759
|
+
assert_equal(res_d.status, 0)
|
760
|
+
|
761
|
+
# if t and y are equal only test values for one case
|
762
|
+
y_true = sol_rational(res.t)
|
763
|
+
e = compute_error(res.y, y_true, rtol, atol)
|
764
|
+
assert_(np.all(e < 5))
|
765
|
+
|
766
|
+
|
767
|
+
@pytest.mark.thread_unsafe
|
768
|
+
def test_t_eval_early_event():
|
769
|
+
def early_event(t, y):
|
770
|
+
return t - 7
|
771
|
+
|
772
|
+
early_event.terminal = True
|
773
|
+
|
774
|
+
rtol = 1e-3
|
775
|
+
atol = 1e-6
|
776
|
+
y0 = [1/3, 2/9]
|
777
|
+
t_span = [5, 9]
|
778
|
+
t_eval = np.linspace(7.5, 9, 16)
|
779
|
+
for method in ['RK23', 'RK45', 'DOP853', 'Radau', 'BDF', 'LSODA']:
|
780
|
+
with suppress_warnings() as sup:
|
781
|
+
sup.filter(UserWarning,
|
782
|
+
"The following arguments have no effect for a chosen "
|
783
|
+
"solver: `jac`")
|
784
|
+
res = solve_ivp(fun_rational, t_span, y0, rtol=rtol, atol=atol,
|
785
|
+
method=method, t_eval=t_eval, events=early_event,
|
786
|
+
jac=jac_rational)
|
787
|
+
assert res.success
|
788
|
+
assert res.message == 'A termination event occurred.'
|
789
|
+
assert res.status == 1
|
790
|
+
assert not res.t and not res.y
|
791
|
+
assert len(res.t_events) == 1
|
792
|
+
assert res.t_events[0].size == 1
|
793
|
+
assert res.t_events[0][0] == 7
|
794
|
+
|
795
|
+
|
796
|
+
def test_event_dense_output_LSODA(num_parallel_threads):
|
797
|
+
if num_parallel_threads > 1:
|
798
|
+
pytest.skip('LSODA does not allow for concurrent execution')
|
799
|
+
|
800
|
+
def event_lsoda(t, y):
|
801
|
+
return y[0] - 2.02e-5
|
802
|
+
|
803
|
+
rtol = 1e-3
|
804
|
+
atol = 1e-6
|
805
|
+
y0 = [0.05]
|
806
|
+
t_span = [-2, 2]
|
807
|
+
first_step = 1e-3
|
808
|
+
res = solve_ivp(
|
809
|
+
fun_event_dense_output_LSODA,
|
810
|
+
t_span,
|
811
|
+
y0,
|
812
|
+
method="LSODA",
|
813
|
+
dense_output=True,
|
814
|
+
events=event_lsoda,
|
815
|
+
first_step=first_step,
|
816
|
+
max_step=1,
|
817
|
+
rtol=rtol,
|
818
|
+
atol=atol,
|
819
|
+
jac=jac_event_dense_output_LSODA,
|
820
|
+
)
|
821
|
+
|
822
|
+
assert_equal(res.t[0], t_span[0])
|
823
|
+
assert_equal(res.t[-1], t_span[-1])
|
824
|
+
assert_allclose(first_step, np.abs(res.t[1] - t_span[0]))
|
825
|
+
assert res.success
|
826
|
+
assert_equal(res.status, 0)
|
827
|
+
|
828
|
+
y_true = sol_event_dense_output_LSODA(res.t)
|
829
|
+
e = compute_error(res.y, y_true, rtol, atol)
|
830
|
+
assert_array_less(e, 5)
|
831
|
+
|
832
|
+
tc = np.linspace(*t_span)
|
833
|
+
yc_true = sol_event_dense_output_LSODA(tc)
|
834
|
+
yc = res.sol(tc)
|
835
|
+
e = compute_error(yc, yc_true, rtol, atol)
|
836
|
+
assert_array_less(e, 5)
|
837
|
+
|
838
|
+
assert_allclose(res.sol(res.t), res.y, rtol=1e-15, atol=1e-15)
|
839
|
+
|
840
|
+
|
841
|
+
def test_no_integration():
|
842
|
+
for method in ['RK23', 'RK45', 'DOP853', 'Radau', 'BDF', 'LSODA']:
|
843
|
+
sol = solve_ivp(lambda t, y: -y, [4, 4], [2, 3],
|
844
|
+
method=method, dense_output=True)
|
845
|
+
assert_equal(sol.sol(4), [2, 3])
|
846
|
+
assert_equal(sol.sol([4, 5, 6]), [[2, 2, 2], [3, 3, 3]])
|
847
|
+
|
848
|
+
|
849
|
+
def test_no_integration_class():
|
850
|
+
for method in [RK23, RK45, DOP853, Radau, BDF, LSODA]:
|
851
|
+
solver = method(lambda t, y: -y, 0.0, [10.0, 0.0], 0.0)
|
852
|
+
solver.step()
|
853
|
+
assert_equal(solver.status, 'finished')
|
854
|
+
sol = solver.dense_output()
|
855
|
+
assert_equal(sol(0.0), [10.0, 0.0])
|
856
|
+
assert_equal(sol([0, 1, 2]), [[10, 10, 10], [0, 0, 0]])
|
857
|
+
|
858
|
+
solver = method(lambda t, y: -y, 0.0, [], np.inf)
|
859
|
+
solver.step()
|
860
|
+
assert_equal(solver.status, 'finished')
|
861
|
+
sol = solver.dense_output()
|
862
|
+
assert_equal(sol(100.0), [])
|
863
|
+
assert_equal(sol([0, 1, 2]), np.empty((0, 3)))
|
864
|
+
|
865
|
+
|
866
|
+
def test_empty():
|
867
|
+
def fun(t, y):
|
868
|
+
return np.zeros((0,))
|
869
|
+
|
870
|
+
y0 = np.zeros((0,))
|
871
|
+
|
872
|
+
for method in ['RK23', 'RK45', 'DOP853', 'Radau', 'BDF', 'LSODA']:
|
873
|
+
sol = assert_no_warnings(solve_ivp, fun, [0, 10], y0,
|
874
|
+
method=method, dense_output=True)
|
875
|
+
assert_equal(sol.sol(10), np.zeros((0,)))
|
876
|
+
assert_equal(sol.sol([1, 2, 3]), np.zeros((0, 3)))
|
877
|
+
|
878
|
+
for method in ['RK23', 'RK45', 'DOP853', 'Radau', 'BDF', 'LSODA']:
|
879
|
+
sol = assert_no_warnings(solve_ivp, fun, [0, np.inf], y0,
|
880
|
+
method=method, dense_output=True)
|
881
|
+
assert_equal(sol.sol(10), np.zeros((0,)))
|
882
|
+
assert_equal(sol.sol([1, 2, 3]), np.zeros((0, 3)))
|
883
|
+
|
884
|
+
|
885
|
+
def test_ConstantDenseOutput():
|
886
|
+
sol = ConstantDenseOutput(0, 1, np.array([1, 2]))
|
887
|
+
assert_allclose(sol(1.5), [1, 2])
|
888
|
+
assert_allclose(sol([1, 1.5, 2]), [[1, 1, 1], [2, 2, 2]])
|
889
|
+
|
890
|
+
sol = ConstantDenseOutput(0, 1, np.array([]))
|
891
|
+
assert_allclose(sol(1.5), np.empty(0))
|
892
|
+
assert_allclose(sol([1, 1.5, 2]), np.empty((0, 3)))
|
893
|
+
|
894
|
+
|
895
|
+
def test_classes():
|
896
|
+
y0 = [1 / 3, 2 / 9]
|
897
|
+
for cls in [RK23, RK45, DOP853, Radau, BDF, LSODA]:
|
898
|
+
solver = cls(fun_rational, 5, y0, np.inf)
|
899
|
+
assert_equal(solver.n, 2)
|
900
|
+
assert_equal(solver.status, 'running')
|
901
|
+
assert_equal(solver.t_bound, np.inf)
|
902
|
+
assert_equal(solver.direction, 1)
|
903
|
+
assert_equal(solver.t, 5)
|
904
|
+
assert_equal(solver.y, y0)
|
905
|
+
assert_(solver.step_size is None)
|
906
|
+
if cls is not LSODA:
|
907
|
+
assert_(solver.nfev > 0)
|
908
|
+
assert_(solver.njev >= 0)
|
909
|
+
assert_equal(solver.nlu, 0)
|
910
|
+
else:
|
911
|
+
assert_equal(solver.nfev, 0)
|
912
|
+
assert_equal(solver.njev, 0)
|
913
|
+
assert_equal(solver.nlu, 0)
|
914
|
+
|
915
|
+
assert_raises(RuntimeError, solver.dense_output)
|
916
|
+
|
917
|
+
message = solver.step()
|
918
|
+
assert_equal(solver.status, 'running')
|
919
|
+
assert_equal(message, None)
|
920
|
+
assert_equal(solver.n, 2)
|
921
|
+
assert_equal(solver.t_bound, np.inf)
|
922
|
+
assert_equal(solver.direction, 1)
|
923
|
+
assert_(solver.t > 5)
|
924
|
+
assert_(not np.all(np.equal(solver.y, y0)))
|
925
|
+
assert_(solver.step_size > 0)
|
926
|
+
assert_(solver.nfev > 0)
|
927
|
+
assert_(solver.njev >= 0)
|
928
|
+
assert_(solver.nlu >= 0)
|
929
|
+
sol = solver.dense_output()
|
930
|
+
assert_allclose(sol(5), y0, rtol=1e-15, atol=0)
|
931
|
+
|
932
|
+
|
933
|
+
def test_OdeSolution():
|
934
|
+
ts = np.array([0, 2, 5], dtype=float)
|
935
|
+
s1 = ConstantDenseOutput(ts[0], ts[1], np.array([-1]))
|
936
|
+
s2 = ConstantDenseOutput(ts[1], ts[2], np.array([1]))
|
937
|
+
|
938
|
+
sol = OdeSolution(ts, [s1, s2])
|
939
|
+
|
940
|
+
assert_equal(sol(-1), [-1])
|
941
|
+
assert_equal(sol(1), [-1])
|
942
|
+
assert_equal(sol(2), [-1])
|
943
|
+
assert_equal(sol(3), [1])
|
944
|
+
assert_equal(sol(5), [1])
|
945
|
+
assert_equal(sol(6), [1])
|
946
|
+
|
947
|
+
assert_equal(sol([0, 6, -2, 1.5, 4.5, 2.5, 5, 5.5, 2]),
|
948
|
+
np.array([[-1, 1, -1, -1, 1, 1, 1, 1, -1]]))
|
949
|
+
|
950
|
+
ts = np.array([10, 4, -3])
|
951
|
+
s1 = ConstantDenseOutput(ts[0], ts[1], np.array([-1]))
|
952
|
+
s2 = ConstantDenseOutput(ts[1], ts[2], np.array([1]))
|
953
|
+
|
954
|
+
sol = OdeSolution(ts, [s1, s2])
|
955
|
+
assert_equal(sol(11), [-1])
|
956
|
+
assert_equal(sol(10), [-1])
|
957
|
+
assert_equal(sol(5), [-1])
|
958
|
+
assert_equal(sol(4), [-1])
|
959
|
+
assert_equal(sol(0), [1])
|
960
|
+
assert_equal(sol(-3), [1])
|
961
|
+
assert_equal(sol(-4), [1])
|
962
|
+
|
963
|
+
assert_equal(sol([12, -5, 10, -3, 6, 1, 4]),
|
964
|
+
np.array([[-1, 1, -1, 1, -1, 1, -1]]))
|
965
|
+
|
966
|
+
ts = np.array([1, 1])
|
967
|
+
s = ConstantDenseOutput(1, 1, np.array([10]))
|
968
|
+
sol = OdeSolution(ts, [s])
|
969
|
+
assert_equal(sol(0), [10])
|
970
|
+
assert_equal(sol(1), [10])
|
971
|
+
assert_equal(sol(2), [10])
|
972
|
+
|
973
|
+
assert_equal(sol([2, 1, 0]), np.array([[10, 10, 10]]))
|
974
|
+
|
975
|
+
|
976
|
+
def test_num_jac():
|
977
|
+
def fun(t, y):
|
978
|
+
return np.vstack([
|
979
|
+
-0.04 * y[0] + 1e4 * y[1] * y[2],
|
980
|
+
0.04 * y[0] - 1e4 * y[1] * y[2] - 3e7 * y[1] ** 2,
|
981
|
+
3e7 * y[1] ** 2
|
982
|
+
])
|
983
|
+
|
984
|
+
def jac(t, y):
|
985
|
+
return np.array([
|
986
|
+
[-0.04, 1e4 * y[2], 1e4 * y[1]],
|
987
|
+
[0.04, -1e4 * y[2] - 6e7 * y[1], -1e4 * y[1]],
|
988
|
+
[0, 6e7 * y[1], 0]
|
989
|
+
])
|
990
|
+
|
991
|
+
t = 1
|
992
|
+
y = np.array([1, 0, 0])
|
993
|
+
J_true = jac(t, y)
|
994
|
+
threshold = 1e-5
|
995
|
+
f = fun(t, y).ravel()
|
996
|
+
|
997
|
+
J_num, factor = num_jac(fun, t, y, f, threshold, None)
|
998
|
+
assert_allclose(J_num, J_true, rtol=1e-5, atol=1e-5)
|
999
|
+
|
1000
|
+
J_num, factor = num_jac(fun, t, y, f, threshold, factor)
|
1001
|
+
assert_allclose(J_num, J_true, rtol=1e-5, atol=1e-5)
|
1002
|
+
|
1003
|
+
|
1004
|
+
def test_num_jac_sparse():
|
1005
|
+
def fun(t, y):
|
1006
|
+
e = y[1:]**3 - y[:-1]**2
|
1007
|
+
z = np.zeros(y.shape[1])
|
1008
|
+
return np.vstack((z, 3 * e)) + np.vstack((2 * e, z))
|
1009
|
+
|
1010
|
+
def structure(n):
|
1011
|
+
A = np.zeros((n, n), dtype=int)
|
1012
|
+
A[0, 0] = 1
|
1013
|
+
A[0, 1] = 1
|
1014
|
+
for i in range(1, n - 1):
|
1015
|
+
A[i, i - 1: i + 2] = 1
|
1016
|
+
A[-1, -1] = 1
|
1017
|
+
A[-1, -2] = 1
|
1018
|
+
|
1019
|
+
return A
|
1020
|
+
|
1021
|
+
np.random.seed(0)
|
1022
|
+
n = 20
|
1023
|
+
y = np.random.randn(n)
|
1024
|
+
A = structure(n)
|
1025
|
+
groups = group_columns(A)
|
1026
|
+
|
1027
|
+
f = fun(0, y[:, None]).ravel()
|
1028
|
+
|
1029
|
+
# Compare dense and sparse results, assuming that dense implementation
|
1030
|
+
# is correct (as it is straightforward).
|
1031
|
+
J_num_sparse, factor_sparse = num_jac(fun, 0, y.ravel(), f, 1e-8, None,
|
1032
|
+
sparsity=(A, groups))
|
1033
|
+
J_num_dense, factor_dense = num_jac(fun, 0, y.ravel(), f, 1e-8, None)
|
1034
|
+
assert_allclose(J_num_dense, J_num_sparse.toarray(),
|
1035
|
+
rtol=1e-12, atol=1e-14)
|
1036
|
+
assert_allclose(factor_dense, factor_sparse, rtol=1e-12, atol=1e-14)
|
1037
|
+
|
1038
|
+
# Take small factors to trigger their recomputing inside.
|
1039
|
+
factor = np.random.uniform(0, 1e-12, size=n)
|
1040
|
+
J_num_sparse, factor_sparse = num_jac(fun, 0, y.ravel(), f, 1e-8, factor,
|
1041
|
+
sparsity=(A, groups))
|
1042
|
+
J_num_dense, factor_dense = num_jac(fun, 0, y.ravel(), f, 1e-8, factor)
|
1043
|
+
|
1044
|
+
assert_allclose(J_num_dense, J_num_sparse.toarray(),
|
1045
|
+
rtol=1e-12, atol=1e-14)
|
1046
|
+
assert_allclose(factor_dense, factor_sparse, rtol=1e-12, atol=1e-14)
|
1047
|
+
|
1048
|
+
|
1049
|
+
def test_args():
|
1050
|
+
|
1051
|
+
# sys3 is actually two decoupled systems. (x, y) form a
|
1052
|
+
# linear oscillator, while z is a nonlinear first order
|
1053
|
+
# system with equilibria at z=0 and z=1. If k > 0, z=1
|
1054
|
+
# is stable and z=0 is unstable.
|
1055
|
+
|
1056
|
+
def sys3(t, w, omega, k, zfinal):
|
1057
|
+
x, y, z = w
|
1058
|
+
return [-omega*y, omega*x, k*z*(1 - z)]
|
1059
|
+
|
1060
|
+
def sys3_jac(t, w, omega, k, zfinal):
|
1061
|
+
x, y, z = w
|
1062
|
+
J = np.array([[0, -omega, 0],
|
1063
|
+
[omega, 0, 0],
|
1064
|
+
[0, 0, k*(1 - 2*z)]])
|
1065
|
+
return J
|
1066
|
+
|
1067
|
+
def sys3_x0decreasing(t, w, omega, k, zfinal):
|
1068
|
+
x, y, z = w
|
1069
|
+
return x
|
1070
|
+
|
1071
|
+
def sys3_y0increasing(t, w, omega, k, zfinal):
|
1072
|
+
x, y, z = w
|
1073
|
+
return y
|
1074
|
+
|
1075
|
+
def sys3_zfinal(t, w, omega, k, zfinal):
|
1076
|
+
x, y, z = w
|
1077
|
+
return z - zfinal
|
1078
|
+
|
1079
|
+
# Set the event flags for the event functions.
|
1080
|
+
sys3_x0decreasing.direction = -1
|
1081
|
+
sys3_y0increasing.direction = 1
|
1082
|
+
sys3_zfinal.terminal = True
|
1083
|
+
|
1084
|
+
omega = 2
|
1085
|
+
k = 4
|
1086
|
+
|
1087
|
+
tfinal = 5
|
1088
|
+
zfinal = 0.99
|
1089
|
+
# Find z0 such that when z(0) = z0, z(tfinal) = zfinal.
|
1090
|
+
# The condition z(tfinal) = zfinal is the terminal event.
|
1091
|
+
z0 = np.exp(-k*tfinal)/((1 - zfinal)/zfinal + np.exp(-k*tfinal))
|
1092
|
+
|
1093
|
+
w0 = [0, -1, z0]
|
1094
|
+
|
1095
|
+
# Provide the jac argument and use the Radau method to ensure that the use
|
1096
|
+
# of the Jacobian function is exercised.
|
1097
|
+
# If event handling is working, the solution will stop at tfinal, not tend.
|
1098
|
+
tend = 2*tfinal
|
1099
|
+
sol = solve_ivp(sys3, [0, tend], w0,
|
1100
|
+
events=[sys3_x0decreasing, sys3_y0increasing, sys3_zfinal],
|
1101
|
+
dense_output=True, args=(omega, k, zfinal),
|
1102
|
+
method='Radau', jac=sys3_jac,
|
1103
|
+
rtol=1e-10, atol=1e-13)
|
1104
|
+
|
1105
|
+
# Check that we got the expected events at the expected times.
|
1106
|
+
x0events_t = sol.t_events[0]
|
1107
|
+
y0events_t = sol.t_events[1]
|
1108
|
+
zfinalevents_t = sol.t_events[2]
|
1109
|
+
assert_allclose(x0events_t, [0.5*np.pi, 1.5*np.pi])
|
1110
|
+
assert_allclose(y0events_t, [0.25*np.pi, 1.25*np.pi])
|
1111
|
+
assert_allclose(zfinalevents_t, [tfinal])
|
1112
|
+
|
1113
|
+
# Check that the solution agrees with the known exact solution.
|
1114
|
+
t = np.linspace(0, zfinalevents_t[0], 250)
|
1115
|
+
w = sol.sol(t)
|
1116
|
+
assert_allclose(w[0], np.sin(omega*t), rtol=1e-9, atol=1e-12)
|
1117
|
+
assert_allclose(w[1], -np.cos(omega*t), rtol=1e-9, atol=1e-12)
|
1118
|
+
assert_allclose(w[2], 1/(((1 - z0)/z0)*np.exp(-k*t) + 1),
|
1119
|
+
rtol=1e-9, atol=1e-12)
|
1120
|
+
|
1121
|
+
# Check that the state variables have the expected values at the events.
|
1122
|
+
x0events = sol.sol(x0events_t)
|
1123
|
+
y0events = sol.sol(y0events_t)
|
1124
|
+
zfinalevents = sol.sol(zfinalevents_t)
|
1125
|
+
assert_allclose(x0events[0], np.zeros_like(x0events[0]), atol=5e-14)
|
1126
|
+
assert_allclose(x0events[1], np.ones_like(x0events[1]))
|
1127
|
+
assert_allclose(y0events[0], np.ones_like(y0events[0]))
|
1128
|
+
assert_allclose(y0events[1], np.zeros_like(y0events[1]), atol=5e-14)
|
1129
|
+
assert_allclose(zfinalevents[2], [zfinal])
|
1130
|
+
|
1131
|
+
|
1132
|
+
@pytest.mark.thread_unsafe
|
1133
|
+
def test_array_rtol():
|
1134
|
+
# solve_ivp had a bug with array_like `rtol`; see gh-15482
|
1135
|
+
# check that it's fixed
|
1136
|
+
def f(t, y):
|
1137
|
+
return y[0], y[1]
|
1138
|
+
|
1139
|
+
# no warning (or error) when `rtol` is array_like
|
1140
|
+
sol = solve_ivp(f, (0, 1), [1., 1.], rtol=[1e-1, 1e-1])
|
1141
|
+
err1 = np.abs(np.linalg.norm(sol.y[:, -1] - np.exp(1)))
|
1142
|
+
|
1143
|
+
# warning when an element of `rtol` is too small
|
1144
|
+
with pytest.warns(UserWarning, match="At least one element..."):
|
1145
|
+
sol = solve_ivp(f, (0, 1), [1., 1.], rtol=[1e-1, 1e-16])
|
1146
|
+
err2 = np.abs(np.linalg.norm(sol.y[:, -1] - np.exp(1)))
|
1147
|
+
|
1148
|
+
# tighter rtol improves the error
|
1149
|
+
assert err2 < err1
|
1150
|
+
|
1151
|
+
|
1152
|
+
@pytest.mark.parametrize('method', ['RK23', 'RK45', 'DOP853', 'Radau', 'BDF', 'LSODA'])
|
1153
|
+
def test_integration_zero_rhs(method, num_parallel_threads):
|
1154
|
+
if method == 'LSODA' and num_parallel_threads > 1:
|
1155
|
+
pytest.skip(reason='LSODA does not allow for concurrent execution')
|
1156
|
+
|
1157
|
+
result = solve_ivp(fun_zero, [0, 10], np.ones(3), method=method)
|
1158
|
+
assert_(result.success)
|
1159
|
+
assert_equal(result.status, 0)
|
1160
|
+
assert_allclose(result.y, 1.0, rtol=1e-15)
|
1161
|
+
|
1162
|
+
|
1163
|
+
def test_args_single_value():
|
1164
|
+
def fun_with_arg(t, y, a):
|
1165
|
+
return a*y
|
1166
|
+
|
1167
|
+
message = "Supplied 'args' cannot be unpacked."
|
1168
|
+
with pytest.raises(TypeError, match=message):
|
1169
|
+
solve_ivp(fun_with_arg, (0, 0.1), [1], args=-1)
|
1170
|
+
|
1171
|
+
sol = solve_ivp(fun_with_arg, (0, 0.1), [1], args=(-1,))
|
1172
|
+
assert_allclose(sol.y[0, -1], np.exp(-0.1))
|
1173
|
+
|
1174
|
+
|
1175
|
+
@pytest.mark.parametrize("f0_fill", [np.nan, np.inf])
|
1176
|
+
def test_initial_state_finiteness(f0_fill):
|
1177
|
+
# regression test for gh-17846
|
1178
|
+
msg = "All components of the initial state `y0` must be finite."
|
1179
|
+
with pytest.raises(ValueError, match=msg):
|
1180
|
+
solve_ivp(fun_zero, [0, 10], np.full(3, f0_fill))
|
1181
|
+
|
1182
|
+
|
1183
|
+
@pytest.mark.parametrize('method', ['RK23', 'RK45', 'DOP853', 'Radau', 'BDF'])
|
1184
|
+
def test_zero_interval(method):
|
1185
|
+
# Case where upper and lower limits of integration are the same
|
1186
|
+
# Result of integration should match initial state.
|
1187
|
+
# f[y(t)] = 2y(t)
|
1188
|
+
def f(t, y):
|
1189
|
+
return 2 * y
|
1190
|
+
res = solve_ivp(f, (0.0, 0.0), np.array([1.0]), method=method)
|
1191
|
+
assert res.success
|
1192
|
+
assert_allclose(res.y[0, -1], 1.0)
|
1193
|
+
|
1194
|
+
|
1195
|
+
@pytest.mark.parametrize('method', ['RK23', 'RK45', 'DOP853', 'Radau', 'BDF'])
|
1196
|
+
def test_tbound_respected_small_interval(method):
|
1197
|
+
"""Regression test for gh-17341"""
|
1198
|
+
SMALL = 1e-4
|
1199
|
+
|
1200
|
+
# f[y(t)] = 2y(t) on t in [0,SMALL]
|
1201
|
+
# undefined otherwise
|
1202
|
+
def f(t, y):
|
1203
|
+
if t > SMALL:
|
1204
|
+
raise ValueError("Function was evaluated outside interval")
|
1205
|
+
return 2 * y
|
1206
|
+
res = solve_ivp(f, (0.0, SMALL), np.array([1]), method=method)
|
1207
|
+
assert res.success
|
1208
|
+
|
1209
|
+
|
1210
|
+
@pytest.mark.parametrize('method', ['RK23', 'RK45', 'DOP853', 'Radau', 'BDF'])
|
1211
|
+
def test_tbound_respected_larger_interval(method):
|
1212
|
+
"""Regression test for gh-8848"""
|
1213
|
+
def V(r):
|
1214
|
+
return -11/r + 10 * r / (0.05 + r**2)
|
1215
|
+
|
1216
|
+
def func(t, p):
|
1217
|
+
if t < -17 or t > 2:
|
1218
|
+
raise ValueError("Function was evaluated outside interval")
|
1219
|
+
P = p[0]
|
1220
|
+
Q = p[1]
|
1221
|
+
r = np.exp(t)
|
1222
|
+
dPdr = r * Q
|
1223
|
+
dQdr = -2.0 * r * ((-0.2 - V(r)) * P + 1 / r * Q)
|
1224
|
+
return np.array([dPdr, dQdr])
|
1225
|
+
|
1226
|
+
result = solve_ivp(func,
|
1227
|
+
(-17, 2),
|
1228
|
+
y0=np.array([1, -11]),
|
1229
|
+
max_step=0.03,
|
1230
|
+
vectorized=False,
|
1231
|
+
t_eval=None,
|
1232
|
+
atol=1e-8,
|
1233
|
+
rtol=1e-5)
|
1234
|
+
assert result.success
|
1235
|
+
|
1236
|
+
|
1237
|
+
@pytest.mark.parametrize('method', ['RK23', 'RK45', 'DOP853', 'Radau', 'BDF'])
|
1238
|
+
def test_tbound_respected_oscillator(method):
|
1239
|
+
"Regression test for gh-9198"
|
1240
|
+
def reactions_func(t, y):
|
1241
|
+
if (t > 205):
|
1242
|
+
raise ValueError("Called outside interval")
|
1243
|
+
yprime = np.array([1.73307544e-02,
|
1244
|
+
6.49376470e-06,
|
1245
|
+
0.00000000e+00,
|
1246
|
+
0.00000000e+00])
|
1247
|
+
return yprime
|
1248
|
+
|
1249
|
+
def run_sim2(t_end, n_timepoints=10, shortest_delay_line=10000000):
|
1250
|
+
init_state = np.array([134.08298555, 138.82348612, 100., 0.])
|
1251
|
+
t0 = 100.0
|
1252
|
+
t1 = 200.0
|
1253
|
+
return solve_ivp(reactions_func,
|
1254
|
+
(t0, t1),
|
1255
|
+
init_state.copy(),
|
1256
|
+
dense_output=True,
|
1257
|
+
max_step=t1 - t0)
|
1258
|
+
result = run_sim2(1000, 100, 100)
|
1259
|
+
assert result.success
|
1260
|
+
|
1261
|
+
|
1262
|
+
def test_inital_maxstep():
|
1263
|
+
"""Verify that select_inital_step respects max_step"""
|
1264
|
+
rtol = 1e-3
|
1265
|
+
atol = 1e-6
|
1266
|
+
y0 = np.array([1/3, 2/9])
|
1267
|
+
for (t0, t_bound) in ((5, 9), (5, 1)):
|
1268
|
+
for method_order in [RK23.error_estimator_order,
|
1269
|
+
RK45.error_estimator_order,
|
1270
|
+
DOP853.error_estimator_order,
|
1271
|
+
3, #RADAU
|
1272
|
+
1 #BDF
|
1273
|
+
]:
|
1274
|
+
step_no_max = select_initial_step(fun_rational, t0, y0, t_bound,
|
1275
|
+
np.inf,
|
1276
|
+
fun_rational(t0,y0),
|
1277
|
+
np.sign(t_bound - t0),
|
1278
|
+
method_order,
|
1279
|
+
rtol, atol)
|
1280
|
+
max_step = step_no_max/2
|
1281
|
+
step_with_max = select_initial_step(fun_rational, t0, y0, t_bound,
|
1282
|
+
max_step,
|
1283
|
+
fun_rational(t0, y0),
|
1284
|
+
np.sign(t_bound - t0),
|
1285
|
+
method_order,
|
1286
|
+
rtol, atol)
|
1287
|
+
assert_equal(max_step, step_with_max)
|