scipy 1.16.2__cp311-cp311-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.cp311-win_arm64.lib +0 -0
- scipy/_cyutility.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/_lib/_ccallback_c.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/_lib/_fpumode.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/_lib/_test_ccallback.cp311-win_arm64.pyd +0 -0
- scipy/_lib/_test_deprecation_call.cp311-win_arm64.lib +0 -0
- scipy/_lib/_test_deprecation_call.cp311-win_arm64.pyd +0 -0
- scipy/_lib/_test_deprecation_def.cp311-win_arm64.lib +0 -0
- scipy/_lib/_test_deprecation_def.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/_lib/_uarray/_uarray.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/_lib/messagestream.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/cluster/_hierarchy.cp311-win_arm64.pyd +0 -0
- scipy/cluster/_optimal_leaf_ordering.cp311-win_arm64.lib +0 -0
- scipy/cluster/_optimal_leaf_ordering.cp311-win_arm64.pyd +0 -0
- scipy/cluster/_vq.cp311-win_arm64.lib +0 -0
- scipy/cluster/_vq.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/fft/_pocketfft/pypocketfft.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/fftpack/convolve.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/integrate/_dop.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/integrate/_lsoda.cp311-win_arm64.pyd +0 -0
- scipy/integrate/_ode.py +1395 -0
- scipy/integrate/_odepack.cp311-win_arm64.lib +0 -0
- scipy/integrate/_odepack.cp311-win_arm64.pyd +0 -0
- scipy/integrate/_odepack_py.py +273 -0
- scipy/integrate/_quad_vec.py +674 -0
- scipy/integrate/_quadpack.cp311-win_arm64.lib +0 -0
- scipy/integrate/_quadpack.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/integrate/_test_multivariate.cp311-win_arm64.pyd +0 -0
- scipy/integrate/_test_odeint_banded.cp311-win_arm64.lib +0 -0
- scipy/integrate/_test_odeint_banded.cp311-win_arm64.pyd +0 -0
- scipy/integrate/_vode.cp311-win_arm64.lib +0 -0
- scipy/integrate/_vode.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/interpolate/_dfitpack.cp311-win_arm64.pyd +0 -0
- scipy/interpolate/_dierckx.cp311-win_arm64.lib +0 -0
- scipy/interpolate/_dierckx.cp311-win_arm64.pyd +0 -0
- scipy/interpolate/_fitpack.cp311-win_arm64.lib +0 -0
- scipy/interpolate/_fitpack.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/interpolate/_interpnd.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/interpolate/_ppoly.cp311-win_arm64.pyd +0 -0
- scipy/interpolate/_rbf.py +290 -0
- scipy/interpolate/_rbfinterp.py +550 -0
- scipy/interpolate/_rbfinterp_pythran.cp311-win_arm64.lib +0 -0
- scipy/interpolate/_rbfinterp_pythran.cp311-win_arm64.pyd +0 -0
- scipy/interpolate/_rgi.py +764 -0
- scipy/interpolate/_rgi_cython.cp311-win_arm64.lib +0 -0
- scipy/interpolate/_rgi_cython.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/io/_fast_matrix_market/_fmm_core.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/io/_test_fortran.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/io/matlab/_mio5_utils.cp311-win_arm64.pyd +0 -0
- scipy/io/matlab/_mio_utils.cp311-win_arm64.lib +0 -0
- scipy/io/matlab/_mio_utils.cp311-win_arm64.pyd +0 -0
- scipy/io/matlab/_miobase.py +435 -0
- scipy/io/matlab/_streams.cp311-win_arm64.lib +0 -0
- scipy/io/matlab/_streams.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/linalg/_cythonized_array_utils.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/linalg/_decomp_interpolative.cp311-win_arm64.pyd +0 -0
- scipy/linalg/_decomp_ldl.py +356 -0
- scipy/linalg/_decomp_lu.py +401 -0
- scipy/linalg/_decomp_lu_cython.cp311-win_arm64.lib +0 -0
- scipy/linalg/_decomp_lu_cython.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/linalg/_decomp_update.cp311-win_arm64.pyd +0 -0
- scipy/linalg/_expm_frechet.py +417 -0
- scipy/linalg/_fblas.cp311-win_arm64.lib +0 -0
- scipy/linalg/_fblas.cp311-win_arm64.pyd +0 -0
- scipy/linalg/_flapack.cp311-win_arm64.lib +0 -0
- scipy/linalg/_flapack.cp311-win_arm64.pyd +0 -0
- scipy/linalg/_lapack_subroutines.h +1521 -0
- scipy/linalg/_linalg_pythran.cp311-win_arm64.lib +0 -0
- scipy/linalg/_linalg_pythran.cp311-win_arm64.pyd +0 -0
- scipy/linalg/_matfuncs.py +1050 -0
- scipy/linalg/_matfuncs_expm.cp311-win_arm64.lib +0 -0
- scipy/linalg/_matfuncs_expm.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/linalg/_matfuncs_schur_sqrtm.cp311-win_arm64.pyd +0 -0
- scipy/linalg/_matfuncs_sqrtm.py +107 -0
- scipy/linalg/_matfuncs_sqrtm_triu.cp311-win_arm64.lib +0 -0
- scipy/linalg/_matfuncs_sqrtm_triu.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/linalg/_solve_toeplitz.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/linalg/cython_blas.cp311-win_arm64.pyd +0 -0
- scipy/linalg/cython_blas.pxd +169 -0
- scipy/linalg/cython_blas.pyx +1432 -0
- scipy/linalg/cython_lapack.cp311-win_arm64.lib +0 -0
- scipy/linalg/cython_lapack.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/ndimage/_ctest.cp311-win_arm64.pyd +0 -0
- scipy/ndimage/_cytest.cp311-win_arm64.lib +0 -0
- scipy/ndimage/_cytest.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/ndimage/_nd_image.cp311-win_arm64.pyd +0 -0
- scipy/ndimage/_ndimage_api.py +16 -0
- scipy/ndimage/_ni_docstrings.py +214 -0
- scipy/ndimage/_ni_label.cp311-win_arm64.lib +0 -0
- scipy/ndimage/_ni_label.cp311-win_arm64.pyd +0 -0
- scipy/ndimage/_ni_support.py +139 -0
- scipy/ndimage/_rank_filter_1d.cp311-win_arm64.lib +0 -0
- scipy/ndimage/_rank_filter_1d.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/odr/__odrpack.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/optimize/_bglu_dense.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/optimize/_direct.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/optimize/_group_columns.cp311-win_arm64.pyd +0 -0
- scipy/optimize/_hessian_update_strategy.py +479 -0
- scipy/optimize/_highspy/__init__.py +0 -0
- scipy/optimize/_highspy/_core.cp311-win_arm64.lib +0 -0
- scipy/optimize/_highspy/_core.cp311-win_arm64.pyd +0 -0
- scipy/optimize/_highspy/_highs_options.cp311-win_arm64.lib +0 -0
- scipy/optimize/_highspy/_highs_options.cp311-win_arm64.pyd +0 -0
- scipy/optimize/_highspy/_highs_wrapper.py +338 -0
- scipy/optimize/_isotonic.py +157 -0
- scipy/optimize/_lbfgsb.cp311-win_arm64.lib +0 -0
- scipy/optimize/_lbfgsb.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/optimize/_lsap.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/optimize/_lsq/givens_elimination.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/optimize/_minpack.cp311-win_arm64.pyd +0 -0
- scipy/optimize/_minpack_py.py +1178 -0
- scipy/optimize/_moduleTNC.cp311-win_arm64.lib +0 -0
- scipy/optimize/_moduleTNC.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/optimize/_pava_pybind.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/optimize/_slsqplib.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/optimize/_trlib/_trlib.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/optimize/_zeros.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/optimize/cython_optimize/_zeros.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/signal/_max_len_seq_inner.cp311-win_arm64.pyd +0 -0
- scipy/signal/_peak_finding.py +1310 -0
- scipy/signal/_peak_finding_utils.cp311-win_arm64.lib +0 -0
- scipy/signal/_peak_finding_utils.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/signal/_sigtools.cp311-win_arm64.pyd +0 -0
- scipy/signal/_sosfilt.cp311-win_arm64.lib +0 -0
- scipy/signal/_sosfilt.cp311-win_arm64.pyd +0 -0
- scipy/signal/_spectral_py.py +2471 -0
- scipy/signal/_spline.cp311-win_arm64.lib +0 -0
- scipy/signal/_spline.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/signal/_upfirdn_apply.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/sparse/_csparsetools.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/sparse/_sparsetools.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_flow.cp311-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_laplacian.py +563 -0
- scipy/sparse/csgraph/_matching.cp311-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_matching.cp311-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_min_spanning_tree.cp311-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_min_spanning_tree.cp311-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_reordering.cp311-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_reordering.cp311-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_shortest_path.cp311-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_shortest_path.cp311-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_tools.cp311-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_tools.cp311-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_traversal.cp311-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_traversal.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/sparse/linalg/_dsolve/_superlu.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/sparse/linalg/_eigen/arpack/_arpack.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_cpropack.cp311-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_propack/_dpropack.cp311-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_dpropack.cp311-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_propack/_spropack.cp311-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_spropack.cp311-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_propack/_zpropack.cp311-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_zpropack.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/spatial/_ckdtree.cp311-win_arm64.pyd +0 -0
- scipy/spatial/_distance_pybind.cp311-win_arm64.lib +0 -0
- scipy/spatial/_distance_pybind.cp311-win_arm64.pyd +0 -0
- scipy/spatial/_distance_wrap.cp311-win_arm64.lib +0 -0
- scipy/spatial/_distance_wrap.cp311-win_arm64.pyd +0 -0
- scipy/spatial/_geometric_slerp.py +238 -0
- scipy/spatial/_hausdorff.cp311-win_arm64.lib +0 -0
- scipy/spatial/_hausdorff.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/spatial/_qhull.cp311-win_arm64.pyd +0 -0
- scipy/spatial/_qhull.pyi +213 -0
- scipy/spatial/_spherical_voronoi.py +341 -0
- scipy/spatial/_voronoi.cp311-win_arm64.lib +0 -0
- scipy/spatial/_voronoi.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/spatial/transform/_rigid_transform.cp311-win_arm64.pyd +0 -0
- scipy/spatial/transform/_rotation.cp311-win_arm64.lib +0 -0
- scipy/spatial/transform/_rotation.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/special/_comb.cp311-win_arm64.pyd +0 -0
- scipy/special/_ellip_harm.py +214 -0
- scipy/special/_ellip_harm_2.cp311-win_arm64.lib +0 -0
- scipy/special/_ellip_harm_2.cp311-win_arm64.pyd +0 -0
- scipy/special/_gufuncs.cp311-win_arm64.lib +0 -0
- scipy/special/_gufuncs.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/special/_specfun.cp311-win_arm64.pyd +0 -0
- scipy/special/_special_ufuncs.cp311-win_arm64.lib +0 -0
- scipy/special/_special_ufuncs.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/special/_test_internal.cp311-win_arm64.pyd +0 -0
- scipy/special/_test_internal.pyi +9 -0
- scipy/special/_testutils.py +321 -0
- scipy/special/_ufuncs.cp311-win_arm64.lib +0 -0
- scipy/special/_ufuncs.cp311-win_arm64.pyd +0 -0
- scipy/special/_ufuncs.pyi +522 -0
- scipy/special/_ufuncs.pyx +13173 -0
- scipy/special/_ufuncs_cxx.cp311-win_arm64.lib +0 -0
- scipy/special/_ufuncs_cxx.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/special/cython_special.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/stats/_ansari_swilk_statistics.cp311-win_arm64.pyd +0 -0
- scipy/stats/_axis_nan_policy.py +692 -0
- scipy/stats/_biasedurn.cp311-win_arm64.lib +0 -0
- scipy/stats/_biasedurn.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/stats/_levy_stable/levyst.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/stats/_qmc_cy.cp311-win_arm64.pyd +0 -0
- scipy/stats/_qmc_cy.pyi +54 -0
- scipy/stats/_qmvnt.py +454 -0
- scipy/stats/_qmvnt_cy.cp311-win_arm64.lib +0 -0
- scipy/stats/_qmvnt_cy.cp311-win_arm64.pyd +0 -0
- scipy/stats/_quantile.py +335 -0
- scipy/stats/_rcont/__init__.py +4 -0
- scipy/stats/_rcont/rcont.cp311-win_arm64.lib +0 -0
- scipy/stats/_rcont/rcont.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/stats/_sobol.cp311-win_arm64.pyd +0 -0
- scipy/stats/_sobol.pyi +54 -0
- scipy/stats/_sobol_direction_numbers.npz +0 -0
- scipy/stats/_stats.cp311-win_arm64.lib +0 -0
- scipy/stats/_stats.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/stats/_stats_pythran.cp311-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.cp311-win_arm64.lib +0 -0
- scipy/stats/_unuran/unuran_wrapper.cp311-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,1491 @@
|
|
1
|
+
import sys
|
2
|
+
|
3
|
+
import numpy as np
|
4
|
+
from numpy.testing import suppress_warnings
|
5
|
+
from scipy._lib._array_api import (
|
6
|
+
_asarray, assert_array_almost_equal,
|
7
|
+
is_jax, np_compat,
|
8
|
+
xp_assert_equal, xp_assert_close,
|
9
|
+
)
|
10
|
+
|
11
|
+
import pytest
|
12
|
+
from pytest import raises as assert_raises
|
13
|
+
import scipy.ndimage as ndimage
|
14
|
+
|
15
|
+
from . import types
|
16
|
+
|
17
|
+
skip_xp_backends = pytest.mark.skip_xp_backends
|
18
|
+
xfail_xp_backends = pytest.mark.xfail_xp_backends
|
19
|
+
pytestmark = [skip_xp_backends(cpu_only=True, exceptions=['cupy', 'jax.numpy'])]
|
20
|
+
|
21
|
+
|
22
|
+
eps = 1e-12
|
23
|
+
|
24
|
+
ndimage_to_numpy_mode = {
|
25
|
+
'mirror': 'reflect',
|
26
|
+
'reflect': 'symmetric',
|
27
|
+
'grid-mirror': 'symmetric',
|
28
|
+
'grid-wrap': 'wrap',
|
29
|
+
'nearest': 'edge',
|
30
|
+
'grid-constant': 'constant',
|
31
|
+
}
|
32
|
+
|
33
|
+
|
34
|
+
class TestBoundaries:
|
35
|
+
|
36
|
+
@skip_xp_backends("cupy", reason="CuPy does not have geometric_transform")
|
37
|
+
@pytest.mark.parametrize(
|
38
|
+
'mode, expected_value',
|
39
|
+
[('nearest', [1.5, 2.5, 3.5, 4, 4, 4, 4]),
|
40
|
+
('wrap', [1.5, 2.5, 3.5, 1.5, 2.5, 3.5, 1.5]),
|
41
|
+
('grid-wrap', [1.5, 2.5, 3.5, 2.5, 1.5, 2.5, 3.5]),
|
42
|
+
('mirror', [1.5, 2.5, 3.5, 3.5, 2.5, 1.5, 1.5]),
|
43
|
+
('reflect', [1.5, 2.5, 3.5, 4, 3.5, 2.5, 1.5]),
|
44
|
+
('constant', [1.5, 2.5, 3.5, -1, -1, -1, -1]),
|
45
|
+
('grid-constant', [1.5, 2.5, 3.5, 1.5, -1, -1, -1])]
|
46
|
+
)
|
47
|
+
def test_boundaries(self, mode, expected_value, xp):
|
48
|
+
def shift(x):
|
49
|
+
return (x[0] + 0.5,)
|
50
|
+
|
51
|
+
data = xp.asarray([1, 2, 3, 4.])
|
52
|
+
xp_assert_equal(
|
53
|
+
ndimage.geometric_transform(data, shift, cval=-1, mode=mode,
|
54
|
+
output_shape=(7,), order=1),
|
55
|
+
xp.asarray(expected_value))
|
56
|
+
|
57
|
+
@skip_xp_backends("cupy", reason="CuPy does not have geometric_transform")
|
58
|
+
@pytest.mark.parametrize(
|
59
|
+
'mode, expected_value',
|
60
|
+
[('nearest', [1, 1, 2, 3]),
|
61
|
+
('wrap', [3, 1, 2, 3]),
|
62
|
+
('grid-wrap', [4, 1, 2, 3]),
|
63
|
+
('mirror', [2, 1, 2, 3]),
|
64
|
+
('reflect', [1, 1, 2, 3]),
|
65
|
+
('constant', [-1, 1, 2, 3]),
|
66
|
+
('grid-constant', [-1, 1, 2, 3])]
|
67
|
+
)
|
68
|
+
def test_boundaries2(self, mode, expected_value, xp):
|
69
|
+
def shift(x):
|
70
|
+
return (x[0] - 0.9,)
|
71
|
+
|
72
|
+
data = xp.asarray([1, 2, 3, 4])
|
73
|
+
xp_assert_equal(
|
74
|
+
ndimage.geometric_transform(data, shift, cval=-1, mode=mode,
|
75
|
+
output_shape=(4,)),
|
76
|
+
xp.asarray(expected_value))
|
77
|
+
|
78
|
+
@pytest.mark.parametrize('mode', ['mirror', 'reflect', 'grid-mirror',
|
79
|
+
'grid-wrap', 'grid-constant',
|
80
|
+
'nearest'])
|
81
|
+
@pytest.mark.parametrize('order', range(6))
|
82
|
+
def test_boundary_spline_accuracy(self, mode, order, xp):
|
83
|
+
"""Tests based on examples from gh-2640"""
|
84
|
+
if (is_jax(xp) and
|
85
|
+
(mode not in ['mirror', 'reflect', 'constant', 'wrap', 'nearest']
|
86
|
+
or order > 1)
|
87
|
+
):
|
88
|
+
pytest.xfail("Jax does not support grid- modes or order > 1")
|
89
|
+
|
90
|
+
np_data = np.arange(-6, 7, dtype=np.float64)
|
91
|
+
data = xp.asarray(np_data)
|
92
|
+
x = xp.asarray(np.linspace(-8, 15, num=1000))
|
93
|
+
y = ndimage.map_coordinates(data, x[xp.newaxis, ...], order=order, mode=mode)
|
94
|
+
|
95
|
+
# compute expected value using explicit padding via np.pad
|
96
|
+
npad = 32
|
97
|
+
pad_mode = ndimage_to_numpy_mode.get(mode)
|
98
|
+
padded = xp.asarray(np.pad(np_data, npad, mode=pad_mode))
|
99
|
+
coords = xp.asarray(npad + x)[xp.newaxis, ...]
|
100
|
+
expected = ndimage.map_coordinates(padded, coords, order=order, mode=mode)
|
101
|
+
|
102
|
+
atol = 1e-5 if mode == 'grid-constant' else 1e-12
|
103
|
+
xp_assert_close(y, expected, rtol=1e-7, atol=atol)
|
104
|
+
|
105
|
+
|
106
|
+
@pytest.mark.parametrize('order', range(2, 6))
|
107
|
+
@pytest.mark.parametrize('dtype', types)
|
108
|
+
class TestSpline:
|
109
|
+
|
110
|
+
def test_spline01(self, dtype, order, xp):
|
111
|
+
dtype = getattr(xp, dtype)
|
112
|
+
data = xp.ones([], dtype=dtype)
|
113
|
+
out = ndimage.spline_filter(data, order=order)
|
114
|
+
assert out == xp.asarray(1, dtype=out.dtype)
|
115
|
+
|
116
|
+
def test_spline02(self, dtype, order, xp):
|
117
|
+
dtype = getattr(xp, dtype)
|
118
|
+
data = xp.asarray([1], dtype=dtype)
|
119
|
+
out = ndimage.spline_filter(data, order=order)
|
120
|
+
assert_array_almost_equal(out, xp.asarray([1]))
|
121
|
+
|
122
|
+
@skip_xp_backends(np_only=True, exceptions=["cupy"],
|
123
|
+
reason='output=dtype is numpy-specific')
|
124
|
+
def test_spline03(self, dtype, order, xp):
|
125
|
+
dtype = getattr(xp, dtype)
|
126
|
+
data = xp.ones([], dtype=dtype)
|
127
|
+
out = ndimage.spline_filter(data, order, output=dtype)
|
128
|
+
assert out == xp.asarray(1, dtype=out.dtype)
|
129
|
+
|
130
|
+
def test_spline04(self, dtype, order, xp):
|
131
|
+
dtype = getattr(xp, dtype)
|
132
|
+
data = xp.ones([4], dtype=dtype)
|
133
|
+
out = ndimage.spline_filter(data, order)
|
134
|
+
assert_array_almost_equal(out, xp.asarray([1, 1, 1, 1]))
|
135
|
+
|
136
|
+
def test_spline05(self, dtype, order, xp):
|
137
|
+
dtype = getattr(xp, dtype)
|
138
|
+
data = xp.ones([4, 4], dtype=dtype)
|
139
|
+
out = ndimage.spline_filter(data, order=order)
|
140
|
+
expected = xp.asarray([[1, 1, 1, 1],
|
141
|
+
[1, 1, 1, 1],
|
142
|
+
[1, 1, 1, 1],
|
143
|
+
[1, 1, 1, 1]])
|
144
|
+
assert_array_almost_equal(out, expected)
|
145
|
+
|
146
|
+
|
147
|
+
@skip_xp_backends("cupy", reason="CuPy does not have geometric_transform")
|
148
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
149
|
+
class TestGeometricTransform:
|
150
|
+
|
151
|
+
def test_geometric_transform01(self, order, xp):
|
152
|
+
data = xp.asarray([1])
|
153
|
+
|
154
|
+
def mapping(x):
|
155
|
+
return x
|
156
|
+
|
157
|
+
out = ndimage.geometric_transform(data, mapping, data.shape,
|
158
|
+
order=order)
|
159
|
+
assert_array_almost_equal(out, xp.asarray([1], dtype=out.dtype))
|
160
|
+
|
161
|
+
def test_geometric_transform02(self, order, xp):
|
162
|
+
data = xp.ones([4])
|
163
|
+
|
164
|
+
def mapping(x):
|
165
|
+
return x
|
166
|
+
|
167
|
+
out = ndimage.geometric_transform(data, mapping, data.shape,
|
168
|
+
order=order)
|
169
|
+
assert_array_almost_equal(out, xp.asarray([1, 1, 1, 1], dtype=out.dtype))
|
170
|
+
|
171
|
+
def test_geometric_transform03(self, order, xp):
|
172
|
+
data = xp.ones([4])
|
173
|
+
|
174
|
+
def mapping(x):
|
175
|
+
return (x[0] - 1,)
|
176
|
+
|
177
|
+
out = ndimage.geometric_transform(data, mapping, data.shape,
|
178
|
+
order=order)
|
179
|
+
assert_array_almost_equal(out, xp.asarray([0, 1, 1, 1], dtype=out.dtype))
|
180
|
+
|
181
|
+
def test_geometric_transform04(self, order, xp):
|
182
|
+
data = xp.asarray([4, 1, 3, 2])
|
183
|
+
|
184
|
+
def mapping(x):
|
185
|
+
return (x[0] - 1,)
|
186
|
+
|
187
|
+
out = ndimage.geometric_transform(data, mapping, data.shape,
|
188
|
+
order=order)
|
189
|
+
assert_array_almost_equal(out, xp.asarray([0, 4, 1, 3], dtype=out.dtype))
|
190
|
+
|
191
|
+
@pytest.mark.parametrize('dtype', ["float64", "complex128"])
|
192
|
+
def test_geometric_transform05(self, order, dtype, xp):
|
193
|
+
dtype = getattr(xp, dtype)
|
194
|
+
data = xp.asarray([[1, 1, 1, 1],
|
195
|
+
[1, 1, 1, 1],
|
196
|
+
[1, 1, 1, 1]], dtype=dtype)
|
197
|
+
expected = xp.asarray([[0, 1, 1, 1],
|
198
|
+
[0, 1, 1, 1],
|
199
|
+
[0, 1, 1, 1]], dtype=dtype)
|
200
|
+
|
201
|
+
if xp.isdtype(data.dtype, 'complex floating'):
|
202
|
+
data -= 1j * data
|
203
|
+
expected -= 1j * expected
|
204
|
+
|
205
|
+
def mapping(x):
|
206
|
+
return (x[0], x[1] - 1)
|
207
|
+
|
208
|
+
out = ndimage.geometric_transform(data, mapping, data.shape,
|
209
|
+
order=order)
|
210
|
+
assert_array_almost_equal(out, expected)
|
211
|
+
|
212
|
+
def test_geometric_transform06(self, order, xp):
|
213
|
+
data = xp.asarray([[4, 1, 3, 2],
|
214
|
+
[7, 6, 8, 5],
|
215
|
+
[3, 5, 3, 6]])
|
216
|
+
|
217
|
+
def mapping(x):
|
218
|
+
return (x[0], x[1] - 1)
|
219
|
+
|
220
|
+
out = ndimage.geometric_transform(data, mapping, data.shape,
|
221
|
+
order=order)
|
222
|
+
expected = xp.asarray([[0, 4, 1, 3],
|
223
|
+
[0, 7, 6, 8],
|
224
|
+
[0, 3, 5, 3]], dtype=out.dtype)
|
225
|
+
assert_array_almost_equal(out, expected)
|
226
|
+
|
227
|
+
def test_geometric_transform07(self, order, xp):
|
228
|
+
data = xp.asarray([[4, 1, 3, 2],
|
229
|
+
[7, 6, 8, 5],
|
230
|
+
[3, 5, 3, 6]])
|
231
|
+
|
232
|
+
def mapping(x):
|
233
|
+
return (x[0] - 1, x[1])
|
234
|
+
|
235
|
+
out = ndimage.geometric_transform(data, mapping, data.shape,
|
236
|
+
order=order)
|
237
|
+
expected = xp.asarray([[0, 0, 0, 0],
|
238
|
+
[4, 1, 3, 2],
|
239
|
+
[7, 6, 8, 5]], dtype=out.dtype)
|
240
|
+
assert_array_almost_equal(out, expected)
|
241
|
+
|
242
|
+
def test_geometric_transform08(self, order, xp):
|
243
|
+
data = xp.asarray([[4, 1, 3, 2],
|
244
|
+
[7, 6, 8, 5],
|
245
|
+
[3, 5, 3, 6]])
|
246
|
+
|
247
|
+
def mapping(x):
|
248
|
+
return (x[0] - 1, x[1] - 1)
|
249
|
+
|
250
|
+
out = ndimage.geometric_transform(data, mapping, data.shape,
|
251
|
+
order=order)
|
252
|
+
expected = xp.asarray([[0, 0, 0, 0],
|
253
|
+
[0, 4, 1, 3],
|
254
|
+
[0, 7, 6, 8]], dtype=out.dtype)
|
255
|
+
assert_array_almost_equal(out, expected)
|
256
|
+
|
257
|
+
def test_geometric_transform10(self, order, xp):
|
258
|
+
data = xp.asarray([[4, 1, 3, 2],
|
259
|
+
[7, 6, 8, 5],
|
260
|
+
[3, 5, 3, 6]])
|
261
|
+
|
262
|
+
def mapping(x):
|
263
|
+
return (x[0] - 1, x[1] - 1)
|
264
|
+
|
265
|
+
if (order > 1):
|
266
|
+
filtered = ndimage.spline_filter(data, order=order)
|
267
|
+
else:
|
268
|
+
filtered = data
|
269
|
+
out = ndimage.geometric_transform(filtered, mapping, data.shape,
|
270
|
+
order=order, prefilter=False)
|
271
|
+
expected = xp.asarray([[0, 0, 0, 0],
|
272
|
+
[0, 4, 1, 3],
|
273
|
+
[0, 7, 6, 8]], dtype=out.dtype)
|
274
|
+
assert_array_almost_equal(out, expected)
|
275
|
+
|
276
|
+
def test_geometric_transform13(self, order, xp):
|
277
|
+
data = xp.ones([2], dtype=xp.float64)
|
278
|
+
|
279
|
+
def mapping(x):
|
280
|
+
return (x[0] // 2,)
|
281
|
+
|
282
|
+
out = ndimage.geometric_transform(data, mapping, [4], order=order)
|
283
|
+
assert_array_almost_equal(out, xp.asarray([1, 1, 1, 1], dtype=out.dtype))
|
284
|
+
|
285
|
+
def test_geometric_transform14(self, order, xp):
|
286
|
+
data = xp.asarray([1, 5, 2, 6, 3, 7, 4, 4])
|
287
|
+
|
288
|
+
def mapping(x):
|
289
|
+
return (2 * x[0],)
|
290
|
+
|
291
|
+
out = ndimage.geometric_transform(data, mapping, [4], order=order)
|
292
|
+
assert_array_almost_equal(out, xp.asarray([1, 2, 3, 4], dtype=out.dtype))
|
293
|
+
|
294
|
+
def test_geometric_transform15(self, order, xp):
|
295
|
+
data = xp.asarray([1, 2, 3, 4])
|
296
|
+
|
297
|
+
def mapping(x):
|
298
|
+
return (x[0] / 2,)
|
299
|
+
|
300
|
+
out = ndimage.geometric_transform(data, mapping, [8], order=order)
|
301
|
+
assert_array_almost_equal(out[::2], xp.asarray([1, 2, 3, 4]))
|
302
|
+
|
303
|
+
def test_geometric_transform16(self, order, xp):
|
304
|
+
data = [[1, 2, 3, 4],
|
305
|
+
[5, 6, 7, 8],
|
306
|
+
[9.0, 10, 11, 12]]
|
307
|
+
data = xp.asarray(data)
|
308
|
+
|
309
|
+
def mapping(x):
|
310
|
+
return (x[0], x[1] * 2)
|
311
|
+
|
312
|
+
out = ndimage.geometric_transform(data, mapping, (3, 2),
|
313
|
+
order=order)
|
314
|
+
assert_array_almost_equal(out, xp.asarray([[1, 3], [5, 7], [9, 11]]))
|
315
|
+
|
316
|
+
def test_geometric_transform17(self, order, xp):
|
317
|
+
data = [[1, 2, 3, 4],
|
318
|
+
[5, 6, 7, 8],
|
319
|
+
[9, 10, 11, 12]]
|
320
|
+
data = xp.asarray(data)
|
321
|
+
|
322
|
+
def mapping(x):
|
323
|
+
return (x[0] * 2, x[1])
|
324
|
+
|
325
|
+
out = ndimage.geometric_transform(data, mapping, (1, 4),
|
326
|
+
order=order)
|
327
|
+
assert_array_almost_equal(out, xp.asarray([[1, 2, 3, 4]]))
|
328
|
+
|
329
|
+
def test_geometric_transform18(self, order, xp):
|
330
|
+
data = [[1, 2, 3, 4],
|
331
|
+
[5, 6, 7, 8],
|
332
|
+
[9, 10, 11, 12]]
|
333
|
+
data = xp.asarray(data)
|
334
|
+
|
335
|
+
def mapping(x):
|
336
|
+
return (x[0] * 2, x[1] * 2)
|
337
|
+
|
338
|
+
out = ndimage.geometric_transform(data, mapping, (1, 2),
|
339
|
+
order=order)
|
340
|
+
assert_array_almost_equal(out, xp.asarray([[1, 3]]))
|
341
|
+
|
342
|
+
def test_geometric_transform19(self, order, xp):
|
343
|
+
data = [[1, 2, 3, 4],
|
344
|
+
[5, 6, 7, 8],
|
345
|
+
[9, 10, 11, 12]]
|
346
|
+
data = xp.asarray(data)
|
347
|
+
|
348
|
+
def mapping(x):
|
349
|
+
return (x[0], x[1] / 2)
|
350
|
+
|
351
|
+
out = ndimage.geometric_transform(data, mapping, (3, 8),
|
352
|
+
order=order)
|
353
|
+
assert_array_almost_equal(out[..., ::2], data)
|
354
|
+
|
355
|
+
def test_geometric_transform20(self, order, xp):
|
356
|
+
data = [[1, 2, 3, 4],
|
357
|
+
[5, 6, 7, 8],
|
358
|
+
[9, 10, 11, 12]]
|
359
|
+
data = xp.asarray(data)
|
360
|
+
|
361
|
+
def mapping(x):
|
362
|
+
return (x[0] / 2, x[1])
|
363
|
+
|
364
|
+
out = ndimage.geometric_transform(data, mapping, (6, 4),
|
365
|
+
order=order)
|
366
|
+
assert_array_almost_equal(out[::2, ...], data)
|
367
|
+
|
368
|
+
def test_geometric_transform21(self, order, xp):
|
369
|
+
data = [[1, 2, 3, 4],
|
370
|
+
[5, 6, 7, 8],
|
371
|
+
[9, 10, 11, 12]]
|
372
|
+
data = xp.asarray(data)
|
373
|
+
|
374
|
+
def mapping(x):
|
375
|
+
return (x[0] / 2, x[1] / 2)
|
376
|
+
|
377
|
+
out = ndimage.geometric_transform(data, mapping, (6, 8),
|
378
|
+
order=order)
|
379
|
+
assert_array_almost_equal(out[::2, ::2], data)
|
380
|
+
|
381
|
+
def test_geometric_transform22(self, order, xp):
|
382
|
+
data = [[1, 2, 3, 4],
|
383
|
+
[5, 6, 7, 8],
|
384
|
+
[9, 10, 11, 12]]
|
385
|
+
data = xp.asarray(data, dtype=xp.float64)
|
386
|
+
|
387
|
+
def mapping1(x):
|
388
|
+
return (x[0] / 2, x[1] / 2)
|
389
|
+
|
390
|
+
def mapping2(x):
|
391
|
+
return (x[0] * 2, x[1] * 2)
|
392
|
+
|
393
|
+
out = ndimage.geometric_transform(data, mapping1,
|
394
|
+
(6, 8), order=order)
|
395
|
+
out = ndimage.geometric_transform(out, mapping2,
|
396
|
+
(3, 4), order=order)
|
397
|
+
assert_array_almost_equal(out, data)
|
398
|
+
|
399
|
+
def test_geometric_transform23(self, order, xp):
|
400
|
+
data = [[1, 2, 3, 4],
|
401
|
+
[5, 6, 7, 8],
|
402
|
+
[9, 10, 11, 12]]
|
403
|
+
data = xp.asarray(data)
|
404
|
+
|
405
|
+
def mapping(x):
|
406
|
+
return (1, x[0] * 2)
|
407
|
+
|
408
|
+
out = ndimage.geometric_transform(data, mapping, (2,), order=order)
|
409
|
+
assert_array_almost_equal(out, xp.asarray([5, 7]))
|
410
|
+
|
411
|
+
def test_geometric_transform24(self, order, xp):
|
412
|
+
data = [[1, 2, 3, 4],
|
413
|
+
[5, 6, 7, 8],
|
414
|
+
[9, 10, 11, 12]]
|
415
|
+
data = xp.asarray(data)
|
416
|
+
|
417
|
+
def mapping(x, a, b):
|
418
|
+
return (a, x[0] * b)
|
419
|
+
|
420
|
+
out = ndimage.geometric_transform(
|
421
|
+
data, mapping, (2,), order=order, extra_arguments=(1,),
|
422
|
+
extra_keywords={'b': 2})
|
423
|
+
assert_array_almost_equal(out, xp.asarray([5, 7]))
|
424
|
+
|
425
|
+
|
426
|
+
@skip_xp_backends("cupy", reason="CuPy does not have geometric_transform")
|
427
|
+
class TestGeometricTransformExtra:
|
428
|
+
|
429
|
+
def test_geometric_transform_grid_constant_order1(self, xp):
|
430
|
+
|
431
|
+
# verify interpolation outside the original bounds
|
432
|
+
x = xp.asarray([[1, 2, 3],
|
433
|
+
[4, 5, 6]], dtype=xp.float64)
|
434
|
+
|
435
|
+
def mapping(x):
|
436
|
+
return (x[0] - 0.5), (x[1] - 0.5)
|
437
|
+
|
438
|
+
expected_result = xp.asarray([[0.25, 0.75, 1.25],
|
439
|
+
[1.25, 3.00, 4.00]])
|
440
|
+
assert_array_almost_equal(
|
441
|
+
ndimage.geometric_transform(x, mapping, mode='grid-constant',
|
442
|
+
order=1),
|
443
|
+
expected_result,
|
444
|
+
)
|
445
|
+
|
446
|
+
@pytest.mark.parametrize('mode', ['grid-constant', 'grid-wrap', 'nearest',
|
447
|
+
'mirror', 'reflect'])
|
448
|
+
@pytest.mark.parametrize('order', range(6))
|
449
|
+
def test_geometric_transform_vs_padded(self, order, mode, xp):
|
450
|
+
|
451
|
+
def mapping(x):
|
452
|
+
return (x[0] - 0.4), (x[1] + 2.3)
|
453
|
+
|
454
|
+
# Manually pad and then extract center after the transform to get the
|
455
|
+
# expected result.
|
456
|
+
x = np.arange(144, dtype=float).reshape(12, 12)
|
457
|
+
npad = 24
|
458
|
+
pad_mode = ndimage_to_numpy_mode.get(mode)
|
459
|
+
x_padded = np.pad(x, npad, mode=pad_mode)
|
460
|
+
|
461
|
+
x = xp.asarray(x)
|
462
|
+
x_padded = xp.asarray(x_padded)
|
463
|
+
|
464
|
+
center_slice = tuple([slice(npad, -npad)] * x.ndim)
|
465
|
+
expected_result = ndimage.geometric_transform(
|
466
|
+
x_padded, mapping, mode=mode, order=order)[center_slice]
|
467
|
+
|
468
|
+
xp_assert_close(
|
469
|
+
ndimage.geometric_transform(x, mapping, mode=mode,
|
470
|
+
order=order),
|
471
|
+
expected_result,
|
472
|
+
rtol=1e-7,
|
473
|
+
)
|
474
|
+
|
475
|
+
@skip_xp_backends(np_only=True, reason='endianness is numpy-specific')
|
476
|
+
def test_geometric_transform_endianness_with_output_parameter(self, xp):
|
477
|
+
# geometric transform given output ndarray or dtype with
|
478
|
+
# non-native endianness. see issue #4127
|
479
|
+
data = np.asarray([1])
|
480
|
+
|
481
|
+
def mapping(x):
|
482
|
+
return x
|
483
|
+
|
484
|
+
for out in [data.dtype, data.dtype.newbyteorder(),
|
485
|
+
np.empty_like(data),
|
486
|
+
np.empty_like(data).astype(data.dtype.newbyteorder())]:
|
487
|
+
returned = ndimage.geometric_transform(data, mapping, data.shape,
|
488
|
+
output=out)
|
489
|
+
result = out if returned is None else returned
|
490
|
+
assert_array_almost_equal(result, [1])
|
491
|
+
|
492
|
+
@skip_xp_backends(np_only=True, reason='string `output` is numpy-specific')
|
493
|
+
def test_geometric_transform_with_string_output(self, xp):
|
494
|
+
data = xp.asarray([1])
|
495
|
+
|
496
|
+
def mapping(x):
|
497
|
+
return x
|
498
|
+
|
499
|
+
out = ndimage.geometric_transform(data, mapping, output='f')
|
500
|
+
assert out.dtype is np.dtype('f')
|
501
|
+
assert_array_almost_equal(out, [1])
|
502
|
+
|
503
|
+
|
504
|
+
class TestMapCoordinates:
|
505
|
+
|
506
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
507
|
+
@pytest.mark.parametrize('dtype', [np.float64, np.complex128])
|
508
|
+
def test_map_coordinates01(self, order, dtype, xp):
|
509
|
+
if is_jax(xp) and order > 1:
|
510
|
+
pytest.xfail("jax map_coordinates requires order <= 1")
|
511
|
+
|
512
|
+
data = xp.asarray([[4, 1, 3, 2],
|
513
|
+
[7, 6, 8, 5],
|
514
|
+
[3, 5, 3, 6]])
|
515
|
+
expected = xp.asarray([[0, 0, 0, 0],
|
516
|
+
[0, 4, 1, 3],
|
517
|
+
[0, 7, 6, 8]])
|
518
|
+
if xp.isdtype(data.dtype, 'complex floating'):
|
519
|
+
data = data - 1j * data
|
520
|
+
expected = expected - 1j * expected
|
521
|
+
|
522
|
+
idx = np.indices(data.shape)
|
523
|
+
idx -= 1
|
524
|
+
idx = xp.asarray(idx)
|
525
|
+
|
526
|
+
out = ndimage.map_coordinates(data, idx, order=order)
|
527
|
+
assert_array_almost_equal(out, expected)
|
528
|
+
|
529
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
530
|
+
def test_map_coordinates02(self, order, xp):
|
531
|
+
if is_jax(xp):
|
532
|
+
if order > 1:
|
533
|
+
pytest.xfail("jax map_coordinates requires order <= 1")
|
534
|
+
if order == 1:
|
535
|
+
pytest.xfail("output differs. jax bug?")
|
536
|
+
|
537
|
+
data = xp.asarray([[4, 1, 3, 2],
|
538
|
+
[7, 6, 8, 5],
|
539
|
+
[3, 5, 3, 6]])
|
540
|
+
idx = np.indices(data.shape, np.float64)
|
541
|
+
idx -= 0.5
|
542
|
+
idx = xp.asarray(idx)
|
543
|
+
|
544
|
+
out1 = ndimage.shift(data, 0.5, order=order)
|
545
|
+
out2 = ndimage.map_coordinates(data, idx, order=order)
|
546
|
+
assert_array_almost_equal(out1, out2)
|
547
|
+
|
548
|
+
@skip_xp_backends("jax.numpy", reason="`order` is required in jax")
|
549
|
+
def test_map_coordinates03(self, xp):
|
550
|
+
data = _asarray([[4, 1, 3, 2],
|
551
|
+
[7, 6, 8, 5],
|
552
|
+
[3, 5, 3, 6]], order='F', xp=xp)
|
553
|
+
idx = np.indices(data.shape) - 1
|
554
|
+
idx = xp.asarray(idx)
|
555
|
+
out = ndimage.map_coordinates(data, idx)
|
556
|
+
expected = xp.asarray([[0, 0, 0, 0],
|
557
|
+
[0, 4, 1, 3],
|
558
|
+
[0, 7, 6, 8]])
|
559
|
+
assert_array_almost_equal(out, expected)
|
560
|
+
assert_array_almost_equal(out, ndimage.shift(data, (1, 1)))
|
561
|
+
|
562
|
+
idx = np.indices(data[::2, ...].shape) - 1
|
563
|
+
idx = xp.asarray(idx)
|
564
|
+
out = ndimage.map_coordinates(data[::2, ...], idx)
|
565
|
+
assert_array_almost_equal(out, xp.asarray([[0, 0, 0, 0],
|
566
|
+
[0, 4, 1, 3]]))
|
567
|
+
assert_array_almost_equal(out, ndimage.shift(data[::2, ...], (1, 1)))
|
568
|
+
|
569
|
+
idx = np.indices(data[:, ::2].shape) - 1
|
570
|
+
idx = xp.asarray(idx)
|
571
|
+
out = ndimage.map_coordinates(data[:, ::2], idx)
|
572
|
+
assert_array_almost_equal(out, xp.asarray([[0, 0], [0, 4], [0, 7]]))
|
573
|
+
assert_array_almost_equal(out, ndimage.shift(data[:, ::2], (1, 1)))
|
574
|
+
|
575
|
+
@skip_xp_backends(np_only=True)
|
576
|
+
def test_map_coordinates_endianness_with_output_parameter(self, xp):
|
577
|
+
# output parameter given as array or dtype with either endianness
|
578
|
+
# see issue #4127
|
579
|
+
# NB: NumPy-only
|
580
|
+
|
581
|
+
data = np.asarray([[1, 2], [7, 6]])
|
582
|
+
expected = np.asarray([[0, 0], [0, 1]])
|
583
|
+
idx = np.indices(data.shape)
|
584
|
+
idx -= 1
|
585
|
+
for out in [
|
586
|
+
data.dtype,
|
587
|
+
data.dtype.newbyteorder(),
|
588
|
+
np.empty_like(expected),
|
589
|
+
np.empty_like(expected).astype(expected.dtype.newbyteorder())
|
590
|
+
]:
|
591
|
+
returned = ndimage.map_coordinates(data, idx, output=out)
|
592
|
+
result = out if returned is None else returned
|
593
|
+
assert_array_almost_equal(result, expected)
|
594
|
+
|
595
|
+
@skip_xp_backends(np_only=True, reason='string `output` is numpy-specific')
|
596
|
+
def test_map_coordinates_with_string_output(self, xp):
|
597
|
+
data = xp.asarray([[1]])
|
598
|
+
idx = np.indices(data.shape)
|
599
|
+
idx = xp.asarray(idx)
|
600
|
+
out = ndimage.map_coordinates(data, idx, output='f')
|
601
|
+
assert out.dtype is np.dtype('f')
|
602
|
+
assert_array_almost_equal(out, xp.asarray([[1]]))
|
603
|
+
|
604
|
+
@pytest.mark.skip_xp_backends(cpu_only=True)
|
605
|
+
@pytest.mark.skipif('win32' in sys.platform or np.intp(0).itemsize < 8,
|
606
|
+
reason='do not run on 32 bit or windows '
|
607
|
+
'(no sparse memory)')
|
608
|
+
def test_map_coordinates_large_data(self, xp):
|
609
|
+
# check crash on large data
|
610
|
+
try:
|
611
|
+
n = 30000
|
612
|
+
# a = xp.reshape(xp.empty(n**2, dtype=xp.float32), (n, n))
|
613
|
+
a = np.empty(n**2, dtype=np.float32).reshape(n, n)
|
614
|
+
# fill the part we might read
|
615
|
+
a[n - 3:, n - 3:] = 0
|
616
|
+
ndimage.map_coordinates(
|
617
|
+
xp.asarray(a), xp.asarray([[n - 1.5], [n - 1.5]]), order=1
|
618
|
+
)
|
619
|
+
except MemoryError as e:
|
620
|
+
raise pytest.skip('Not enough memory available') from e
|
621
|
+
|
622
|
+
|
623
|
+
class TestAffineTransform:
|
624
|
+
|
625
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
626
|
+
def test_affine_transform01(self, order, xp):
|
627
|
+
data = xp.asarray([1])
|
628
|
+
out = ndimage.affine_transform(data, xp.asarray([[1]]), order=order)
|
629
|
+
assert_array_almost_equal(out, xp.asarray([1]))
|
630
|
+
|
631
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
632
|
+
def test_affine_transform02(self, order, xp):
|
633
|
+
data = xp.ones([4])
|
634
|
+
out = ndimage.affine_transform(data, xp.asarray([[1]]), order=order)
|
635
|
+
assert_array_almost_equal(out, xp.asarray([1, 1, 1, 1]))
|
636
|
+
|
637
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
638
|
+
def test_affine_transform03(self, order, xp):
|
639
|
+
data = xp.ones([4])
|
640
|
+
out = ndimage.affine_transform(data, xp.asarray([[1]]), -1, order=order)
|
641
|
+
assert_array_almost_equal(out, xp.asarray([0, 1, 1, 1]))
|
642
|
+
|
643
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
644
|
+
def test_affine_transform04(self, order, xp):
|
645
|
+
data = xp.asarray([4, 1, 3, 2])
|
646
|
+
out = ndimage.affine_transform(data, xp.asarray([[1]]), -1, order=order)
|
647
|
+
assert_array_almost_equal(out, xp.asarray([0, 4, 1, 3]))
|
648
|
+
|
649
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
650
|
+
@pytest.mark.parametrize('dtype', ["float64", "complex128"])
|
651
|
+
def test_affine_transform05(self, order, dtype, xp):
|
652
|
+
dtype = getattr(xp, dtype)
|
653
|
+
data = xp.asarray([[1, 1, 1, 1],
|
654
|
+
[1, 1, 1, 1],
|
655
|
+
[1, 1, 1, 1]], dtype=dtype)
|
656
|
+
expected = xp.asarray([[0, 1, 1, 1],
|
657
|
+
[0, 1, 1, 1],
|
658
|
+
[0, 1, 1, 1]], dtype=dtype)
|
659
|
+
if xp.isdtype(data.dtype, 'complex floating'):
|
660
|
+
data -= 1j * data
|
661
|
+
expected -= 1j * expected
|
662
|
+
out = ndimage.affine_transform(data, xp.asarray([[1, 0], [0, 1]]),
|
663
|
+
[0, -1], order=order)
|
664
|
+
assert_array_almost_equal(out, expected)
|
665
|
+
|
666
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
667
|
+
def test_affine_transform06(self, order, xp):
|
668
|
+
data = xp.asarray([[4, 1, 3, 2],
|
669
|
+
[7, 6, 8, 5],
|
670
|
+
[3, 5, 3, 6]])
|
671
|
+
out = ndimage.affine_transform(data, xp.asarray([[1, 0], [0, 1]]),
|
672
|
+
[0, -1], order=order)
|
673
|
+
assert_array_almost_equal(out, xp.asarray([[0, 4, 1, 3],
|
674
|
+
[0, 7, 6, 8],
|
675
|
+
[0, 3, 5, 3]]))
|
676
|
+
|
677
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
678
|
+
def test_affine_transform07(self, order, xp):
|
679
|
+
data = xp.asarray([[4, 1, 3, 2],
|
680
|
+
[7, 6, 8, 5],
|
681
|
+
[3, 5, 3, 6]])
|
682
|
+
out = ndimage.affine_transform(data, xp.asarray([[1, 0], [0, 1]]),
|
683
|
+
[-1, 0], order=order)
|
684
|
+
assert_array_almost_equal(out, xp.asarray([[0, 0, 0, 0],
|
685
|
+
[4, 1, 3, 2],
|
686
|
+
[7, 6, 8, 5]]))
|
687
|
+
|
688
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
689
|
+
def test_affine_transform08(self, order, xp):
|
690
|
+
data = xp.asarray([[4, 1, 3, 2],
|
691
|
+
[7, 6, 8, 5],
|
692
|
+
[3, 5, 3, 6]])
|
693
|
+
out = ndimage.affine_transform(data, xp.asarray([[1, 0], [0, 1]]),
|
694
|
+
[-1, -1], order=order)
|
695
|
+
assert_array_almost_equal(out, xp.asarray([[0, 0, 0, 0],
|
696
|
+
[0, 4, 1, 3],
|
697
|
+
[0, 7, 6, 8]]))
|
698
|
+
|
699
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
700
|
+
def test_affine_transform09(self, order, xp):
|
701
|
+
data = xp.asarray([[4, 1, 3, 2],
|
702
|
+
[7, 6, 8, 5],
|
703
|
+
[3, 5, 3, 6]])
|
704
|
+
if (order > 1):
|
705
|
+
filtered = ndimage.spline_filter(data, order=order)
|
706
|
+
else:
|
707
|
+
filtered = data
|
708
|
+
out = ndimage.affine_transform(filtered, xp.asarray([[1, 0], [0, 1]]),
|
709
|
+
[-1, -1], order=order,
|
710
|
+
prefilter=False)
|
711
|
+
assert_array_almost_equal(out, xp.asarray([[0, 0, 0, 0],
|
712
|
+
[0, 4, 1, 3],
|
713
|
+
[0, 7, 6, 8]]))
|
714
|
+
|
715
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
716
|
+
def test_affine_transform10(self, order, xp):
|
717
|
+
data = xp.ones([2], dtype=xp.float64)
|
718
|
+
out = ndimage.affine_transform(data, xp.asarray([[0.5]]), output_shape=(4,),
|
719
|
+
order=order)
|
720
|
+
assert_array_almost_equal(out, xp.asarray([1, 1, 1, 0]))
|
721
|
+
|
722
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
723
|
+
def test_affine_transform11(self, order, xp):
|
724
|
+
data = xp.asarray([1, 5, 2, 6, 3, 7, 4, 4])
|
725
|
+
out = ndimage.affine_transform(data, xp.asarray([[2]]), 0, (4,), order=order)
|
726
|
+
assert_array_almost_equal(out, xp.asarray([1, 2, 3, 4]))
|
727
|
+
|
728
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
729
|
+
def test_affine_transform12(self, order, xp):
|
730
|
+
data = xp.asarray([1, 2, 3, 4])
|
731
|
+
out = ndimage.affine_transform(data, xp.asarray([[0.5]]), 0, (8,), order=order)
|
732
|
+
assert_array_almost_equal(out[::2], xp.asarray([1, 2, 3, 4]))
|
733
|
+
|
734
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
735
|
+
def test_affine_transform13(self, order, xp):
|
736
|
+
data = [[1, 2, 3, 4],
|
737
|
+
[5, 6, 7, 8],
|
738
|
+
[9.0, 10, 11, 12]]
|
739
|
+
data = xp.asarray(data)
|
740
|
+
out = ndimage.affine_transform(data, xp.asarray([[1, 0], [0, 2]]), 0, (3, 2),
|
741
|
+
order=order)
|
742
|
+
assert_array_almost_equal(out, xp.asarray([[1, 3], [5, 7], [9, 11]]))
|
743
|
+
|
744
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
745
|
+
def test_affine_transform14(self, order, xp):
|
746
|
+
data = [[1, 2, 3, 4],
|
747
|
+
[5, 6, 7, 8],
|
748
|
+
[9, 10, 11, 12]]
|
749
|
+
data = xp.asarray(data)
|
750
|
+
out = ndimage.affine_transform(data, xp.asarray([[2, 0], [0, 1]]), 0, (1, 4),
|
751
|
+
order=order)
|
752
|
+
assert_array_almost_equal(out, xp.asarray([[1, 2, 3, 4]]))
|
753
|
+
|
754
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
755
|
+
def test_affine_transform15(self, order, xp):
|
756
|
+
data = [[1, 2, 3, 4],
|
757
|
+
[5, 6, 7, 8],
|
758
|
+
[9, 10, 11, 12]]
|
759
|
+
data = xp.asarray(data)
|
760
|
+
out = ndimage.affine_transform(data, xp.asarray([[2, 0], [0, 2]]), 0, (1, 2),
|
761
|
+
order=order)
|
762
|
+
assert_array_almost_equal(out, xp.asarray([[1, 3]]))
|
763
|
+
|
764
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
765
|
+
def test_affine_transform16(self, order, xp):
|
766
|
+
data = [[1, 2, 3, 4],
|
767
|
+
[5, 6, 7, 8],
|
768
|
+
[9, 10, 11, 12]]
|
769
|
+
data = xp.asarray(data)
|
770
|
+
out = ndimage.affine_transform(data, xp.asarray([[1, 0.0], [0, 0.5]]), 0,
|
771
|
+
(3, 8), order=order)
|
772
|
+
assert_array_almost_equal(out[..., ::2], data)
|
773
|
+
|
774
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
775
|
+
def test_affine_transform17(self, order, xp):
|
776
|
+
data = [[1, 2, 3, 4],
|
777
|
+
[5, 6, 7, 8],
|
778
|
+
[9, 10, 11, 12]]
|
779
|
+
data = xp.asarray(data)
|
780
|
+
out = ndimage.affine_transform(data, xp.asarray([[0.5, 0], [0, 1]]), 0,
|
781
|
+
(6, 4), order=order)
|
782
|
+
assert_array_almost_equal(out[::2, ...], data)
|
783
|
+
|
784
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
785
|
+
def test_affine_transform18(self, order, xp):
|
786
|
+
data = xp.asarray([[1, 2, 3, 4],
|
787
|
+
[5, 6, 7, 8],
|
788
|
+
[9, 10, 11, 12]])
|
789
|
+
out = ndimage.affine_transform(data, xp.asarray([[0.5, 0], [0, 0.5]]), 0,
|
790
|
+
(6, 8), order=order)
|
791
|
+
assert_array_almost_equal(out[::2, ::2], data)
|
792
|
+
|
793
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
794
|
+
def test_affine_transform19(self, order, xp):
|
795
|
+
data = xp.asarray([[1, 2, 3, 4],
|
796
|
+
[5, 6, 7, 8],
|
797
|
+
[9, 10, 11, 12]], dtype=xp.float64)
|
798
|
+
out = ndimage.affine_transform(data, xp.asarray([[0.5, 0], [0, 0.5]]), 0,
|
799
|
+
(6, 8), order=order)
|
800
|
+
out = ndimage.affine_transform(out, xp.asarray([[2.0, 0], [0, 2.0]]), 0,
|
801
|
+
(3, 4), order=order)
|
802
|
+
assert_array_almost_equal(out, data)
|
803
|
+
|
804
|
+
@xfail_xp_backends("cupy", reason="https://github.com/cupy/cupy/issues/8394")
|
805
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
806
|
+
def test_affine_transform20(self, order, xp):
|
807
|
+
data = [[1, 2, 3, 4],
|
808
|
+
[5, 6, 7, 8],
|
809
|
+
[9, 10, 11, 12]]
|
810
|
+
data = xp.asarray(data)
|
811
|
+
out = ndimage.affine_transform(data, xp.asarray([[0], [2]]), 0, (2,),
|
812
|
+
order=order)
|
813
|
+
assert_array_almost_equal(out, xp.asarray([1, 3]))
|
814
|
+
|
815
|
+
@xfail_xp_backends("cupy", reason="https://github.com/cupy/cupy/issues/8394")
|
816
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
817
|
+
def test_affine_transform21(self, order, xp):
|
818
|
+
data = [[1, 2, 3, 4],
|
819
|
+
[5, 6, 7, 8],
|
820
|
+
[9, 10, 11, 12]]
|
821
|
+
data = xp.asarray(data)
|
822
|
+
out = ndimage.affine_transform(data, xp.asarray([[2], [0]]), 0, (2,),
|
823
|
+
order=order)
|
824
|
+
assert_array_almost_equal(out, xp.asarray([1, 9]))
|
825
|
+
|
826
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
827
|
+
def test_affine_transform22(self, order, xp):
|
828
|
+
# shift and offset interaction; see issue #1547
|
829
|
+
data = xp.asarray([4, 1, 3, 2])
|
830
|
+
out = ndimage.affine_transform(data, xp.asarray([[2]]), [-1], (3,),
|
831
|
+
order=order)
|
832
|
+
assert_array_almost_equal(out, xp.asarray([0, 1, 2]))
|
833
|
+
|
834
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
835
|
+
def test_affine_transform23(self, order, xp):
|
836
|
+
# shift and offset interaction; see issue #1547
|
837
|
+
data = xp.asarray([4, 1, 3, 2])
|
838
|
+
out = ndimage.affine_transform(data, xp.asarray([[0.5]]), [-1], (8,),
|
839
|
+
order=order)
|
840
|
+
assert_array_almost_equal(out[::2], xp.asarray([0, 4, 1, 3]))
|
841
|
+
|
842
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
843
|
+
def test_affine_transform24(self, order, xp):
|
844
|
+
# consistency between diagonal and non-diagonal case; see issue #1547
|
845
|
+
data = xp.asarray([4, 1, 3, 2])
|
846
|
+
with suppress_warnings() as sup:
|
847
|
+
sup.filter(UserWarning,
|
848
|
+
'The behavior of affine_transform with a 1-D array .* '
|
849
|
+
'has changed')
|
850
|
+
out1 = ndimage.affine_transform(data, xp.asarray([2]), -1, order=order)
|
851
|
+
out2 = ndimage.affine_transform(data, xp.asarray([[2]]), -1, order=order)
|
852
|
+
assert_array_almost_equal(out1, out2)
|
853
|
+
|
854
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
855
|
+
def test_affine_transform25(self, order, xp):
|
856
|
+
# consistency between diagonal and non-diagonal case; see issue #1547
|
857
|
+
data = xp.asarray([4, 1, 3, 2])
|
858
|
+
with suppress_warnings() as sup:
|
859
|
+
sup.filter(UserWarning,
|
860
|
+
'The behavior of affine_transform with a 1-D array .* '
|
861
|
+
'has changed')
|
862
|
+
out1 = ndimage.affine_transform(data, xp.asarray([0.5]), -1, order=order)
|
863
|
+
out2 = ndimage.affine_transform(data, xp.asarray([[0.5]]), -1, order=order)
|
864
|
+
assert_array_almost_equal(out1, out2)
|
865
|
+
|
866
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
867
|
+
def test_affine_transform26(self, order, xp):
|
868
|
+
# test homogeneous coordinates
|
869
|
+
data = xp.asarray([[4, 1, 3, 2],
|
870
|
+
[7, 6, 8, 5],
|
871
|
+
[3, 5, 3, 6]])
|
872
|
+
if (order > 1):
|
873
|
+
filtered = ndimage.spline_filter(data, order=order)
|
874
|
+
else:
|
875
|
+
filtered = data
|
876
|
+
tform_original = xp.eye(2)
|
877
|
+
offset_original = -xp.ones((2, 1))
|
878
|
+
|
879
|
+
tform_h1 = xp.concat((tform_original, offset_original), axis=1) # hstack
|
880
|
+
tform_h2 = xp.concat((tform_h1, xp.asarray([[0.0, 0, 1]])), axis=0) # vstack
|
881
|
+
|
882
|
+
offs = [float(x) for x in xp.reshape(offset_original, (-1,))]
|
883
|
+
|
884
|
+
out1 = ndimage.affine_transform(filtered, tform_original,
|
885
|
+
offs,
|
886
|
+
order=order, prefilter=False)
|
887
|
+
out2 = ndimage.affine_transform(filtered, tform_h1, order=order,
|
888
|
+
prefilter=False)
|
889
|
+
out3 = ndimage.affine_transform(filtered, tform_h2, order=order,
|
890
|
+
prefilter=False)
|
891
|
+
for out in [out1, out2, out3]:
|
892
|
+
assert_array_almost_equal(out, xp.asarray([[0, 0, 0, 0],
|
893
|
+
[0, 4, 1, 3],
|
894
|
+
[0, 7, 6, 8]]))
|
895
|
+
|
896
|
+
@xfail_xp_backends("cupy", reason="does not raise")
|
897
|
+
def test_affine_transform27(self, xp):
|
898
|
+
# test valid homogeneous transformation matrix
|
899
|
+
data = xp.asarray([[4, 1, 3, 2],
|
900
|
+
[7, 6, 8, 5],
|
901
|
+
[3, 5, 3, 6]])
|
902
|
+
tform_h1 = xp.concat((xp.eye(2), -xp.ones((2, 1))) , axis=1) # vstack
|
903
|
+
tform_h2 = xp.concat((tform_h1, xp.asarray([[5.0, 2, 1]])), axis=0) # hstack
|
904
|
+
|
905
|
+
assert_raises(ValueError, ndimage.affine_transform, data, tform_h2)
|
906
|
+
|
907
|
+
@skip_xp_backends(np_only=True, reason='byteorder is numpy-specific')
|
908
|
+
def test_affine_transform_1d_endianness_with_output_parameter(self, xp):
|
909
|
+
# 1d affine transform given output ndarray or dtype with
|
910
|
+
# either endianness. see issue #7388
|
911
|
+
data = xp.ones((2, 2))
|
912
|
+
for out in [xp.empty_like(data),
|
913
|
+
xp.empty_like(data).astype(data.dtype.newbyteorder()),
|
914
|
+
data.dtype, data.dtype.newbyteorder()]:
|
915
|
+
with suppress_warnings() as sup:
|
916
|
+
sup.filter(UserWarning,
|
917
|
+
'The behavior of affine_transform with a 1-D array '
|
918
|
+
'.* has changed')
|
919
|
+
matrix = xp.asarray([1, 1])
|
920
|
+
returned = ndimage.affine_transform(data, matrix, output=out)
|
921
|
+
result = out if returned is None else returned
|
922
|
+
assert_array_almost_equal(result, xp.asarray([[1, 1], [1, 1]]))
|
923
|
+
|
924
|
+
@skip_xp_backends(np_only=True, reason='byteorder is numpy-specific')
|
925
|
+
def test_affine_transform_multi_d_endianness_with_output_parameter(self, xp):
|
926
|
+
# affine transform given output ndarray or dtype with either endianness
|
927
|
+
# see issue #4127
|
928
|
+
# NB: byteorder is numpy-specific
|
929
|
+
data = np.asarray([1])
|
930
|
+
for out in [data.dtype, data.dtype.newbyteorder(),
|
931
|
+
np.empty_like(data),
|
932
|
+
np.empty_like(data).astype(data.dtype.newbyteorder())]:
|
933
|
+
returned = ndimage.affine_transform(data, np.asarray([[1]]), output=out)
|
934
|
+
result = out if returned is None else returned
|
935
|
+
assert_array_almost_equal(result, np.asarray([1]))
|
936
|
+
|
937
|
+
@skip_xp_backends(np_only=True,
|
938
|
+
reason='`out` of a different size is numpy-specific'
|
939
|
+
)
|
940
|
+
def test_affine_transform_output_shape(self, xp):
|
941
|
+
# don't require output_shape when out of a different size is given
|
942
|
+
data = xp.arange(8, dtype=xp.float64)
|
943
|
+
out = xp.ones((16,))
|
944
|
+
|
945
|
+
ndimage.affine_transform(data, xp.asarray([[1]]), output=out)
|
946
|
+
assert_array_almost_equal(out[:8], data)
|
947
|
+
|
948
|
+
# mismatched output shape raises an error
|
949
|
+
with pytest.raises(RuntimeError):
|
950
|
+
ndimage.affine_transform(
|
951
|
+
data, [[1]], output=out, output_shape=(12,))
|
952
|
+
|
953
|
+
@skip_xp_backends(np_only=True, reason='string `output` is numpy-specific')
|
954
|
+
def test_affine_transform_with_string_output(self, xp):
|
955
|
+
data = xp.asarray([1])
|
956
|
+
out = ndimage.affine_transform(data, xp.asarray([[1]]), output='f')
|
957
|
+
assert out.dtype is np.dtype('f')
|
958
|
+
assert_array_almost_equal(out, xp.asarray([1]))
|
959
|
+
|
960
|
+
@pytest.mark.parametrize('shift',
|
961
|
+
[(1, 0), (0, 1), (-1, 1), (3, -5), (2, 7)])
|
962
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
963
|
+
def test_affine_transform_shift_via_grid_wrap(self, shift, order, xp):
|
964
|
+
# For mode 'grid-wrap', integer shifts should match np.roll
|
965
|
+
x = np.asarray([[0, 1],
|
966
|
+
[2, 3]])
|
967
|
+
affine = np.zeros((2, 3))
|
968
|
+
affine[:2, :2] = np.eye(2)
|
969
|
+
affine[:, 2] = np.asarray(shift)
|
970
|
+
|
971
|
+
expected = np.roll(x, shift, axis=(0, 1))
|
972
|
+
|
973
|
+
x = xp.asarray(x)
|
974
|
+
affine = xp.asarray(affine)
|
975
|
+
expected = xp.asarray(expected)
|
976
|
+
|
977
|
+
assert_array_almost_equal(
|
978
|
+
ndimage.affine_transform(x, affine, mode='grid-wrap', order=order),
|
979
|
+
expected
|
980
|
+
)
|
981
|
+
|
982
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
983
|
+
def test_affine_transform_shift_reflect(self, order, xp):
|
984
|
+
# shift by x.shape results in reflection
|
985
|
+
x = np.asarray([[0, 1, 2],
|
986
|
+
[3, 4, 5]])
|
987
|
+
expected = x[::-1, ::-1].copy() # strides >0 for torch
|
988
|
+
x = xp.asarray(x)
|
989
|
+
expected = xp.asarray(expected)
|
990
|
+
|
991
|
+
affine = np.zeros([2, 3])
|
992
|
+
affine[:2, :2] = np.eye(2)
|
993
|
+
affine[:, 2] = np.asarray(x.shape)
|
994
|
+
affine = xp.asarray(affine)
|
995
|
+
|
996
|
+
assert_array_almost_equal(
|
997
|
+
ndimage.affine_transform(x, affine, mode='reflect', order=order),
|
998
|
+
expected,
|
999
|
+
)
|
1000
|
+
|
1001
|
+
|
1002
|
+
class TestShift:
|
1003
|
+
|
1004
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1005
|
+
def test_shift01(self, order, xp):
|
1006
|
+
data = xp.asarray([1])
|
1007
|
+
out = ndimage.shift(data, [1], order=order)
|
1008
|
+
assert_array_almost_equal(out, xp.asarray([0]))
|
1009
|
+
|
1010
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1011
|
+
def test_shift02(self, order, xp):
|
1012
|
+
data = xp.ones([4])
|
1013
|
+
out = ndimage.shift(data, [1], order=order)
|
1014
|
+
assert_array_almost_equal(out, xp.asarray([0, 1, 1, 1]))
|
1015
|
+
|
1016
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1017
|
+
def test_shift03(self, order, xp):
|
1018
|
+
data = xp.ones([4])
|
1019
|
+
out = ndimage.shift(data, -1, order=order)
|
1020
|
+
assert_array_almost_equal(out, xp.asarray([1, 1, 1, 0]))
|
1021
|
+
|
1022
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1023
|
+
def test_shift04(self, order, xp):
|
1024
|
+
data = xp.asarray([4, 1, 3, 2])
|
1025
|
+
out = ndimage.shift(data, 1, order=order)
|
1026
|
+
assert_array_almost_equal(out, xp.asarray([0, 4, 1, 3]))
|
1027
|
+
|
1028
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1029
|
+
@pytest.mark.parametrize('dtype', ["float64", "complex128"])
|
1030
|
+
def test_shift05(self, order, dtype, xp):
|
1031
|
+
dtype = getattr(xp, dtype)
|
1032
|
+
data = xp.asarray([[1, 1, 1, 1],
|
1033
|
+
[1, 1, 1, 1],
|
1034
|
+
[1, 1, 1, 1]], dtype=dtype)
|
1035
|
+
expected = xp.asarray([[0, 1, 1, 1],
|
1036
|
+
[0, 1, 1, 1],
|
1037
|
+
[0, 1, 1, 1]], dtype=dtype)
|
1038
|
+
if xp.isdtype(data.dtype, 'complex floating'):
|
1039
|
+
data -= 1j * data
|
1040
|
+
expected -= 1j * expected
|
1041
|
+
out = ndimage.shift(data, [0, 1], order=order)
|
1042
|
+
assert_array_almost_equal(out, expected)
|
1043
|
+
|
1044
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1045
|
+
@pytest.mark.parametrize('mode', ['constant', 'grid-constant'])
|
1046
|
+
@pytest.mark.parametrize('dtype', ['float64', 'complex128'])
|
1047
|
+
def test_shift_with_nonzero_cval(self, order, mode, dtype, xp):
|
1048
|
+
data = np.asarray([[1, 1, 1, 1],
|
1049
|
+
[1, 1, 1, 1],
|
1050
|
+
[1, 1, 1, 1]], dtype=dtype)
|
1051
|
+
|
1052
|
+
expected = np.asarray([[0, 1, 1, 1],
|
1053
|
+
[0, 1, 1, 1],
|
1054
|
+
[0, 1, 1, 1]], dtype=dtype)
|
1055
|
+
|
1056
|
+
if np_compat.isdtype(data.dtype, 'complex floating'):
|
1057
|
+
data -= 1j * data
|
1058
|
+
expected -= 1j * expected
|
1059
|
+
cval = 5.0
|
1060
|
+
expected[:, 0] = cval # specific to shift of [0, 1] used below
|
1061
|
+
|
1062
|
+
data = xp.asarray(data)
|
1063
|
+
expected = xp.asarray(expected)
|
1064
|
+
out = ndimage.shift(data, [0, 1], order=order, mode=mode, cval=cval)
|
1065
|
+
assert_array_almost_equal(out, expected)
|
1066
|
+
|
1067
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1068
|
+
def test_shift06(self, order, xp):
|
1069
|
+
data = xp.asarray([[4, 1, 3, 2],
|
1070
|
+
[7, 6, 8, 5],
|
1071
|
+
[3, 5, 3, 6]])
|
1072
|
+
out = ndimage.shift(data, [0, 1], order=order)
|
1073
|
+
assert_array_almost_equal(out, xp.asarray([[0, 4, 1, 3],
|
1074
|
+
[0, 7, 6, 8],
|
1075
|
+
[0, 3, 5, 3]]))
|
1076
|
+
|
1077
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1078
|
+
def test_shift07(self, order, xp):
|
1079
|
+
data = xp.asarray([[4, 1, 3, 2],
|
1080
|
+
[7, 6, 8, 5],
|
1081
|
+
[3, 5, 3, 6]])
|
1082
|
+
out = ndimage.shift(data, [1, 0], order=order)
|
1083
|
+
assert_array_almost_equal(out, xp.asarray([[0, 0, 0, 0],
|
1084
|
+
[4, 1, 3, 2],
|
1085
|
+
[7, 6, 8, 5]]))
|
1086
|
+
|
1087
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1088
|
+
def test_shift08(self, order, xp):
|
1089
|
+
data = xp.asarray([[4, 1, 3, 2],
|
1090
|
+
[7, 6, 8, 5],
|
1091
|
+
[3, 5, 3, 6]])
|
1092
|
+
out = ndimage.shift(data, [1, 1], order=order)
|
1093
|
+
assert_array_almost_equal(out, xp.asarray([[0, 0, 0, 0],
|
1094
|
+
[0, 4, 1, 3],
|
1095
|
+
[0, 7, 6, 8]]))
|
1096
|
+
|
1097
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1098
|
+
def test_shift09(self, order, xp):
|
1099
|
+
data = xp.asarray([[4, 1, 3, 2],
|
1100
|
+
[7, 6, 8, 5],
|
1101
|
+
[3, 5, 3, 6]])
|
1102
|
+
if (order > 1):
|
1103
|
+
filtered = ndimage.spline_filter(data, order=order)
|
1104
|
+
else:
|
1105
|
+
filtered = data
|
1106
|
+
out = ndimage.shift(filtered, [1, 1], order=order, prefilter=False)
|
1107
|
+
assert_array_almost_equal(out, xp.asarray([[0, 0, 0, 0],
|
1108
|
+
[0, 4, 1, 3],
|
1109
|
+
[0, 7, 6, 8]]))
|
1110
|
+
|
1111
|
+
@pytest.mark.parametrize('shift',
|
1112
|
+
[(1, 0), (0, 1), (-1, 1), (3, -5), (2, 7)])
|
1113
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1114
|
+
def test_shift_grid_wrap(self, shift, order, xp):
|
1115
|
+
# For mode 'grid-wrap', integer shifts should match np.roll
|
1116
|
+
x = np.asarray([[0, 1],
|
1117
|
+
[2, 3]])
|
1118
|
+
expected = np.roll(x, shift, axis=(0,1))
|
1119
|
+
|
1120
|
+
x = xp.asarray(x)
|
1121
|
+
expected = xp.asarray(expected)
|
1122
|
+
|
1123
|
+
assert_array_almost_equal(
|
1124
|
+
ndimage.shift(x, shift, mode='grid-wrap', order=order),
|
1125
|
+
expected
|
1126
|
+
)
|
1127
|
+
|
1128
|
+
@pytest.mark.parametrize('shift',
|
1129
|
+
[(1, 0), (0, 1), (-1, 1), (3, -5), (2, 7)])
|
1130
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1131
|
+
def test_shift_grid_constant1(self, shift, order, xp):
|
1132
|
+
# For integer shifts, 'constant' and 'grid-constant' should be equal
|
1133
|
+
x = xp.reshape(xp.arange(20), (5, 4))
|
1134
|
+
assert_array_almost_equal(
|
1135
|
+
ndimage.shift(x, shift, mode='grid-constant', order=order),
|
1136
|
+
ndimage.shift(x, shift, mode='constant', order=order),
|
1137
|
+
)
|
1138
|
+
|
1139
|
+
def test_shift_grid_constant_order1(self, xp):
|
1140
|
+
x = xp.asarray([[1, 2, 3],
|
1141
|
+
[4, 5, 6]], dtype=xp.float64)
|
1142
|
+
expected_result = xp.asarray([[0.25, 0.75, 1.25],
|
1143
|
+
[1.25, 3.00, 4.00]])
|
1144
|
+
assert_array_almost_equal(
|
1145
|
+
ndimage.shift(x, (0.5, 0.5), mode='grid-constant', order=1),
|
1146
|
+
expected_result,
|
1147
|
+
)
|
1148
|
+
|
1149
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1150
|
+
def test_shift_reflect(self, order, xp):
|
1151
|
+
# shift by x.shape results in reflection
|
1152
|
+
x = np.asarray([[0, 1, 2],
|
1153
|
+
[3, 4, 5]])
|
1154
|
+
expected = x[::-1, ::-1].copy() # strides > 0 for torch
|
1155
|
+
|
1156
|
+
x = xp.asarray(x)
|
1157
|
+
expected = xp.asarray(expected)
|
1158
|
+
assert_array_almost_equal(
|
1159
|
+
ndimage.shift(x, x.shape, mode='reflect', order=order),
|
1160
|
+
expected,
|
1161
|
+
)
|
1162
|
+
|
1163
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1164
|
+
@pytest.mark.parametrize('prefilter', [False, True])
|
1165
|
+
def test_shift_nearest_boundary(self, order, prefilter, xp):
|
1166
|
+
# verify that shifting at least order // 2 beyond the end of the array
|
1167
|
+
# gives a value equal to the edge value.
|
1168
|
+
x = xp.arange(16)
|
1169
|
+
kwargs = dict(mode='nearest', order=order, prefilter=prefilter)
|
1170
|
+
assert_array_almost_equal(
|
1171
|
+
ndimage.shift(x, order // 2 + 1, **kwargs)[0], x[0],
|
1172
|
+
)
|
1173
|
+
assert_array_almost_equal(
|
1174
|
+
ndimage.shift(x, -order // 2 - 1, **kwargs)[-1], x[-1],
|
1175
|
+
)
|
1176
|
+
|
1177
|
+
@pytest.mark.parametrize('mode', ['grid-constant', 'grid-wrap', 'nearest',
|
1178
|
+
'mirror', 'reflect'])
|
1179
|
+
@pytest.mark.parametrize('order', range(6))
|
1180
|
+
def test_shift_vs_padded(self, order, mode, xp):
|
1181
|
+
x_np = np.arange(144, dtype=float).reshape(12, 12)
|
1182
|
+
shift = (0.4, -2.3)
|
1183
|
+
|
1184
|
+
# manually pad and then extract center to get expected result
|
1185
|
+
npad = 32
|
1186
|
+
pad_mode = ndimage_to_numpy_mode.get(mode)
|
1187
|
+
x_padded = xp.asarray(np.pad(x_np, npad, mode=pad_mode))
|
1188
|
+
x = xp.asarray(x_np)
|
1189
|
+
|
1190
|
+
center_slice = tuple([slice(npad, -npad)] * x.ndim)
|
1191
|
+
expected_result = ndimage.shift(
|
1192
|
+
x_padded, shift, mode=mode, order=order)[center_slice]
|
1193
|
+
|
1194
|
+
xp_assert_close(
|
1195
|
+
ndimage.shift(x, shift, mode=mode, order=order),
|
1196
|
+
expected_result,
|
1197
|
+
rtol=1e-7,
|
1198
|
+
)
|
1199
|
+
|
1200
|
+
|
1201
|
+
class TestZoom:
|
1202
|
+
|
1203
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1204
|
+
def test_zoom1(self, order, xp):
|
1205
|
+
for z in [2, [2, 2]]:
|
1206
|
+
arr = xp.reshape(xp.arange(25, dtype=xp.float64), (5, 5))
|
1207
|
+
arr = ndimage.zoom(arr, z, order=order)
|
1208
|
+
assert arr.shape == (10, 10)
|
1209
|
+
assert xp.all(arr[-1, :] != 0)
|
1210
|
+
assert xp.all(arr[-1, :] >= (20 - eps))
|
1211
|
+
assert xp.all(arr[0, :] <= (5 + eps))
|
1212
|
+
assert xp.all(arr >= (0 - eps))
|
1213
|
+
assert xp.all(arr <= (24 + eps))
|
1214
|
+
|
1215
|
+
def test_zoom2(self, xp):
|
1216
|
+
arr = xp.reshape(xp.arange(12), (3, 4))
|
1217
|
+
out = ndimage.zoom(ndimage.zoom(arr, 2), 0.5)
|
1218
|
+
xp_assert_equal(out, arr)
|
1219
|
+
|
1220
|
+
def test_zoom3(self, xp):
|
1221
|
+
arr = xp.asarray([[1, 2]])
|
1222
|
+
out1 = ndimage.zoom(arr, (2, 1))
|
1223
|
+
out2 = ndimage.zoom(arr, (1, 2))
|
1224
|
+
|
1225
|
+
assert_array_almost_equal(out1, xp.asarray([[1, 2], [1, 2]]))
|
1226
|
+
assert_array_almost_equal(out2, xp.asarray([[1, 1, 2, 2]]))
|
1227
|
+
|
1228
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1229
|
+
@pytest.mark.parametrize('dtype', ["float64", "complex128"])
|
1230
|
+
def test_zoom_affine01(self, order, dtype, xp):
|
1231
|
+
dtype = getattr(xp, dtype)
|
1232
|
+
data = xp.asarray([[1, 2, 3, 4],
|
1233
|
+
[5, 6, 7, 8],
|
1234
|
+
[9, 10, 11, 12]], dtype=dtype)
|
1235
|
+
if xp.isdtype(data.dtype, 'complex floating'):
|
1236
|
+
data -= 1j * data
|
1237
|
+
with suppress_warnings() as sup:
|
1238
|
+
sup.filter(UserWarning,
|
1239
|
+
'The behavior of affine_transform with a 1-D array .* '
|
1240
|
+
'has changed')
|
1241
|
+
out = ndimage.affine_transform(data, xp.asarray([0.5, 0.5]), 0,
|
1242
|
+
(6, 8), order=order)
|
1243
|
+
assert_array_almost_equal(out[::2, ::2], data)
|
1244
|
+
|
1245
|
+
def test_zoom_infinity(self, xp):
|
1246
|
+
# Ticket #1419 regression test
|
1247
|
+
dim = 8
|
1248
|
+
ndimage.zoom(xp.zeros((dim, dim)), 1. / dim, mode='nearest')
|
1249
|
+
|
1250
|
+
def test_zoom_zoomfactor_one(self, xp):
|
1251
|
+
# Ticket #1122 regression test
|
1252
|
+
arr = xp.zeros((1, 5, 5))
|
1253
|
+
zoom = (1.0, 2.0, 2.0)
|
1254
|
+
|
1255
|
+
out = ndimage.zoom(arr, zoom, cval=7)
|
1256
|
+
ref = xp.zeros((1, 10, 10))
|
1257
|
+
assert_array_almost_equal(out, ref)
|
1258
|
+
|
1259
|
+
def test_zoom_output_shape_roundoff(self, xp):
|
1260
|
+
arr = xp.zeros((3, 11, 25))
|
1261
|
+
zoom = (4.0 / 3, 15.0 / 11, 29.0 / 25)
|
1262
|
+
out = ndimage.zoom(arr, zoom)
|
1263
|
+
assert out.shape == (4, 15, 29)
|
1264
|
+
|
1265
|
+
@pytest.mark.parametrize('zoom', [(1, 1), (3, 5), (8, 2), (8, 8)])
|
1266
|
+
@pytest.mark.parametrize('mode', ['nearest', 'constant', 'wrap', 'reflect',
|
1267
|
+
'mirror', 'grid-wrap', 'grid-mirror',
|
1268
|
+
'grid-constant'])
|
1269
|
+
def test_zoom_by_int_order0(self, zoom, mode, xp):
|
1270
|
+
# order 0 zoom should be the same as replication via np.kron
|
1271
|
+
# Note: This is not True for general x shapes when grid_mode is False,
|
1272
|
+
# but works here for all modes because the size ratio happens to
|
1273
|
+
# always be an integer when x.shape = (2, 2).
|
1274
|
+
x_np = np.asarray([[0, 1],
|
1275
|
+
[2, 3]], dtype=np.float64)
|
1276
|
+
expected = np.kron(x_np, np.ones(zoom))
|
1277
|
+
|
1278
|
+
x = xp.asarray(x_np)
|
1279
|
+
expected = xp.asarray(expected)
|
1280
|
+
|
1281
|
+
assert_array_almost_equal(
|
1282
|
+
ndimage.zoom(x, zoom, order=0, mode=mode),
|
1283
|
+
expected
|
1284
|
+
)
|
1285
|
+
|
1286
|
+
@pytest.mark.parametrize('shape', [(2, 3), (4, 4)])
|
1287
|
+
@pytest.mark.parametrize('zoom', [(1, 1), (3, 5), (8, 2), (8, 8)])
|
1288
|
+
@pytest.mark.parametrize('mode', ['nearest', 'reflect', 'mirror',
|
1289
|
+
'grid-wrap', 'grid-constant'])
|
1290
|
+
def test_zoom_grid_by_int_order0(self, shape, zoom, mode, xp):
|
1291
|
+
# When grid_mode is True, order 0 zoom should be the same as
|
1292
|
+
# replication via np.kron. The only exceptions to this are the
|
1293
|
+
# non-grid modes 'constant' and 'wrap'.
|
1294
|
+
x_np = np.arange(np.prod(shape), dtype=float).reshape(shape)
|
1295
|
+
|
1296
|
+
x = xp.asarray(x_np)
|
1297
|
+
assert_array_almost_equal(
|
1298
|
+
ndimage.zoom(x, zoom, order=0, mode=mode, grid_mode=True),
|
1299
|
+
xp.asarray(np.kron(x_np, np.ones(zoom)))
|
1300
|
+
)
|
1301
|
+
|
1302
|
+
@pytest.mark.parametrize('mode', ['constant', 'wrap'])
|
1303
|
+
@pytest.mark.thread_unsafe
|
1304
|
+
def test_zoom_grid_mode_warnings(self, mode, xp):
|
1305
|
+
# Warn on use of non-grid modes when grid_mode is True
|
1306
|
+
x = xp.reshape(xp.arange(9, dtype=xp.float64), (3, 3))
|
1307
|
+
with pytest.warns(UserWarning,
|
1308
|
+
match="It is recommended to use mode"):
|
1309
|
+
ndimage.zoom(x, 2, mode=mode, grid_mode=True),
|
1310
|
+
|
1311
|
+
@skip_xp_backends("dask.array", reason="output=array requires buffer view")
|
1312
|
+
@skip_xp_backends("jax.numpy", reason="output=array requires buffer view")
|
1313
|
+
def test_zoom_output_shape(self, xp):
|
1314
|
+
"""Ticket #643"""
|
1315
|
+
x = xp.reshape(xp.arange(12), (3, 4))
|
1316
|
+
ndimage.zoom(x, 2, output=xp.zeros((6, 8)))
|
1317
|
+
|
1318
|
+
def test_zoom_0d_array(self, xp):
|
1319
|
+
# Ticket #21670 regression test
|
1320
|
+
a = xp.arange(10.)
|
1321
|
+
factor = 2
|
1322
|
+
actual = ndimage.zoom(a, np.array(factor))
|
1323
|
+
expected = ndimage.zoom(a, factor)
|
1324
|
+
xp_assert_close(actual, expected)
|
1325
|
+
|
1326
|
+
@xfail_xp_backends("cupy", reason="CuPy `zoom` needs similar fix.")
|
1327
|
+
def test_zoom_1_gh20999(self, xp):
|
1328
|
+
# gh-20999 reported that zoom with `zoom=1` (or sequence of ones)
|
1329
|
+
# introduced noise. Check that this is resolved.
|
1330
|
+
x = xp.eye(3)
|
1331
|
+
xp_assert_equal(ndimage.zoom(x, 1), x)
|
1332
|
+
xp_assert_equal(ndimage.zoom(x, (1, 1)), x)
|
1333
|
+
|
1334
|
+
@xfail_xp_backends("cupy", reason="CuPy `zoom` needs similar fix.")
|
1335
|
+
@skip_xp_backends("jax.numpy", reason="read-only backend")
|
1336
|
+
@xfail_xp_backends("dask.array", reason="numpy round-trip")
|
1337
|
+
def test_zoom_1_gh20999_output(self, xp):
|
1338
|
+
x = xp.eye(3)
|
1339
|
+
output = xp.zeros_like(x)
|
1340
|
+
ndimage.zoom(x, 1, output=output)
|
1341
|
+
xp_assert_equal(output, x)
|
1342
|
+
|
1343
|
+
|
1344
|
+
class TestRotate:
|
1345
|
+
|
1346
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1347
|
+
def test_rotate01(self, order, xp):
|
1348
|
+
data = xp.asarray([[0, 0, 0, 0],
|
1349
|
+
[0, 1, 1, 0],
|
1350
|
+
[0, 0, 0, 0]], dtype=xp.float64)
|
1351
|
+
out = ndimage.rotate(data, 0, order=order)
|
1352
|
+
assert_array_almost_equal(out, data)
|
1353
|
+
|
1354
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1355
|
+
def test_rotate02(self, order, xp):
|
1356
|
+
data = xp.asarray([[0, 0, 0, 0],
|
1357
|
+
[0, 1, 0, 0],
|
1358
|
+
[0, 0, 0, 0]], dtype=xp.float64)
|
1359
|
+
expected = xp.asarray([[0, 0, 0],
|
1360
|
+
[0, 0, 0],
|
1361
|
+
[0, 1, 0],
|
1362
|
+
[0, 0, 0]], dtype=xp.float64)
|
1363
|
+
out = ndimage.rotate(data, 90, order=order)
|
1364
|
+
assert_array_almost_equal(out, expected)
|
1365
|
+
|
1366
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1367
|
+
@pytest.mark.parametrize('dtype', ["float64", "complex128"])
|
1368
|
+
def test_rotate03(self, order, dtype, xp):
|
1369
|
+
dtype = getattr(xp, dtype)
|
1370
|
+
data = xp.asarray([[0, 0, 0, 0, 0],
|
1371
|
+
[0, 1, 1, 0, 0],
|
1372
|
+
[0, 0, 0, 0, 0]], dtype=dtype)
|
1373
|
+
expected = xp.asarray([[0, 0, 0],
|
1374
|
+
[0, 0, 0],
|
1375
|
+
[0, 1, 0],
|
1376
|
+
[0, 1, 0],
|
1377
|
+
[0, 0, 0]], dtype=dtype)
|
1378
|
+
if xp.isdtype(data.dtype, 'complex floating'):
|
1379
|
+
data -= 1j * data
|
1380
|
+
expected -= 1j * expected
|
1381
|
+
out = ndimage.rotate(data, 90, order=order)
|
1382
|
+
assert_array_almost_equal(out, expected)
|
1383
|
+
|
1384
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1385
|
+
def test_rotate04(self, order, xp):
|
1386
|
+
data = xp.asarray([[0, 0, 0, 0, 0],
|
1387
|
+
[0, 1, 1, 0, 0],
|
1388
|
+
[0, 0, 0, 0, 0]], dtype=xp.float64)
|
1389
|
+
expected = xp.asarray([[0, 0, 0, 0, 0],
|
1390
|
+
[0, 0, 1, 0, 0],
|
1391
|
+
[0, 0, 1, 0, 0]], dtype=xp.float64)
|
1392
|
+
out = ndimage.rotate(data, 90, reshape=False, order=order)
|
1393
|
+
assert_array_almost_equal(out, expected)
|
1394
|
+
|
1395
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1396
|
+
def test_rotate05(self, order, xp):
|
1397
|
+
data = np.empty((4, 3, 3))
|
1398
|
+
for i in range(3):
|
1399
|
+
data[:, :, i] = np.asarray([[0, 0, 0],
|
1400
|
+
[0, 1, 0],
|
1401
|
+
[0, 1, 0],
|
1402
|
+
[0, 0, 0]], dtype=np.float64)
|
1403
|
+
data = xp.asarray(data)
|
1404
|
+
expected = xp.asarray([[0, 0, 0, 0],
|
1405
|
+
[0, 1, 1, 0],
|
1406
|
+
[0, 0, 0, 0]], dtype=xp.float64)
|
1407
|
+
out = ndimage.rotate(data, 90, order=order)
|
1408
|
+
for i in range(3):
|
1409
|
+
assert_array_almost_equal(out[:, :, i], expected)
|
1410
|
+
|
1411
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1412
|
+
def test_rotate06(self, order, xp):
|
1413
|
+
data = np.empty((3, 4, 3))
|
1414
|
+
for i in range(3):
|
1415
|
+
data[:, :, i] = np.asarray([[0, 0, 0, 0],
|
1416
|
+
[0, 1, 1, 0],
|
1417
|
+
[0, 0, 0, 0]], dtype=np.float64)
|
1418
|
+
data = xp.asarray(data)
|
1419
|
+
expected = xp.asarray([[0, 0, 0],
|
1420
|
+
[0, 1, 0],
|
1421
|
+
[0, 1, 0],
|
1422
|
+
[0, 0, 0]], dtype=xp.float64)
|
1423
|
+
out = ndimage.rotate(data, 90, order=order)
|
1424
|
+
for i in range(3):
|
1425
|
+
assert_array_almost_equal(out[:, :, i], expected)
|
1426
|
+
|
1427
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1428
|
+
def test_rotate07(self, order, xp):
|
1429
|
+
data = xp.asarray([[[0, 0, 0, 0, 0],
|
1430
|
+
[0, 1, 1, 0, 0],
|
1431
|
+
[0, 0, 0, 0, 0]]] * 2, dtype=xp.float64)
|
1432
|
+
data = xp.permute_dims(data, (2, 1, 0))
|
1433
|
+
expected = xp.asarray([[[0, 0, 0],
|
1434
|
+
[0, 1, 0],
|
1435
|
+
[0, 1, 0],
|
1436
|
+
[0, 0, 0],
|
1437
|
+
[0, 0, 0]]] * 2, dtype=xp.float64)
|
1438
|
+
expected = xp.permute_dims(expected, (2, 1, 0))
|
1439
|
+
out = ndimage.rotate(data, 90, axes=(0, 1), order=order)
|
1440
|
+
assert_array_almost_equal(out, expected)
|
1441
|
+
|
1442
|
+
@pytest.mark.parametrize('order', range(0, 6))
|
1443
|
+
def test_rotate08(self, order, xp):
|
1444
|
+
data = xp.asarray([[[0, 0, 0, 0, 0],
|
1445
|
+
[0, 1, 1, 0, 0],
|
1446
|
+
[0, 0, 0, 0, 0]]] * 2, dtype=xp.float64)
|
1447
|
+
data = xp.permute_dims(data, (2, 1, 0)) # == np.transpose
|
1448
|
+
expected = xp.asarray([[[0, 0, 1, 0, 0],
|
1449
|
+
[0, 0, 1, 0, 0],
|
1450
|
+
[0, 0, 0, 0, 0]]] * 2, dtype=xp.float64)
|
1451
|
+
expected = xp.permute_dims(expected, (2, 1, 0))
|
1452
|
+
out = ndimage.rotate(data, 90, axes=(0, 1), reshape=False, order=order)
|
1453
|
+
assert_array_almost_equal(out, expected)
|
1454
|
+
|
1455
|
+
def test_rotate09(self, xp):
|
1456
|
+
data = xp.asarray([[0, 0, 0, 0, 0],
|
1457
|
+
[0, 1, 1, 0, 0],
|
1458
|
+
[0, 0, 0, 0, 0]] * 2, dtype=xp.float64)
|
1459
|
+
with assert_raises(ValueError):
|
1460
|
+
ndimage.rotate(data, 90, axes=(0, data.ndim))
|
1461
|
+
|
1462
|
+
def test_rotate10(self, xp):
|
1463
|
+
data = xp.reshape(xp.arange(45, dtype=xp.float64), (3, 5, 3))
|
1464
|
+
|
1465
|
+
# The output of ndimage.rotate before refactoring
|
1466
|
+
expected = xp.asarray([[[0.0, 0.0, 0.0],
|
1467
|
+
[0.0, 0.0, 0.0],
|
1468
|
+
[6.54914793, 7.54914793, 8.54914793],
|
1469
|
+
[10.84520162, 11.84520162, 12.84520162],
|
1470
|
+
[0.0, 0.0, 0.0]],
|
1471
|
+
[[6.19286575, 7.19286575, 8.19286575],
|
1472
|
+
[13.4730712, 14.4730712, 15.4730712],
|
1473
|
+
[21.0, 22.0, 23.0],
|
1474
|
+
[28.5269288, 29.5269288, 30.5269288],
|
1475
|
+
[35.80713425, 36.80713425, 37.80713425]],
|
1476
|
+
[[0.0, 0.0, 0.0],
|
1477
|
+
[31.15479838, 32.15479838, 33.15479838],
|
1478
|
+
[35.45085207, 36.45085207, 37.45085207],
|
1479
|
+
[0.0, 0.0, 0.0],
|
1480
|
+
[0.0, 0.0, 0.0]]], dtype=xp.float64)
|
1481
|
+
|
1482
|
+
out = ndimage.rotate(data, angle=12, reshape=False)
|
1483
|
+
#assert_array_almost_equal(out, expected)
|
1484
|
+
xp_assert_close(out, expected, rtol=1e-6, atol=2e-6)
|
1485
|
+
|
1486
|
+
|
1487
|
+
@xfail_xp_backends("cupy", reason="https://github.com/cupy/cupy/issues/8400")
|
1488
|
+
def test_rotate_exact_180(self, xp):
|
1489
|
+
a = xp.asarray(np.tile(np.arange(5), (5, 1)))
|
1490
|
+
b = ndimage.rotate(ndimage.rotate(a, 180), -180)
|
1491
|
+
xp_assert_equal(a, b)
|