scipy 1.16.2__cp313-cp313-win_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scipy/__config__.py +161 -0
- scipy/__init__.py +150 -0
- scipy/_cyutility.cp313-win_arm64.lib +0 -0
- scipy/_cyutility.cp313-win_arm64.pyd +0 -0
- scipy/_distributor_init.py +18 -0
- scipy/_lib/__init__.py +14 -0
- scipy/_lib/_array_api.py +931 -0
- scipy/_lib/_array_api_compat_vendor.py +9 -0
- scipy/_lib/_array_api_no_0d.py +103 -0
- scipy/_lib/_bunch.py +229 -0
- scipy/_lib/_ccallback.py +251 -0
- scipy/_lib/_ccallback_c.cp313-win_arm64.lib +0 -0
- scipy/_lib/_ccallback_c.cp313-win_arm64.pyd +0 -0
- scipy/_lib/_disjoint_set.py +254 -0
- scipy/_lib/_docscrape.py +761 -0
- scipy/_lib/_elementwise_iterative_method.py +346 -0
- scipy/_lib/_fpumode.cp313-win_arm64.lib +0 -0
- scipy/_lib/_fpumode.cp313-win_arm64.pyd +0 -0
- scipy/_lib/_gcutils.py +105 -0
- scipy/_lib/_pep440.py +487 -0
- scipy/_lib/_sparse.py +41 -0
- scipy/_lib/_test_ccallback.cp313-win_arm64.lib +0 -0
- scipy/_lib/_test_ccallback.cp313-win_arm64.pyd +0 -0
- scipy/_lib/_test_deprecation_call.cp313-win_arm64.lib +0 -0
- scipy/_lib/_test_deprecation_call.cp313-win_arm64.pyd +0 -0
- scipy/_lib/_test_deprecation_def.cp313-win_arm64.lib +0 -0
- scipy/_lib/_test_deprecation_def.cp313-win_arm64.pyd +0 -0
- scipy/_lib/_testutils.py +373 -0
- scipy/_lib/_threadsafety.py +58 -0
- scipy/_lib/_tmpdirs.py +86 -0
- scipy/_lib/_uarray/LICENSE +29 -0
- scipy/_lib/_uarray/__init__.py +116 -0
- scipy/_lib/_uarray/_backend.py +707 -0
- scipy/_lib/_uarray/_uarray.cp313-win_arm64.lib +0 -0
- scipy/_lib/_uarray/_uarray.cp313-win_arm64.pyd +0 -0
- scipy/_lib/_util.py +1283 -0
- scipy/_lib/array_api_compat/__init__.py +22 -0
- scipy/_lib/array_api_compat/_internal.py +59 -0
- scipy/_lib/array_api_compat/common/__init__.py +1 -0
- scipy/_lib/array_api_compat/common/_aliases.py +727 -0
- scipy/_lib/array_api_compat/common/_fft.py +213 -0
- scipy/_lib/array_api_compat/common/_helpers.py +1058 -0
- scipy/_lib/array_api_compat/common/_linalg.py +232 -0
- scipy/_lib/array_api_compat/common/_typing.py +192 -0
- scipy/_lib/array_api_compat/cupy/__init__.py +13 -0
- scipy/_lib/array_api_compat/cupy/_aliases.py +156 -0
- scipy/_lib/array_api_compat/cupy/_info.py +336 -0
- scipy/_lib/array_api_compat/cupy/_typing.py +31 -0
- scipy/_lib/array_api_compat/cupy/fft.py +36 -0
- scipy/_lib/array_api_compat/cupy/linalg.py +49 -0
- scipy/_lib/array_api_compat/dask/__init__.py +0 -0
- scipy/_lib/array_api_compat/dask/array/__init__.py +12 -0
- scipy/_lib/array_api_compat/dask/array/_aliases.py +376 -0
- scipy/_lib/array_api_compat/dask/array/_info.py +416 -0
- scipy/_lib/array_api_compat/dask/array/fft.py +21 -0
- scipy/_lib/array_api_compat/dask/array/linalg.py +72 -0
- scipy/_lib/array_api_compat/numpy/__init__.py +28 -0
- scipy/_lib/array_api_compat/numpy/_aliases.py +190 -0
- scipy/_lib/array_api_compat/numpy/_info.py +366 -0
- scipy/_lib/array_api_compat/numpy/_typing.py +30 -0
- scipy/_lib/array_api_compat/numpy/fft.py +35 -0
- scipy/_lib/array_api_compat/numpy/linalg.py +143 -0
- scipy/_lib/array_api_compat/torch/__init__.py +22 -0
- scipy/_lib/array_api_compat/torch/_aliases.py +855 -0
- scipy/_lib/array_api_compat/torch/_info.py +369 -0
- scipy/_lib/array_api_compat/torch/_typing.py +3 -0
- scipy/_lib/array_api_compat/torch/fft.py +85 -0
- scipy/_lib/array_api_compat/torch/linalg.py +121 -0
- scipy/_lib/array_api_extra/__init__.py +38 -0
- scipy/_lib/array_api_extra/_delegation.py +171 -0
- scipy/_lib/array_api_extra/_lib/__init__.py +1 -0
- scipy/_lib/array_api_extra/_lib/_at.py +463 -0
- scipy/_lib/array_api_extra/_lib/_backends.py +46 -0
- scipy/_lib/array_api_extra/_lib/_funcs.py +937 -0
- scipy/_lib/array_api_extra/_lib/_lazy.py +357 -0
- scipy/_lib/array_api_extra/_lib/_testing.py +278 -0
- scipy/_lib/array_api_extra/_lib/_utils/__init__.py +1 -0
- scipy/_lib/array_api_extra/_lib/_utils/_compat.py +74 -0
- scipy/_lib/array_api_extra/_lib/_utils/_compat.pyi +45 -0
- scipy/_lib/array_api_extra/_lib/_utils/_helpers.py +559 -0
- scipy/_lib/array_api_extra/_lib/_utils/_typing.py +10 -0
- scipy/_lib/array_api_extra/_lib/_utils/_typing.pyi +105 -0
- scipy/_lib/array_api_extra/testing.py +359 -0
- scipy/_lib/cobyqa/__init__.py +20 -0
- scipy/_lib/cobyqa/framework.py +1240 -0
- scipy/_lib/cobyqa/main.py +1506 -0
- scipy/_lib/cobyqa/models.py +1529 -0
- scipy/_lib/cobyqa/problem.py +1296 -0
- scipy/_lib/cobyqa/settings.py +132 -0
- scipy/_lib/cobyqa/subsolvers/__init__.py +14 -0
- scipy/_lib/cobyqa/subsolvers/geometry.py +387 -0
- scipy/_lib/cobyqa/subsolvers/optim.py +1203 -0
- scipy/_lib/cobyqa/utils/__init__.py +18 -0
- scipy/_lib/cobyqa/utils/exceptions.py +22 -0
- scipy/_lib/cobyqa/utils/math.py +77 -0
- scipy/_lib/cobyqa/utils/versions.py +67 -0
- scipy/_lib/decorator.py +399 -0
- scipy/_lib/deprecation.py +274 -0
- scipy/_lib/doccer.py +366 -0
- scipy/_lib/messagestream.cp313-win_arm64.lib +0 -0
- scipy/_lib/messagestream.cp313-win_arm64.pyd +0 -0
- scipy/_lib/pyprima/__init__.py +212 -0
- scipy/_lib/pyprima/cobyla/__init__.py +0 -0
- scipy/_lib/pyprima/cobyla/cobyla.py +559 -0
- scipy/_lib/pyprima/cobyla/cobylb.py +714 -0
- scipy/_lib/pyprima/cobyla/geometry.py +226 -0
- scipy/_lib/pyprima/cobyla/initialize.py +215 -0
- scipy/_lib/pyprima/cobyla/trustregion.py +492 -0
- scipy/_lib/pyprima/cobyla/update.py +289 -0
- scipy/_lib/pyprima/common/__init__.py +0 -0
- scipy/_lib/pyprima/common/_bounds.py +34 -0
- scipy/_lib/pyprima/common/_linear_constraints.py +46 -0
- scipy/_lib/pyprima/common/_nonlinear_constraints.py +54 -0
- scipy/_lib/pyprima/common/_project.py +173 -0
- scipy/_lib/pyprima/common/checkbreak.py +93 -0
- scipy/_lib/pyprima/common/consts.py +47 -0
- scipy/_lib/pyprima/common/evaluate.py +99 -0
- scipy/_lib/pyprima/common/history.py +38 -0
- scipy/_lib/pyprima/common/infos.py +30 -0
- scipy/_lib/pyprima/common/linalg.py +435 -0
- scipy/_lib/pyprima/common/message.py +290 -0
- scipy/_lib/pyprima/common/powalg.py +131 -0
- scipy/_lib/pyprima/common/preproc.py +277 -0
- scipy/_lib/pyprima/common/present.py +5 -0
- scipy/_lib/pyprima/common/ratio.py +54 -0
- scipy/_lib/pyprima/common/redrho.py +47 -0
- scipy/_lib/pyprima/common/selectx.py +296 -0
- scipy/_lib/tests/__init__.py +0 -0
- scipy/_lib/tests/test__gcutils.py +110 -0
- scipy/_lib/tests/test__pep440.py +67 -0
- scipy/_lib/tests/test__testutils.py +32 -0
- scipy/_lib/tests/test__threadsafety.py +51 -0
- scipy/_lib/tests/test__util.py +641 -0
- scipy/_lib/tests/test_array_api.py +322 -0
- scipy/_lib/tests/test_bunch.py +169 -0
- scipy/_lib/tests/test_ccallback.py +196 -0
- scipy/_lib/tests/test_config.py +45 -0
- scipy/_lib/tests/test_deprecation.py +10 -0
- scipy/_lib/tests/test_doccer.py +143 -0
- scipy/_lib/tests/test_import_cycles.py +18 -0
- scipy/_lib/tests/test_public_api.py +482 -0
- scipy/_lib/tests/test_scipy_version.py +28 -0
- scipy/_lib/tests/test_tmpdirs.py +48 -0
- scipy/_lib/tests/test_warnings.py +137 -0
- scipy/_lib/uarray.py +31 -0
- scipy/cluster/__init__.py +31 -0
- scipy/cluster/_hierarchy.cp313-win_arm64.lib +0 -0
- scipy/cluster/_hierarchy.cp313-win_arm64.pyd +0 -0
- scipy/cluster/_optimal_leaf_ordering.cp313-win_arm64.lib +0 -0
- scipy/cluster/_optimal_leaf_ordering.cp313-win_arm64.pyd +0 -0
- scipy/cluster/_vq.cp313-win_arm64.lib +0 -0
- scipy/cluster/_vq.cp313-win_arm64.pyd +0 -0
- scipy/cluster/hierarchy.py +4348 -0
- scipy/cluster/tests/__init__.py +0 -0
- scipy/cluster/tests/hierarchy_test_data.py +145 -0
- scipy/cluster/tests/test_disjoint_set.py +202 -0
- scipy/cluster/tests/test_hierarchy.py +1238 -0
- scipy/cluster/tests/test_vq.py +434 -0
- scipy/cluster/vq.py +832 -0
- scipy/conftest.py +683 -0
- scipy/constants/__init__.py +358 -0
- scipy/constants/_codata.py +2266 -0
- scipy/constants/_constants.py +369 -0
- scipy/constants/codata.py +21 -0
- scipy/constants/constants.py +53 -0
- scipy/constants/tests/__init__.py +0 -0
- scipy/constants/tests/test_codata.py +78 -0
- scipy/constants/tests/test_constants.py +83 -0
- scipy/datasets/__init__.py +90 -0
- scipy/datasets/_download_all.py +71 -0
- scipy/datasets/_fetchers.py +225 -0
- scipy/datasets/_registry.py +26 -0
- scipy/datasets/_utils.py +81 -0
- scipy/datasets/tests/__init__.py +0 -0
- scipy/datasets/tests/test_data.py +128 -0
- scipy/differentiate/__init__.py +27 -0
- scipy/differentiate/_differentiate.py +1129 -0
- scipy/differentiate/tests/__init__.py +0 -0
- scipy/differentiate/tests/test_differentiate.py +694 -0
- scipy/fft/__init__.py +114 -0
- scipy/fft/_backend.py +196 -0
- scipy/fft/_basic.py +1650 -0
- scipy/fft/_basic_backend.py +197 -0
- scipy/fft/_debug_backends.py +22 -0
- scipy/fft/_fftlog.py +223 -0
- scipy/fft/_fftlog_backend.py +200 -0
- scipy/fft/_helper.py +348 -0
- scipy/fft/_pocketfft/LICENSE.md +25 -0
- scipy/fft/_pocketfft/__init__.py +9 -0
- scipy/fft/_pocketfft/basic.py +251 -0
- scipy/fft/_pocketfft/helper.py +249 -0
- scipy/fft/_pocketfft/pypocketfft.cp313-win_arm64.lib +0 -0
- scipy/fft/_pocketfft/pypocketfft.cp313-win_arm64.pyd +0 -0
- scipy/fft/_pocketfft/realtransforms.py +109 -0
- scipy/fft/_pocketfft/tests/__init__.py +0 -0
- scipy/fft/_pocketfft/tests/test_basic.py +1011 -0
- scipy/fft/_pocketfft/tests/test_real_transforms.py +505 -0
- scipy/fft/_realtransforms.py +706 -0
- scipy/fft/_realtransforms_backend.py +63 -0
- scipy/fft/tests/__init__.py +0 -0
- scipy/fft/tests/mock_backend.py +96 -0
- scipy/fft/tests/test_backend.py +98 -0
- scipy/fft/tests/test_basic.py +504 -0
- scipy/fft/tests/test_fftlog.py +215 -0
- scipy/fft/tests/test_helper.py +558 -0
- scipy/fft/tests/test_multithreading.py +84 -0
- scipy/fft/tests/test_real_transforms.py +247 -0
- scipy/fftpack/__init__.py +103 -0
- scipy/fftpack/_basic.py +428 -0
- scipy/fftpack/_helper.py +115 -0
- scipy/fftpack/_pseudo_diffs.py +554 -0
- scipy/fftpack/_realtransforms.py +598 -0
- scipy/fftpack/basic.py +20 -0
- scipy/fftpack/convolve.cp313-win_arm64.lib +0 -0
- scipy/fftpack/convolve.cp313-win_arm64.pyd +0 -0
- scipy/fftpack/helper.py +19 -0
- scipy/fftpack/pseudo_diffs.py +22 -0
- scipy/fftpack/realtransforms.py +19 -0
- scipy/fftpack/tests/__init__.py +0 -0
- scipy/fftpack/tests/fftw_double_ref.npz +0 -0
- scipy/fftpack/tests/fftw_longdouble_ref.npz +0 -0
- scipy/fftpack/tests/fftw_single_ref.npz +0 -0
- scipy/fftpack/tests/test.npz +0 -0
- scipy/fftpack/tests/test_basic.py +877 -0
- scipy/fftpack/tests/test_helper.py +54 -0
- scipy/fftpack/tests/test_import.py +33 -0
- scipy/fftpack/tests/test_pseudo_diffs.py +388 -0
- scipy/fftpack/tests/test_real_transforms.py +836 -0
- scipy/integrate/__init__.py +122 -0
- scipy/integrate/_bvp.py +1160 -0
- scipy/integrate/_cubature.py +729 -0
- scipy/integrate/_dop.cp313-win_arm64.lib +0 -0
- scipy/integrate/_dop.cp313-win_arm64.pyd +0 -0
- scipy/integrate/_ivp/__init__.py +8 -0
- scipy/integrate/_ivp/base.py +290 -0
- scipy/integrate/_ivp/bdf.py +478 -0
- scipy/integrate/_ivp/common.py +451 -0
- scipy/integrate/_ivp/dop853_coefficients.py +193 -0
- scipy/integrate/_ivp/ivp.py +755 -0
- scipy/integrate/_ivp/lsoda.py +224 -0
- scipy/integrate/_ivp/radau.py +572 -0
- scipy/integrate/_ivp/rk.py +601 -0
- scipy/integrate/_ivp/tests/__init__.py +0 -0
- scipy/integrate/_ivp/tests/test_ivp.py +1287 -0
- scipy/integrate/_ivp/tests/test_rk.py +37 -0
- scipy/integrate/_lebedev.py +5450 -0
- scipy/integrate/_lsoda.cp313-win_arm64.lib +0 -0
- scipy/integrate/_lsoda.cp313-win_arm64.pyd +0 -0
- scipy/integrate/_ode.py +1395 -0
- scipy/integrate/_odepack.cp313-win_arm64.lib +0 -0
- scipy/integrate/_odepack.cp313-win_arm64.pyd +0 -0
- scipy/integrate/_odepack_py.py +273 -0
- scipy/integrate/_quad_vec.py +674 -0
- scipy/integrate/_quadpack.cp313-win_arm64.lib +0 -0
- scipy/integrate/_quadpack.cp313-win_arm64.pyd +0 -0
- scipy/integrate/_quadpack_py.py +1283 -0
- scipy/integrate/_quadrature.py +1336 -0
- scipy/integrate/_rules/__init__.py +12 -0
- scipy/integrate/_rules/_base.py +518 -0
- scipy/integrate/_rules/_gauss_kronrod.py +202 -0
- scipy/integrate/_rules/_gauss_legendre.py +62 -0
- scipy/integrate/_rules/_genz_malik.py +210 -0
- scipy/integrate/_tanhsinh.py +1385 -0
- scipy/integrate/_test_multivariate.cp313-win_arm64.lib +0 -0
- scipy/integrate/_test_multivariate.cp313-win_arm64.pyd +0 -0
- scipy/integrate/_test_odeint_banded.cp313-win_arm64.lib +0 -0
- scipy/integrate/_test_odeint_banded.cp313-win_arm64.pyd +0 -0
- scipy/integrate/_vode.cp313-win_arm64.lib +0 -0
- scipy/integrate/_vode.cp313-win_arm64.pyd +0 -0
- scipy/integrate/dop.py +15 -0
- scipy/integrate/lsoda.py +15 -0
- scipy/integrate/odepack.py +17 -0
- scipy/integrate/quadpack.py +23 -0
- scipy/integrate/tests/__init__.py +0 -0
- scipy/integrate/tests/test__quad_vec.py +211 -0
- scipy/integrate/tests/test_banded_ode_solvers.py +305 -0
- scipy/integrate/tests/test_bvp.py +714 -0
- scipy/integrate/tests/test_cubature.py +1375 -0
- scipy/integrate/tests/test_integrate.py +840 -0
- scipy/integrate/tests/test_odeint_jac.py +74 -0
- scipy/integrate/tests/test_quadpack.py +680 -0
- scipy/integrate/tests/test_quadrature.py +730 -0
- scipy/integrate/tests/test_tanhsinh.py +1171 -0
- scipy/integrate/vode.py +15 -0
- scipy/interpolate/__init__.py +228 -0
- scipy/interpolate/_bary_rational.py +715 -0
- scipy/interpolate/_bsplines.py +2469 -0
- scipy/interpolate/_cubic.py +973 -0
- scipy/interpolate/_dfitpack.cp313-win_arm64.lib +0 -0
- scipy/interpolate/_dfitpack.cp313-win_arm64.pyd +0 -0
- scipy/interpolate/_dierckx.cp313-win_arm64.lib +0 -0
- scipy/interpolate/_dierckx.cp313-win_arm64.pyd +0 -0
- scipy/interpolate/_fitpack.cp313-win_arm64.lib +0 -0
- scipy/interpolate/_fitpack.cp313-win_arm64.pyd +0 -0
- scipy/interpolate/_fitpack2.py +2397 -0
- scipy/interpolate/_fitpack_impl.py +811 -0
- scipy/interpolate/_fitpack_py.py +898 -0
- scipy/interpolate/_fitpack_repro.py +996 -0
- scipy/interpolate/_interpnd.cp313-win_arm64.lib +0 -0
- scipy/interpolate/_interpnd.cp313-win_arm64.pyd +0 -0
- scipy/interpolate/_interpolate.py +2266 -0
- scipy/interpolate/_ndbspline.py +415 -0
- scipy/interpolate/_ndgriddata.py +329 -0
- scipy/interpolate/_pade.py +67 -0
- scipy/interpolate/_polyint.py +1025 -0
- scipy/interpolate/_ppoly.cp313-win_arm64.lib +0 -0
- scipy/interpolate/_ppoly.cp313-win_arm64.pyd +0 -0
- scipy/interpolate/_rbf.py +290 -0
- scipy/interpolate/_rbfinterp.py +550 -0
- scipy/interpolate/_rbfinterp_pythran.cp313-win_arm64.lib +0 -0
- scipy/interpolate/_rbfinterp_pythran.cp313-win_arm64.pyd +0 -0
- scipy/interpolate/_rgi.py +764 -0
- scipy/interpolate/_rgi_cython.cp313-win_arm64.lib +0 -0
- scipy/interpolate/_rgi_cython.cp313-win_arm64.pyd +0 -0
- scipy/interpolate/dfitpack.py +24 -0
- scipy/interpolate/fitpack.py +31 -0
- scipy/interpolate/fitpack2.py +29 -0
- scipy/interpolate/interpnd.py +24 -0
- scipy/interpolate/interpolate.py +30 -0
- scipy/interpolate/ndgriddata.py +23 -0
- scipy/interpolate/polyint.py +24 -0
- scipy/interpolate/rbf.py +18 -0
- scipy/interpolate/tests/__init__.py +0 -0
- scipy/interpolate/tests/data/bug-1310.npz +0 -0
- scipy/interpolate/tests/data/estimate_gradients_hang.npy +0 -0
- scipy/interpolate/tests/data/gcvspl.npz +0 -0
- scipy/interpolate/tests/test_bary_rational.py +368 -0
- scipy/interpolate/tests/test_bsplines.py +3754 -0
- scipy/interpolate/tests/test_fitpack.py +519 -0
- scipy/interpolate/tests/test_fitpack2.py +1431 -0
- scipy/interpolate/tests/test_gil.py +64 -0
- scipy/interpolate/tests/test_interpnd.py +452 -0
- scipy/interpolate/tests/test_interpolate.py +2630 -0
- scipy/interpolate/tests/test_ndgriddata.py +308 -0
- scipy/interpolate/tests/test_pade.py +107 -0
- scipy/interpolate/tests/test_polyint.py +972 -0
- scipy/interpolate/tests/test_rbf.py +246 -0
- scipy/interpolate/tests/test_rbfinterp.py +534 -0
- scipy/interpolate/tests/test_rgi.py +1151 -0
- scipy/io/__init__.py +116 -0
- scipy/io/_fast_matrix_market/__init__.py +600 -0
- scipy/io/_fast_matrix_market/_fmm_core.cp313-win_arm64.lib +0 -0
- scipy/io/_fast_matrix_market/_fmm_core.cp313-win_arm64.pyd +0 -0
- scipy/io/_fortran.py +354 -0
- scipy/io/_harwell_boeing/__init__.py +7 -0
- scipy/io/_harwell_boeing/_fortran_format_parser.py +316 -0
- scipy/io/_harwell_boeing/hb.py +571 -0
- scipy/io/_harwell_boeing/tests/__init__.py +0 -0
- scipy/io/_harwell_boeing/tests/test_fortran_format.py +74 -0
- scipy/io/_harwell_boeing/tests/test_hb.py +70 -0
- scipy/io/_idl.py +917 -0
- scipy/io/_mmio.py +968 -0
- scipy/io/_netcdf.py +1104 -0
- scipy/io/_test_fortran.cp313-win_arm64.lib +0 -0
- scipy/io/_test_fortran.cp313-win_arm64.pyd +0 -0
- scipy/io/arff/__init__.py +28 -0
- scipy/io/arff/_arffread.py +873 -0
- scipy/io/arff/arffread.py +19 -0
- scipy/io/arff/tests/__init__.py +0 -0
- scipy/io/arff/tests/data/iris.arff +225 -0
- scipy/io/arff/tests/data/missing.arff +8 -0
- scipy/io/arff/tests/data/nodata.arff +11 -0
- scipy/io/arff/tests/data/quoted_nominal.arff +13 -0
- scipy/io/arff/tests/data/quoted_nominal_spaces.arff +13 -0
- scipy/io/arff/tests/data/test1.arff +10 -0
- scipy/io/arff/tests/data/test10.arff +8 -0
- scipy/io/arff/tests/data/test11.arff +11 -0
- scipy/io/arff/tests/data/test2.arff +15 -0
- scipy/io/arff/tests/data/test3.arff +6 -0
- scipy/io/arff/tests/data/test4.arff +11 -0
- scipy/io/arff/tests/data/test5.arff +26 -0
- scipy/io/arff/tests/data/test6.arff +12 -0
- scipy/io/arff/tests/data/test7.arff +15 -0
- scipy/io/arff/tests/data/test8.arff +12 -0
- scipy/io/arff/tests/data/test9.arff +14 -0
- scipy/io/arff/tests/test_arffread.py +421 -0
- scipy/io/harwell_boeing.py +17 -0
- scipy/io/idl.py +17 -0
- scipy/io/matlab/__init__.py +66 -0
- scipy/io/matlab/_byteordercodes.py +75 -0
- scipy/io/matlab/_mio.py +375 -0
- scipy/io/matlab/_mio4.py +632 -0
- scipy/io/matlab/_mio5.py +901 -0
- scipy/io/matlab/_mio5_params.py +281 -0
- scipy/io/matlab/_mio5_utils.cp313-win_arm64.lib +0 -0
- scipy/io/matlab/_mio5_utils.cp313-win_arm64.pyd +0 -0
- scipy/io/matlab/_mio_utils.cp313-win_arm64.lib +0 -0
- scipy/io/matlab/_mio_utils.cp313-win_arm64.pyd +0 -0
- scipy/io/matlab/_miobase.py +435 -0
- scipy/io/matlab/_streams.cp313-win_arm64.lib +0 -0
- scipy/io/matlab/_streams.cp313-win_arm64.pyd +0 -0
- scipy/io/matlab/byteordercodes.py +17 -0
- scipy/io/matlab/mio.py +16 -0
- scipy/io/matlab/mio4.py +17 -0
- scipy/io/matlab/mio5.py +19 -0
- scipy/io/matlab/mio5_params.py +18 -0
- scipy/io/matlab/mio5_utils.py +17 -0
- scipy/io/matlab/mio_utils.py +17 -0
- scipy/io/matlab/miobase.py +16 -0
- scipy/io/matlab/streams.py +16 -0
- scipy/io/matlab/tests/__init__.py +0 -0
- scipy/io/matlab/tests/data/bad_miuint32.mat +0 -0
- scipy/io/matlab/tests/data/bad_miutf8_array_name.mat +0 -0
- scipy/io/matlab/tests/data/big_endian.mat +0 -0
- scipy/io/matlab/tests/data/broken_utf8.mat +0 -0
- scipy/io/matlab/tests/data/corrupted_zlib_checksum.mat +0 -0
- scipy/io/matlab/tests/data/corrupted_zlib_data.mat +0 -0
- scipy/io/matlab/tests/data/debigged_m4.mat +0 -0
- scipy/io/matlab/tests/data/japanese_utf8.txt +5 -0
- scipy/io/matlab/tests/data/little_endian.mat +0 -0
- scipy/io/matlab/tests/data/logical_sparse.mat +0 -0
- scipy/io/matlab/tests/data/malformed1.mat +0 -0
- scipy/io/matlab/tests/data/miuint32_for_miint32.mat +0 -0
- scipy/io/matlab/tests/data/miutf8_array_name.mat +0 -0
- scipy/io/matlab/tests/data/nasty_duplicate_fieldnames.mat +0 -0
- scipy/io/matlab/tests/data/one_by_zero_char.mat +0 -0
- scipy/io/matlab/tests/data/parabola.mat +0 -0
- scipy/io/matlab/tests/data/single_empty_string.mat +0 -0
- scipy/io/matlab/tests/data/some_functions.mat +0 -0
- scipy/io/matlab/tests/data/sqr.mat +0 -0
- scipy/io/matlab/tests/data/test3dmatrix_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/test3dmatrix_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/test3dmatrix_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/test3dmatrix_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/test_empty_struct.mat +0 -0
- scipy/io/matlab/tests/data/test_mat4_le_floats.mat +0 -0
- scipy/io/matlab/tests/data/test_skip_variable.mat +0 -0
- scipy/io/matlab/tests/data/testbool_8_WIN64.mat +0 -0
- scipy/io/matlab/tests/data/testcell_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testcell_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcell_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcell_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcellnest_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testcellnest_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcellnest_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcellnest_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcomplex_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testcomplex_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testcomplex_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcomplex_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcomplex_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testdouble_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testdouble_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testdouble_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testdouble_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testdouble_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testemptycell_5.3_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testemptycell_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testemptycell_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testemptycell_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testfunc_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testhdf5_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testmatrix_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testmatrix_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testmatrix_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testmatrix_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testmatrix_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testminus_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testminus_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testminus_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testminus_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testminus_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testmulti_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testmulti_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testmulti_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testobject_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testobject_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testobject_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testobject_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testonechar_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testonechar_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testonechar_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testonechar_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testonechar_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testscalarcell_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsimplecell.mat +0 -0
- scipy/io/matlab/tests/data/testsparse_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testsparse_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testsparse_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparse_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparse_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparsecomplex_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testsparsecomplex_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testsparsecomplex_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparsecomplex_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparsecomplex_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparsefloat_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststring_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststring_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststring_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststring_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststring_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststringarray_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststringarray_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststringarray_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststringarray_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststringarray_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststruct_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststruct_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststruct_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststruct_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructarr_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststructarr_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructarr_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructarr_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructnest_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststructnest_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructnest_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructnest_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testunicode_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testunicode_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testvec_4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/test_byteordercodes.py +29 -0
- scipy/io/matlab/tests/test_mio.py +1399 -0
- scipy/io/matlab/tests/test_mio5_utils.py +179 -0
- scipy/io/matlab/tests/test_mio_funcs.py +51 -0
- scipy/io/matlab/tests/test_mio_utils.py +45 -0
- scipy/io/matlab/tests/test_miobase.py +32 -0
- scipy/io/matlab/tests/test_pathological.py +33 -0
- scipy/io/matlab/tests/test_streams.py +241 -0
- scipy/io/mmio.py +17 -0
- scipy/io/netcdf.py +17 -0
- scipy/io/tests/__init__.py +0 -0
- scipy/io/tests/data/Transparent Busy.ani +0 -0
- scipy/io/tests/data/array_float32_1d.sav +0 -0
- scipy/io/tests/data/array_float32_2d.sav +0 -0
- scipy/io/tests/data/array_float32_3d.sav +0 -0
- scipy/io/tests/data/array_float32_4d.sav +0 -0
- scipy/io/tests/data/array_float32_5d.sav +0 -0
- scipy/io/tests/data/array_float32_6d.sav +0 -0
- scipy/io/tests/data/array_float32_7d.sav +0 -0
- scipy/io/tests/data/array_float32_8d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_1d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_2d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_3d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_4d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_5d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_6d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_7d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_8d.sav +0 -0
- scipy/io/tests/data/example_1.nc +0 -0
- scipy/io/tests/data/example_2.nc +0 -0
- scipy/io/tests/data/example_3_maskedvals.nc +0 -0
- scipy/io/tests/data/fortran-3x3d-2i.dat +0 -0
- scipy/io/tests/data/fortran-mixed.dat +0 -0
- scipy/io/tests/data/fortran-sf8-11x1x10.dat +0 -0
- scipy/io/tests/data/fortran-sf8-15x10x22.dat +0 -0
- scipy/io/tests/data/fortran-sf8-1x1x1.dat +0 -0
- scipy/io/tests/data/fortran-sf8-1x1x5.dat +0 -0
- scipy/io/tests/data/fortran-sf8-1x1x7.dat +0 -0
- scipy/io/tests/data/fortran-sf8-1x3x5.dat +0 -0
- scipy/io/tests/data/fortran-si4-11x1x10.dat +0 -0
- scipy/io/tests/data/fortran-si4-15x10x22.dat +0 -0
- scipy/io/tests/data/fortran-si4-1x1x1.dat +0 -0
- scipy/io/tests/data/fortran-si4-1x1x5.dat +0 -0
- scipy/io/tests/data/fortran-si4-1x1x7.dat +0 -0
- scipy/io/tests/data/fortran-si4-1x3x5.dat +0 -0
- scipy/io/tests/data/invalid_pointer.sav +0 -0
- scipy/io/tests/data/null_pointer.sav +0 -0
- scipy/io/tests/data/scalar_byte.sav +0 -0
- scipy/io/tests/data/scalar_byte_descr.sav +0 -0
- scipy/io/tests/data/scalar_complex32.sav +0 -0
- scipy/io/tests/data/scalar_complex64.sav +0 -0
- scipy/io/tests/data/scalar_float32.sav +0 -0
- scipy/io/tests/data/scalar_float64.sav +0 -0
- scipy/io/tests/data/scalar_heap_pointer.sav +0 -0
- scipy/io/tests/data/scalar_int16.sav +0 -0
- scipy/io/tests/data/scalar_int32.sav +0 -0
- scipy/io/tests/data/scalar_int64.sav +0 -0
- scipy/io/tests/data/scalar_string.sav +0 -0
- scipy/io/tests/data/scalar_uint16.sav +0 -0
- scipy/io/tests/data/scalar_uint32.sav +0 -0
- scipy/io/tests/data/scalar_uint64.sav +0 -0
- scipy/io/tests/data/struct_arrays.sav +0 -0
- scipy/io/tests/data/struct_arrays_byte_idl80.sav +0 -0
- scipy/io/tests/data/struct_arrays_replicated.sav +0 -0
- scipy/io/tests/data/struct_arrays_replicated_3d.sav +0 -0
- scipy/io/tests/data/struct_inherit.sav +0 -0
- scipy/io/tests/data/struct_pointer_arrays.sav +0 -0
- scipy/io/tests/data/struct_pointer_arrays_replicated.sav +0 -0
- scipy/io/tests/data/struct_pointer_arrays_replicated_3d.sav +0 -0
- scipy/io/tests/data/struct_pointers.sav +0 -0
- scipy/io/tests/data/struct_pointers_replicated.sav +0 -0
- scipy/io/tests/data/struct_pointers_replicated_3d.sav +0 -0
- scipy/io/tests/data/struct_scalars.sav +0 -0
- scipy/io/tests/data/struct_scalars_replicated.sav +0 -0
- scipy/io/tests/data/struct_scalars_replicated_3d.sav +0 -0
- scipy/io/tests/data/test-1234Hz-le-1ch-10S-20bit-extra.wav +0 -0
- scipy/io/tests/data/test-44100Hz-2ch-32bit-float-be.wav +0 -0
- scipy/io/tests/data/test-44100Hz-2ch-32bit-float-le.wav +0 -0
- scipy/io/tests/data/test-44100Hz-be-1ch-4bytes.wav +0 -0
- scipy/io/tests/data/test-44100Hz-le-1ch-4bytes-early-eof-no-data.wav +0 -0
- scipy/io/tests/data/test-44100Hz-le-1ch-4bytes-early-eof.wav +0 -0
- scipy/io/tests/data/test-44100Hz-le-1ch-4bytes-incomplete-chunk.wav +0 -0
- scipy/io/tests/data/test-44100Hz-le-1ch-4bytes-rf64.wav +0 -0
- scipy/io/tests/data/test-44100Hz-le-1ch-4bytes.wav +0 -0
- scipy/io/tests/data/test-48000Hz-2ch-64bit-float-le-wavex.wav +0 -0
- scipy/io/tests/data/test-8000Hz-be-3ch-5S-24bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-1ch-1byte-ulaw.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-2ch-1byteu.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-24bit-inconsistent.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-24bit-rf64.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-24bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-36bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-45bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-53bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-64bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-4ch-9S-12bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-5ch-9S-5bit.wav +0 -0
- scipy/io/tests/data/various_compressed.sav +0 -0
- scipy/io/tests/test_fortran.py +264 -0
- scipy/io/tests/test_idl.py +483 -0
- scipy/io/tests/test_mmio.py +831 -0
- scipy/io/tests/test_netcdf.py +550 -0
- scipy/io/tests/test_paths.py +93 -0
- scipy/io/tests/test_wavfile.py +501 -0
- scipy/io/wavfile.py +938 -0
- scipy/linalg/__init__.pxd +1 -0
- scipy/linalg/__init__.py +236 -0
- scipy/linalg/_basic.py +2146 -0
- scipy/linalg/_blas_subroutines.h +164 -0
- scipy/linalg/_cythonized_array_utils.cp313-win_arm64.lib +0 -0
- scipy/linalg/_cythonized_array_utils.cp313-win_arm64.pyd +0 -0
- scipy/linalg/_cythonized_array_utils.pxd +40 -0
- scipy/linalg/_cythonized_array_utils.pyi +16 -0
- scipy/linalg/_decomp.py +1645 -0
- scipy/linalg/_decomp_cholesky.py +413 -0
- scipy/linalg/_decomp_cossin.py +236 -0
- scipy/linalg/_decomp_interpolative.cp313-win_arm64.lib +0 -0
- scipy/linalg/_decomp_interpolative.cp313-win_arm64.pyd +0 -0
- scipy/linalg/_decomp_ldl.py +356 -0
- scipy/linalg/_decomp_lu.py +401 -0
- scipy/linalg/_decomp_lu_cython.cp313-win_arm64.lib +0 -0
- scipy/linalg/_decomp_lu_cython.cp313-win_arm64.pyd +0 -0
- scipy/linalg/_decomp_lu_cython.pyi +6 -0
- scipy/linalg/_decomp_polar.py +113 -0
- scipy/linalg/_decomp_qr.py +494 -0
- scipy/linalg/_decomp_qz.py +452 -0
- scipy/linalg/_decomp_schur.py +336 -0
- scipy/linalg/_decomp_svd.py +545 -0
- scipy/linalg/_decomp_update.cp313-win_arm64.lib +0 -0
- scipy/linalg/_decomp_update.cp313-win_arm64.pyd +0 -0
- scipy/linalg/_expm_frechet.py +417 -0
- scipy/linalg/_fblas.cp313-win_arm64.lib +0 -0
- scipy/linalg/_fblas.cp313-win_arm64.pyd +0 -0
- scipy/linalg/_flapack.cp313-win_arm64.lib +0 -0
- scipy/linalg/_flapack.cp313-win_arm64.pyd +0 -0
- scipy/linalg/_lapack_subroutines.h +1521 -0
- scipy/linalg/_linalg_pythran.cp313-win_arm64.lib +0 -0
- scipy/linalg/_linalg_pythran.cp313-win_arm64.pyd +0 -0
- scipy/linalg/_matfuncs.py +1050 -0
- scipy/linalg/_matfuncs_expm.cp313-win_arm64.lib +0 -0
- scipy/linalg/_matfuncs_expm.cp313-win_arm64.pyd +0 -0
- scipy/linalg/_matfuncs_expm.pyi +6 -0
- scipy/linalg/_matfuncs_inv_ssq.py +886 -0
- scipy/linalg/_matfuncs_schur_sqrtm.cp313-win_arm64.lib +0 -0
- scipy/linalg/_matfuncs_schur_sqrtm.cp313-win_arm64.pyd +0 -0
- scipy/linalg/_matfuncs_sqrtm.py +107 -0
- scipy/linalg/_matfuncs_sqrtm_triu.cp313-win_arm64.lib +0 -0
- scipy/linalg/_matfuncs_sqrtm_triu.cp313-win_arm64.pyd +0 -0
- scipy/linalg/_misc.py +191 -0
- scipy/linalg/_procrustes.py +113 -0
- scipy/linalg/_sketches.py +189 -0
- scipy/linalg/_solve_toeplitz.cp313-win_arm64.lib +0 -0
- scipy/linalg/_solve_toeplitz.cp313-win_arm64.pyd +0 -0
- scipy/linalg/_solvers.py +862 -0
- scipy/linalg/_special_matrices.py +1322 -0
- scipy/linalg/_testutils.py +65 -0
- scipy/linalg/basic.py +23 -0
- scipy/linalg/blas.py +495 -0
- scipy/linalg/cython_blas.cp313-win_arm64.lib +0 -0
- scipy/linalg/cython_blas.cp313-win_arm64.pyd +0 -0
- scipy/linalg/cython_blas.pxd +169 -0
- scipy/linalg/cython_blas.pyx +1432 -0
- scipy/linalg/cython_lapack.cp313-win_arm64.lib +0 -0
- scipy/linalg/cython_lapack.cp313-win_arm64.pyd +0 -0
- scipy/linalg/cython_lapack.pxd +1528 -0
- scipy/linalg/cython_lapack.pyx +12045 -0
- scipy/linalg/decomp.py +23 -0
- scipy/linalg/decomp_cholesky.py +21 -0
- scipy/linalg/decomp_lu.py +21 -0
- scipy/linalg/decomp_qr.py +20 -0
- scipy/linalg/decomp_schur.py +21 -0
- scipy/linalg/decomp_svd.py +21 -0
- scipy/linalg/interpolative.py +989 -0
- scipy/linalg/lapack.py +1081 -0
- scipy/linalg/matfuncs.py +23 -0
- scipy/linalg/misc.py +21 -0
- scipy/linalg/special_matrices.py +22 -0
- scipy/linalg/tests/__init__.py +0 -0
- scipy/linalg/tests/_cython_examples/extending.pyx +23 -0
- scipy/linalg/tests/_cython_examples/meson.build +34 -0
- scipy/linalg/tests/data/carex_15_data.npz +0 -0
- scipy/linalg/tests/data/carex_18_data.npz +0 -0
- scipy/linalg/tests/data/carex_19_data.npz +0 -0
- scipy/linalg/tests/data/carex_20_data.npz +0 -0
- scipy/linalg/tests/data/carex_6_data.npz +0 -0
- scipy/linalg/tests/data/gendare_20170120_data.npz +0 -0
- scipy/linalg/tests/test_basic.py +2074 -0
- scipy/linalg/tests/test_batch.py +588 -0
- scipy/linalg/tests/test_blas.py +1127 -0
- scipy/linalg/tests/test_cython_blas.py +118 -0
- scipy/linalg/tests/test_cython_lapack.py +22 -0
- scipy/linalg/tests/test_cythonized_array_utils.py +130 -0
- scipy/linalg/tests/test_decomp.py +3189 -0
- scipy/linalg/tests/test_decomp_cholesky.py +268 -0
- scipy/linalg/tests/test_decomp_cossin.py +314 -0
- scipy/linalg/tests/test_decomp_ldl.py +137 -0
- scipy/linalg/tests/test_decomp_lu.py +308 -0
- scipy/linalg/tests/test_decomp_polar.py +110 -0
- scipy/linalg/tests/test_decomp_update.py +1701 -0
- scipy/linalg/tests/test_extending.py +46 -0
- scipy/linalg/tests/test_fblas.py +607 -0
- scipy/linalg/tests/test_interpolative.py +232 -0
- scipy/linalg/tests/test_lapack.py +3620 -0
- scipy/linalg/tests/test_matfuncs.py +1125 -0
- scipy/linalg/tests/test_matmul_toeplitz.py +136 -0
- scipy/linalg/tests/test_procrustes.py +214 -0
- scipy/linalg/tests/test_sketches.py +118 -0
- scipy/linalg/tests/test_solve_toeplitz.py +150 -0
- scipy/linalg/tests/test_solvers.py +844 -0
- scipy/linalg/tests/test_special_matrices.py +636 -0
- scipy/misc/__init__.py +6 -0
- scipy/misc/common.py +6 -0
- scipy/misc/doccer.py +6 -0
- scipy/ndimage/__init__.py +174 -0
- scipy/ndimage/_ctest.cp313-win_arm64.lib +0 -0
- scipy/ndimage/_ctest.cp313-win_arm64.pyd +0 -0
- scipy/ndimage/_cytest.cp313-win_arm64.lib +0 -0
- scipy/ndimage/_cytest.cp313-win_arm64.pyd +0 -0
- scipy/ndimage/_delegators.py +303 -0
- scipy/ndimage/_filters.py +2422 -0
- scipy/ndimage/_fourier.py +306 -0
- scipy/ndimage/_interpolation.py +1033 -0
- scipy/ndimage/_measurements.py +1689 -0
- scipy/ndimage/_morphology.py +2634 -0
- scipy/ndimage/_nd_image.cp313-win_arm64.lib +0 -0
- scipy/ndimage/_nd_image.cp313-win_arm64.pyd +0 -0
- scipy/ndimage/_ndimage_api.py +16 -0
- scipy/ndimage/_ni_docstrings.py +214 -0
- scipy/ndimage/_ni_label.cp313-win_arm64.lib +0 -0
- scipy/ndimage/_ni_label.cp313-win_arm64.pyd +0 -0
- scipy/ndimage/_ni_support.py +139 -0
- scipy/ndimage/_rank_filter_1d.cp313-win_arm64.lib +0 -0
- scipy/ndimage/_rank_filter_1d.cp313-win_arm64.pyd +0 -0
- scipy/ndimage/_support_alternative_backends.py +84 -0
- scipy/ndimage/filters.py +27 -0
- scipy/ndimage/fourier.py +21 -0
- scipy/ndimage/interpolation.py +22 -0
- scipy/ndimage/measurements.py +24 -0
- scipy/ndimage/morphology.py +27 -0
- scipy/ndimage/tests/__init__.py +12 -0
- scipy/ndimage/tests/data/label_inputs.txt +21 -0
- scipy/ndimage/tests/data/label_results.txt +294 -0
- scipy/ndimage/tests/data/label_strels.txt +42 -0
- scipy/ndimage/tests/dots.png +0 -0
- scipy/ndimage/tests/test_c_api.py +102 -0
- scipy/ndimage/tests/test_datatypes.py +67 -0
- scipy/ndimage/tests/test_filters.py +3083 -0
- scipy/ndimage/tests/test_fourier.py +187 -0
- scipy/ndimage/tests/test_interpolation.py +1491 -0
- scipy/ndimage/tests/test_measurements.py +1592 -0
- scipy/ndimage/tests/test_morphology.py +2950 -0
- scipy/ndimage/tests/test_ni_support.py +78 -0
- scipy/ndimage/tests/test_splines.py +70 -0
- scipy/odr/__init__.py +131 -0
- scipy/odr/__odrpack.cp313-win_arm64.lib +0 -0
- scipy/odr/__odrpack.cp313-win_arm64.pyd +0 -0
- scipy/odr/_add_newdocs.py +34 -0
- scipy/odr/_models.py +315 -0
- scipy/odr/_odrpack.py +1154 -0
- scipy/odr/models.py +20 -0
- scipy/odr/odrpack.py +21 -0
- scipy/odr/tests/__init__.py +0 -0
- scipy/odr/tests/test_odr.py +607 -0
- scipy/optimize/__init__.pxd +1 -0
- scipy/optimize/__init__.py +460 -0
- scipy/optimize/_basinhopping.py +741 -0
- scipy/optimize/_bglu_dense.cp313-win_arm64.lib +0 -0
- scipy/optimize/_bglu_dense.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_bracket.py +706 -0
- scipy/optimize/_chandrupatla.py +551 -0
- scipy/optimize/_cobyla_py.py +297 -0
- scipy/optimize/_cobyqa_py.py +72 -0
- scipy/optimize/_constraints.py +598 -0
- scipy/optimize/_dcsrch.py +728 -0
- scipy/optimize/_differentiable_functions.py +835 -0
- scipy/optimize/_differentialevolution.py +1970 -0
- scipy/optimize/_direct.cp313-win_arm64.lib +0 -0
- scipy/optimize/_direct.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_direct_py.py +280 -0
- scipy/optimize/_dual_annealing.py +732 -0
- scipy/optimize/_elementwise.py +798 -0
- scipy/optimize/_group_columns.cp313-win_arm64.lib +0 -0
- scipy/optimize/_group_columns.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_hessian_update_strategy.py +479 -0
- scipy/optimize/_highspy/__init__.py +0 -0
- scipy/optimize/_highspy/_core.cp313-win_arm64.lib +0 -0
- scipy/optimize/_highspy/_core.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_highspy/_highs_options.cp313-win_arm64.lib +0 -0
- scipy/optimize/_highspy/_highs_options.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_highspy/_highs_wrapper.py +338 -0
- scipy/optimize/_isotonic.py +157 -0
- scipy/optimize/_lbfgsb.cp313-win_arm64.lib +0 -0
- scipy/optimize/_lbfgsb.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_lbfgsb_py.py +634 -0
- scipy/optimize/_linesearch.py +896 -0
- scipy/optimize/_linprog.py +733 -0
- scipy/optimize/_linprog_doc.py +1434 -0
- scipy/optimize/_linprog_highs.py +422 -0
- scipy/optimize/_linprog_ip.py +1141 -0
- scipy/optimize/_linprog_rs.py +572 -0
- scipy/optimize/_linprog_simplex.py +663 -0
- scipy/optimize/_linprog_util.py +1521 -0
- scipy/optimize/_lsap.cp313-win_arm64.lib +0 -0
- scipy/optimize/_lsap.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_lsq/__init__.py +5 -0
- scipy/optimize/_lsq/bvls.py +183 -0
- scipy/optimize/_lsq/common.py +731 -0
- scipy/optimize/_lsq/dogbox.py +345 -0
- scipy/optimize/_lsq/givens_elimination.cp313-win_arm64.lib +0 -0
- scipy/optimize/_lsq/givens_elimination.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_lsq/least_squares.py +1044 -0
- scipy/optimize/_lsq/lsq_linear.py +361 -0
- scipy/optimize/_lsq/trf.py +587 -0
- scipy/optimize/_lsq/trf_linear.py +249 -0
- scipy/optimize/_milp.py +394 -0
- scipy/optimize/_minimize.py +1199 -0
- scipy/optimize/_minpack.cp313-win_arm64.lib +0 -0
- scipy/optimize/_minpack.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_minpack_py.py +1178 -0
- scipy/optimize/_moduleTNC.cp313-win_arm64.lib +0 -0
- scipy/optimize/_moduleTNC.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_nnls.py +96 -0
- scipy/optimize/_nonlin.py +1634 -0
- scipy/optimize/_numdiff.py +963 -0
- scipy/optimize/_optimize.py +4169 -0
- scipy/optimize/_pava_pybind.cp313-win_arm64.lib +0 -0
- scipy/optimize/_pava_pybind.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_qap.py +760 -0
- scipy/optimize/_remove_redundancy.py +522 -0
- scipy/optimize/_root.py +732 -0
- scipy/optimize/_root_scalar.py +538 -0
- scipy/optimize/_shgo.py +1606 -0
- scipy/optimize/_shgo_lib/__init__.py +0 -0
- scipy/optimize/_shgo_lib/_complex.py +1225 -0
- scipy/optimize/_shgo_lib/_vertex.py +460 -0
- scipy/optimize/_slsqp_py.py +603 -0
- scipy/optimize/_slsqplib.cp313-win_arm64.lib +0 -0
- scipy/optimize/_slsqplib.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_spectral.py +260 -0
- scipy/optimize/_tnc.py +438 -0
- scipy/optimize/_trlib/__init__.py +12 -0
- scipy/optimize/_trlib/_trlib.cp313-win_arm64.lib +0 -0
- scipy/optimize/_trlib/_trlib.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_trustregion.py +318 -0
- scipy/optimize/_trustregion_constr/__init__.py +6 -0
- scipy/optimize/_trustregion_constr/canonical_constraint.py +390 -0
- scipy/optimize/_trustregion_constr/equality_constrained_sqp.py +231 -0
- scipy/optimize/_trustregion_constr/minimize_trustregion_constr.py +584 -0
- scipy/optimize/_trustregion_constr/projections.py +411 -0
- scipy/optimize/_trustregion_constr/qp_subproblem.py +637 -0
- scipy/optimize/_trustregion_constr/report.py +49 -0
- scipy/optimize/_trustregion_constr/tests/__init__.py +0 -0
- scipy/optimize/_trustregion_constr/tests/test_canonical_constraint.py +296 -0
- scipy/optimize/_trustregion_constr/tests/test_nested_minimize.py +39 -0
- scipy/optimize/_trustregion_constr/tests/test_projections.py +214 -0
- scipy/optimize/_trustregion_constr/tests/test_qp_subproblem.py +645 -0
- scipy/optimize/_trustregion_constr/tests/test_report.py +34 -0
- scipy/optimize/_trustregion_constr/tr_interior_point.py +361 -0
- scipy/optimize/_trustregion_dogleg.py +122 -0
- scipy/optimize/_trustregion_exact.py +437 -0
- scipy/optimize/_trustregion_krylov.py +65 -0
- scipy/optimize/_trustregion_ncg.py +126 -0
- scipy/optimize/_tstutils.py +972 -0
- scipy/optimize/_zeros.cp313-win_arm64.lib +0 -0
- scipy/optimize/_zeros.cp313-win_arm64.pyd +0 -0
- scipy/optimize/_zeros_py.py +1475 -0
- scipy/optimize/cobyla.py +19 -0
- scipy/optimize/cython_optimize/__init__.py +133 -0
- scipy/optimize/cython_optimize/_zeros.cp313-win_arm64.lib +0 -0
- scipy/optimize/cython_optimize/_zeros.cp313-win_arm64.pyd +0 -0
- scipy/optimize/cython_optimize/_zeros.pxd +33 -0
- scipy/optimize/cython_optimize/c_zeros.pxd +26 -0
- scipy/optimize/cython_optimize.pxd +11 -0
- scipy/optimize/elementwise.py +38 -0
- scipy/optimize/lbfgsb.py +23 -0
- scipy/optimize/linesearch.py +18 -0
- scipy/optimize/minpack.py +27 -0
- scipy/optimize/minpack2.py +17 -0
- scipy/optimize/moduleTNC.py +19 -0
- scipy/optimize/nonlin.py +29 -0
- scipy/optimize/optimize.py +40 -0
- scipy/optimize/slsqp.py +22 -0
- scipy/optimize/tests/__init__.py +0 -0
- scipy/optimize/tests/_cython_examples/extending.pyx +43 -0
- scipy/optimize/tests/_cython_examples/meson.build +32 -0
- scipy/optimize/tests/test__basinhopping.py +535 -0
- scipy/optimize/tests/test__differential_evolution.py +1703 -0
- scipy/optimize/tests/test__dual_annealing.py +416 -0
- scipy/optimize/tests/test__linprog_clean_inputs.py +312 -0
- scipy/optimize/tests/test__numdiff.py +885 -0
- scipy/optimize/tests/test__remove_redundancy.py +228 -0
- scipy/optimize/tests/test__root.py +124 -0
- scipy/optimize/tests/test__shgo.py +1164 -0
- scipy/optimize/tests/test__spectral.py +226 -0
- scipy/optimize/tests/test_bracket.py +896 -0
- scipy/optimize/tests/test_chandrupatla.py +982 -0
- scipy/optimize/tests/test_cobyla.py +195 -0
- scipy/optimize/tests/test_cobyqa.py +252 -0
- scipy/optimize/tests/test_constraint_conversion.py +286 -0
- scipy/optimize/tests/test_constraints.py +255 -0
- scipy/optimize/tests/test_cython_optimize.py +92 -0
- scipy/optimize/tests/test_differentiable_functions.py +1025 -0
- scipy/optimize/tests/test_direct.py +321 -0
- scipy/optimize/tests/test_extending.py +28 -0
- scipy/optimize/tests/test_hessian_update_strategy.py +300 -0
- scipy/optimize/tests/test_isotonic_regression.py +167 -0
- scipy/optimize/tests/test_lbfgsb_hessinv.py +65 -0
- scipy/optimize/tests/test_lbfgsb_setulb.py +122 -0
- scipy/optimize/tests/test_least_squares.py +986 -0
- scipy/optimize/tests/test_linear_assignment.py +116 -0
- scipy/optimize/tests/test_linesearch.py +328 -0
- scipy/optimize/tests/test_linprog.py +2577 -0
- scipy/optimize/tests/test_lsq_common.py +297 -0
- scipy/optimize/tests/test_lsq_linear.py +287 -0
- scipy/optimize/tests/test_milp.py +459 -0
- scipy/optimize/tests/test_minimize_constrained.py +845 -0
- scipy/optimize/tests/test_minpack.py +1194 -0
- scipy/optimize/tests/test_nnls.py +469 -0
- scipy/optimize/tests/test_nonlin.py +572 -0
- scipy/optimize/tests/test_optimize.py +3344 -0
- scipy/optimize/tests/test_quadratic_assignment.py +455 -0
- scipy/optimize/tests/test_regression.py +40 -0
- scipy/optimize/tests/test_slsqp.py +645 -0
- scipy/optimize/tests/test_tnc.py +345 -0
- scipy/optimize/tests/test_trustregion.py +110 -0
- scipy/optimize/tests/test_trustregion_exact.py +351 -0
- scipy/optimize/tests/test_trustregion_krylov.py +170 -0
- scipy/optimize/tests/test_zeros.py +998 -0
- scipy/optimize/tnc.py +22 -0
- scipy/optimize/zeros.py +26 -0
- scipy/signal/__init__.py +316 -0
- scipy/signal/_arraytools.py +264 -0
- scipy/signal/_czt.py +575 -0
- scipy/signal/_delegators.py +568 -0
- scipy/signal/_filter_design.py +5893 -0
- scipy/signal/_fir_filter_design.py +1458 -0
- scipy/signal/_lti_conversion.py +534 -0
- scipy/signal/_ltisys.py +3546 -0
- scipy/signal/_max_len_seq.py +139 -0
- scipy/signal/_max_len_seq_inner.cp313-win_arm64.lib +0 -0
- scipy/signal/_max_len_seq_inner.cp313-win_arm64.pyd +0 -0
- scipy/signal/_peak_finding.py +1310 -0
- scipy/signal/_peak_finding_utils.cp313-win_arm64.lib +0 -0
- scipy/signal/_peak_finding_utils.cp313-win_arm64.pyd +0 -0
- scipy/signal/_polyutils.py +172 -0
- scipy/signal/_savitzky_golay.py +357 -0
- scipy/signal/_short_time_fft.py +2228 -0
- scipy/signal/_signal_api.py +30 -0
- scipy/signal/_signaltools.py +5309 -0
- scipy/signal/_sigtools.cp313-win_arm64.lib +0 -0
- scipy/signal/_sigtools.cp313-win_arm64.pyd +0 -0
- scipy/signal/_sosfilt.cp313-win_arm64.lib +0 -0
- scipy/signal/_sosfilt.cp313-win_arm64.pyd +0 -0
- scipy/signal/_spectral_py.py +2471 -0
- scipy/signal/_spline.cp313-win_arm64.lib +0 -0
- scipy/signal/_spline.cp313-win_arm64.pyd +0 -0
- scipy/signal/_spline.pyi +34 -0
- scipy/signal/_spline_filters.py +848 -0
- scipy/signal/_support_alternative_backends.py +73 -0
- scipy/signal/_upfirdn.py +219 -0
- scipy/signal/_upfirdn_apply.cp313-win_arm64.lib +0 -0
- scipy/signal/_upfirdn_apply.cp313-win_arm64.pyd +0 -0
- scipy/signal/_waveforms.py +687 -0
- scipy/signal/_wavelets.py +29 -0
- scipy/signal/bsplines.py +21 -0
- scipy/signal/filter_design.py +28 -0
- scipy/signal/fir_filter_design.py +21 -0
- scipy/signal/lti_conversion.py +20 -0
- scipy/signal/ltisys.py +25 -0
- scipy/signal/signaltools.py +27 -0
- scipy/signal/spectral.py +21 -0
- scipy/signal/spline.py +18 -0
- scipy/signal/tests/__init__.py +0 -0
- scipy/signal/tests/_scipy_spectral_test_shim.py +311 -0
- scipy/signal/tests/mpsig.py +122 -0
- scipy/signal/tests/test_array_tools.py +111 -0
- scipy/signal/tests/test_bsplines.py +365 -0
- scipy/signal/tests/test_cont2discrete.py +424 -0
- scipy/signal/tests/test_czt.py +221 -0
- scipy/signal/tests/test_dltisys.py +599 -0
- scipy/signal/tests/test_filter_design.py +4744 -0
- scipy/signal/tests/test_fir_filter_design.py +851 -0
- scipy/signal/tests/test_ltisys.py +1225 -0
- scipy/signal/tests/test_max_len_seq.py +71 -0
- scipy/signal/tests/test_peak_finding.py +915 -0
- scipy/signal/tests/test_result_type.py +51 -0
- scipy/signal/tests/test_savitzky_golay.py +363 -0
- scipy/signal/tests/test_short_time_fft.py +1107 -0
- scipy/signal/tests/test_signaltools.py +4735 -0
- scipy/signal/tests/test_spectral.py +2141 -0
- scipy/signal/tests/test_splines.py +427 -0
- scipy/signal/tests/test_upfirdn.py +322 -0
- scipy/signal/tests/test_waveforms.py +400 -0
- scipy/signal/tests/test_wavelets.py +59 -0
- scipy/signal/tests/test_windows.py +987 -0
- scipy/signal/waveforms.py +20 -0
- scipy/signal/wavelets.py +17 -0
- scipy/signal/windows/__init__.py +52 -0
- scipy/signal/windows/_windows.py +2513 -0
- scipy/signal/windows/windows.py +23 -0
- scipy/sparse/__init__.py +350 -0
- scipy/sparse/_base.py +1613 -0
- scipy/sparse/_bsr.py +880 -0
- scipy/sparse/_compressed.py +1328 -0
- scipy/sparse/_construct.py +1454 -0
- scipy/sparse/_coo.py +1581 -0
- scipy/sparse/_csc.py +367 -0
- scipy/sparse/_csparsetools.cp313-win_arm64.lib +0 -0
- scipy/sparse/_csparsetools.cp313-win_arm64.pyd +0 -0
- scipy/sparse/_csr.py +558 -0
- scipy/sparse/_data.py +569 -0
- scipy/sparse/_dia.py +677 -0
- scipy/sparse/_dok.py +669 -0
- scipy/sparse/_extract.py +178 -0
- scipy/sparse/_index.py +444 -0
- scipy/sparse/_lil.py +632 -0
- scipy/sparse/_matrix.py +169 -0
- scipy/sparse/_matrix_io.py +167 -0
- scipy/sparse/_sparsetools.cp313-win_arm64.lib +0 -0
- scipy/sparse/_sparsetools.cp313-win_arm64.pyd +0 -0
- scipy/sparse/_spfuncs.py +76 -0
- scipy/sparse/_sputils.py +632 -0
- scipy/sparse/base.py +24 -0
- scipy/sparse/bsr.py +22 -0
- scipy/sparse/compressed.py +20 -0
- scipy/sparse/construct.py +38 -0
- scipy/sparse/coo.py +23 -0
- scipy/sparse/csc.py +22 -0
- scipy/sparse/csgraph/__init__.py +210 -0
- scipy/sparse/csgraph/_flow.cp313-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_flow.cp313-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_laplacian.py +563 -0
- scipy/sparse/csgraph/_matching.cp313-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_matching.cp313-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_min_spanning_tree.cp313-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_min_spanning_tree.cp313-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_reordering.cp313-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_reordering.cp313-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_shortest_path.cp313-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_shortest_path.cp313-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_tools.cp313-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_tools.cp313-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_traversal.cp313-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_traversal.cp313-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_validation.py +66 -0
- scipy/sparse/csgraph/tests/__init__.py +0 -0
- scipy/sparse/csgraph/tests/test_connected_components.py +119 -0
- scipy/sparse/csgraph/tests/test_conversions.py +61 -0
- scipy/sparse/csgraph/tests/test_flow.py +209 -0
- scipy/sparse/csgraph/tests/test_graph_laplacian.py +368 -0
- scipy/sparse/csgraph/tests/test_matching.py +307 -0
- scipy/sparse/csgraph/tests/test_pydata_sparse.py +197 -0
- scipy/sparse/csgraph/tests/test_reordering.py +70 -0
- scipy/sparse/csgraph/tests/test_shortest_path.py +540 -0
- scipy/sparse/csgraph/tests/test_spanning_tree.py +66 -0
- scipy/sparse/csgraph/tests/test_traversal.py +148 -0
- scipy/sparse/csr.py +22 -0
- scipy/sparse/data.py +18 -0
- scipy/sparse/dia.py +22 -0
- scipy/sparse/dok.py +22 -0
- scipy/sparse/extract.py +23 -0
- scipy/sparse/lil.py +22 -0
- scipy/sparse/linalg/__init__.py +148 -0
- scipy/sparse/linalg/_dsolve/__init__.py +71 -0
- scipy/sparse/linalg/_dsolve/_add_newdocs.py +147 -0
- scipy/sparse/linalg/_dsolve/_superlu.cp313-win_arm64.lib +0 -0
- scipy/sparse/linalg/_dsolve/_superlu.cp313-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_dsolve/linsolve.py +882 -0
- scipy/sparse/linalg/_dsolve/tests/__init__.py +0 -0
- scipy/sparse/linalg/_dsolve/tests/test_linsolve.py +928 -0
- scipy/sparse/linalg/_eigen/__init__.py +22 -0
- scipy/sparse/linalg/_eigen/_svds.py +540 -0
- scipy/sparse/linalg/_eigen/_svds_doc.py +382 -0
- scipy/sparse/linalg/_eigen/arpack/COPYING +45 -0
- scipy/sparse/linalg/_eigen/arpack/__init__.py +20 -0
- scipy/sparse/linalg/_eigen/arpack/_arpack.cp313-win_arm64.lib +0 -0
- scipy/sparse/linalg/_eigen/arpack/_arpack.cp313-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_eigen/arpack/arpack.py +1706 -0
- scipy/sparse/linalg/_eigen/arpack/tests/__init__.py +0 -0
- scipy/sparse/linalg/_eigen/arpack/tests/test_arpack.py +717 -0
- scipy/sparse/linalg/_eigen/lobpcg/__init__.py +16 -0
- scipy/sparse/linalg/_eigen/lobpcg/lobpcg.py +1110 -0
- scipy/sparse/linalg/_eigen/lobpcg/tests/__init__.py +0 -0
- scipy/sparse/linalg/_eigen/lobpcg/tests/test_lobpcg.py +725 -0
- scipy/sparse/linalg/_eigen/tests/__init__.py +0 -0
- scipy/sparse/linalg/_eigen/tests/test_svds.py +886 -0
- scipy/sparse/linalg/_expm_multiply.py +816 -0
- scipy/sparse/linalg/_interface.py +920 -0
- scipy/sparse/linalg/_isolve/__init__.py +20 -0
- scipy/sparse/linalg/_isolve/_gcrotmk.py +503 -0
- scipy/sparse/linalg/_isolve/iterative.py +1051 -0
- scipy/sparse/linalg/_isolve/lgmres.py +230 -0
- scipy/sparse/linalg/_isolve/lsmr.py +486 -0
- scipy/sparse/linalg/_isolve/lsqr.py +589 -0
- scipy/sparse/linalg/_isolve/minres.py +372 -0
- scipy/sparse/linalg/_isolve/tests/__init__.py +0 -0
- scipy/sparse/linalg/_isolve/tests/test_gcrotmk.py +183 -0
- scipy/sparse/linalg/_isolve/tests/test_iterative.py +809 -0
- scipy/sparse/linalg/_isolve/tests/test_lgmres.py +225 -0
- scipy/sparse/linalg/_isolve/tests/test_lsmr.py +185 -0
- scipy/sparse/linalg/_isolve/tests/test_lsqr.py +120 -0
- scipy/sparse/linalg/_isolve/tests/test_minres.py +97 -0
- scipy/sparse/linalg/_isolve/tests/test_utils.py +9 -0
- scipy/sparse/linalg/_isolve/tfqmr.py +179 -0
- scipy/sparse/linalg/_isolve/utils.py +121 -0
- scipy/sparse/linalg/_matfuncs.py +940 -0
- scipy/sparse/linalg/_norm.py +195 -0
- scipy/sparse/linalg/_onenormest.py +467 -0
- scipy/sparse/linalg/_propack/_cpropack.cp313-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_cpropack.cp313-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_propack/_dpropack.cp313-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_dpropack.cp313-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_propack/_spropack.cp313-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_spropack.cp313-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_propack/_zpropack.cp313-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_zpropack.cp313-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_special_sparse_arrays.py +949 -0
- scipy/sparse/linalg/_svdp.py +309 -0
- scipy/sparse/linalg/dsolve.py +22 -0
- scipy/sparse/linalg/eigen.py +21 -0
- scipy/sparse/linalg/interface.py +20 -0
- scipy/sparse/linalg/isolve.py +22 -0
- scipy/sparse/linalg/matfuncs.py +18 -0
- scipy/sparse/linalg/tests/__init__.py +0 -0
- scipy/sparse/linalg/tests/propack_test_data.npz +0 -0
- scipy/sparse/linalg/tests/test_expm_multiply.py +367 -0
- scipy/sparse/linalg/tests/test_interface.py +561 -0
- scipy/sparse/linalg/tests/test_matfuncs.py +592 -0
- scipy/sparse/linalg/tests/test_norm.py +154 -0
- scipy/sparse/linalg/tests/test_onenormest.py +252 -0
- scipy/sparse/linalg/tests/test_propack.py +165 -0
- scipy/sparse/linalg/tests/test_pydata_sparse.py +272 -0
- scipy/sparse/linalg/tests/test_special_sparse_arrays.py +337 -0
- scipy/sparse/sparsetools.py +17 -0
- scipy/sparse/spfuncs.py +17 -0
- scipy/sparse/sputils.py +17 -0
- scipy/sparse/tests/__init__.py +0 -0
- scipy/sparse/tests/data/csc_py2.npz +0 -0
- scipy/sparse/tests/data/csc_py3.npz +0 -0
- scipy/sparse/tests/test_arithmetic1d.py +341 -0
- scipy/sparse/tests/test_array_api.py +561 -0
- scipy/sparse/tests/test_base.py +5870 -0
- scipy/sparse/tests/test_common1d.py +447 -0
- scipy/sparse/tests/test_construct.py +872 -0
- scipy/sparse/tests/test_coo.py +1119 -0
- scipy/sparse/tests/test_csc.py +98 -0
- scipy/sparse/tests/test_csr.py +214 -0
- scipy/sparse/tests/test_dok.py +209 -0
- scipy/sparse/tests/test_extract.py +51 -0
- scipy/sparse/tests/test_indexing1d.py +603 -0
- scipy/sparse/tests/test_matrix_io.py +109 -0
- scipy/sparse/tests/test_minmax1d.py +128 -0
- scipy/sparse/tests/test_sparsetools.py +344 -0
- scipy/sparse/tests/test_spfuncs.py +97 -0
- scipy/sparse/tests/test_sputils.py +424 -0
- scipy/spatial/__init__.py +129 -0
- scipy/spatial/_ckdtree.cp313-win_arm64.lib +0 -0
- scipy/spatial/_ckdtree.cp313-win_arm64.pyd +0 -0
- scipy/spatial/_distance_pybind.cp313-win_arm64.lib +0 -0
- scipy/spatial/_distance_pybind.cp313-win_arm64.pyd +0 -0
- scipy/spatial/_distance_wrap.cp313-win_arm64.lib +0 -0
- scipy/spatial/_distance_wrap.cp313-win_arm64.pyd +0 -0
- scipy/spatial/_geometric_slerp.py +238 -0
- scipy/spatial/_hausdorff.cp313-win_arm64.lib +0 -0
- scipy/spatial/_hausdorff.cp313-win_arm64.pyd +0 -0
- scipy/spatial/_kdtree.py +920 -0
- scipy/spatial/_plotutils.py +274 -0
- scipy/spatial/_procrustes.py +132 -0
- scipy/spatial/_qhull.cp313-win_arm64.lib +0 -0
- scipy/spatial/_qhull.cp313-win_arm64.pyd +0 -0
- scipy/spatial/_qhull.pyi +213 -0
- scipy/spatial/_spherical_voronoi.py +341 -0
- scipy/spatial/_voronoi.cp313-win_arm64.lib +0 -0
- scipy/spatial/_voronoi.cp313-win_arm64.pyd +0 -0
- scipy/spatial/_voronoi.pyi +4 -0
- scipy/spatial/ckdtree.py +18 -0
- scipy/spatial/distance.py +3147 -0
- scipy/spatial/distance.pyi +210 -0
- scipy/spatial/kdtree.py +25 -0
- scipy/spatial/qhull.py +25 -0
- scipy/spatial/qhull_src/COPYING_QHULL.txt +39 -0
- scipy/spatial/tests/__init__.py +0 -0
- scipy/spatial/tests/data/cdist-X1.txt +10 -0
- scipy/spatial/tests/data/cdist-X2.txt +20 -0
- scipy/spatial/tests/data/degenerate_pointset.npz +0 -0
- scipy/spatial/tests/data/iris.txt +150 -0
- scipy/spatial/tests/data/pdist-boolean-inp.txt +20 -0
- scipy/spatial/tests/data/pdist-chebyshev-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-chebyshev-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-cityblock-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-cityblock-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-correlation-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-correlation-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-cosine-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-cosine-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-double-inp.txt +20 -0
- scipy/spatial/tests/data/pdist-euclidean-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-euclidean-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-hamming-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-jaccard-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-jensenshannon-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-jensenshannon-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-minkowski-3.2-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-minkowski-3.2-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-minkowski-5.8-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-seuclidean-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-seuclidean-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-spearman-ml.txt +1 -0
- scipy/spatial/tests/data/random-bool-data.txt +100 -0
- scipy/spatial/tests/data/random-double-data.txt +100 -0
- scipy/spatial/tests/data/random-int-data.txt +100 -0
- scipy/spatial/tests/data/random-uint-data.txt +100 -0
- scipy/spatial/tests/data/selfdual-4d-polytope.txt +27 -0
- scipy/spatial/tests/test__plotutils.py +91 -0
- scipy/spatial/tests/test__procrustes.py +116 -0
- scipy/spatial/tests/test_distance.py +2389 -0
- scipy/spatial/tests/test_hausdorff.py +199 -0
- scipy/spatial/tests/test_kdtree.py +1536 -0
- scipy/spatial/tests/test_qhull.py +1313 -0
- scipy/spatial/tests/test_slerp.py +417 -0
- scipy/spatial/tests/test_spherical_voronoi.py +358 -0
- scipy/spatial/transform/__init__.py +31 -0
- scipy/spatial/transform/_rigid_transform.cp313-win_arm64.lib +0 -0
- scipy/spatial/transform/_rigid_transform.cp313-win_arm64.pyd +0 -0
- scipy/spatial/transform/_rotation.cp313-win_arm64.lib +0 -0
- scipy/spatial/transform/_rotation.cp313-win_arm64.pyd +0 -0
- scipy/spatial/transform/_rotation_groups.py +140 -0
- scipy/spatial/transform/_rotation_spline.py +460 -0
- scipy/spatial/transform/rotation.py +21 -0
- scipy/spatial/transform/tests/__init__.py +0 -0
- scipy/spatial/transform/tests/test_rigid_transform.py +1221 -0
- scipy/spatial/transform/tests/test_rotation.py +2569 -0
- scipy/spatial/transform/tests/test_rotation_groups.py +169 -0
- scipy/spatial/transform/tests/test_rotation_spline.py +183 -0
- scipy/special/__init__.pxd +1 -0
- scipy/special/__init__.py +841 -0
- scipy/special/_add_newdocs.py +9961 -0
- scipy/special/_basic.py +3576 -0
- scipy/special/_comb.cp313-win_arm64.lib +0 -0
- scipy/special/_comb.cp313-win_arm64.pyd +0 -0
- scipy/special/_ellip_harm.py +214 -0
- scipy/special/_ellip_harm_2.cp313-win_arm64.lib +0 -0
- scipy/special/_ellip_harm_2.cp313-win_arm64.pyd +0 -0
- scipy/special/_gufuncs.cp313-win_arm64.lib +0 -0
- scipy/special/_gufuncs.cp313-win_arm64.pyd +0 -0
- scipy/special/_input_validation.py +17 -0
- scipy/special/_lambertw.py +149 -0
- scipy/special/_logsumexp.py +426 -0
- scipy/special/_mptestutils.py +453 -0
- scipy/special/_multiufuncs.py +610 -0
- scipy/special/_orthogonal.py +2592 -0
- scipy/special/_orthogonal.pyi +330 -0
- scipy/special/_precompute/__init__.py +0 -0
- scipy/special/_precompute/cosine_cdf.py +17 -0
- scipy/special/_precompute/expn_asy.py +54 -0
- scipy/special/_precompute/gammainc_asy.py +116 -0
- scipy/special/_precompute/gammainc_data.py +124 -0
- scipy/special/_precompute/hyp2f1_data.py +484 -0
- scipy/special/_precompute/lambertw.py +68 -0
- scipy/special/_precompute/loggamma.py +43 -0
- scipy/special/_precompute/struve_convergence.py +131 -0
- scipy/special/_precompute/utils.py +38 -0
- scipy/special/_precompute/wright_bessel.py +342 -0
- scipy/special/_precompute/wright_bessel_data.py +152 -0
- scipy/special/_precompute/wrightomega.py +41 -0
- scipy/special/_precompute/zetac.py +27 -0
- scipy/special/_sf_error.py +15 -0
- scipy/special/_specfun.cp313-win_arm64.lib +0 -0
- scipy/special/_specfun.cp313-win_arm64.pyd +0 -0
- scipy/special/_special_ufuncs.cp313-win_arm64.lib +0 -0
- scipy/special/_special_ufuncs.cp313-win_arm64.pyd +0 -0
- scipy/special/_spfun_stats.py +106 -0
- scipy/special/_spherical_bessel.py +397 -0
- scipy/special/_support_alternative_backends.py +295 -0
- scipy/special/_test_internal.cp313-win_arm64.lib +0 -0
- scipy/special/_test_internal.cp313-win_arm64.pyd +0 -0
- scipy/special/_test_internal.pyi +9 -0
- scipy/special/_testutils.py +321 -0
- scipy/special/_ufuncs.cp313-win_arm64.lib +0 -0
- scipy/special/_ufuncs.cp313-win_arm64.pyd +0 -0
- scipy/special/_ufuncs.pyi +522 -0
- scipy/special/_ufuncs.pyx +13173 -0
- scipy/special/_ufuncs_cxx.cp313-win_arm64.lib +0 -0
- scipy/special/_ufuncs_cxx.cp313-win_arm64.pyd +0 -0
- scipy/special/_ufuncs_cxx.pxd +142 -0
- scipy/special/_ufuncs_cxx.pyx +427 -0
- scipy/special/_ufuncs_cxx_defs.h +147 -0
- scipy/special/_ufuncs_defs.h +57 -0
- scipy/special/add_newdocs.py +15 -0
- scipy/special/basic.py +87 -0
- scipy/special/cython_special.cp313-win_arm64.lib +0 -0
- scipy/special/cython_special.cp313-win_arm64.pyd +0 -0
- scipy/special/cython_special.pxd +259 -0
- scipy/special/cython_special.pyi +3 -0
- scipy/special/orthogonal.py +45 -0
- scipy/special/sf_error.py +20 -0
- scipy/special/specfun.py +24 -0
- scipy/special/spfun_stats.py +17 -0
- scipy/special/tests/__init__.py +0 -0
- scipy/special/tests/_cython_examples/extending.pyx +12 -0
- scipy/special/tests/_cython_examples/meson.build +34 -0
- scipy/special/tests/data/__init__.py +0 -0
- scipy/special/tests/data/boost.npz +0 -0
- scipy/special/tests/data/gsl.npz +0 -0
- scipy/special/tests/data/local.npz +0 -0
- scipy/special/tests/test_basic.py +4815 -0
- scipy/special/tests/test_bdtr.py +112 -0
- scipy/special/tests/test_boost_ufuncs.py +64 -0
- scipy/special/tests/test_boxcox.py +125 -0
- scipy/special/tests/test_cdflib.py +712 -0
- scipy/special/tests/test_cdft_asymptotic.py +49 -0
- scipy/special/tests/test_cephes_intp_cast.py +29 -0
- scipy/special/tests/test_cosine_distr.py +83 -0
- scipy/special/tests/test_cython_special.py +363 -0
- scipy/special/tests/test_data.py +719 -0
- scipy/special/tests/test_dd.py +42 -0
- scipy/special/tests/test_digamma.py +45 -0
- scipy/special/tests/test_ellip_harm.py +278 -0
- scipy/special/tests/test_erfinv.py +89 -0
- scipy/special/tests/test_exponential_integrals.py +118 -0
- scipy/special/tests/test_extending.py +28 -0
- scipy/special/tests/test_faddeeva.py +85 -0
- scipy/special/tests/test_gamma.py +12 -0
- scipy/special/tests/test_gammainc.py +152 -0
- scipy/special/tests/test_hyp2f1.py +2566 -0
- scipy/special/tests/test_hypergeometric.py +234 -0
- scipy/special/tests/test_iv_ratio.py +249 -0
- scipy/special/tests/test_kolmogorov.py +491 -0
- scipy/special/tests/test_lambertw.py +109 -0
- scipy/special/tests/test_legendre.py +1518 -0
- scipy/special/tests/test_log1mexp.py +85 -0
- scipy/special/tests/test_loggamma.py +70 -0
- scipy/special/tests/test_logit.py +162 -0
- scipy/special/tests/test_logsumexp.py +469 -0
- scipy/special/tests/test_mpmath.py +2293 -0
- scipy/special/tests/test_nan_inputs.py +65 -0
- scipy/special/tests/test_ndtr.py +77 -0
- scipy/special/tests/test_ndtri_exp.py +94 -0
- scipy/special/tests/test_orthogonal.py +821 -0
- scipy/special/tests/test_orthogonal_eval.py +275 -0
- scipy/special/tests/test_owens_t.py +53 -0
- scipy/special/tests/test_pcf.py +24 -0
- scipy/special/tests/test_pdtr.py +48 -0
- scipy/special/tests/test_powm1.py +65 -0
- scipy/special/tests/test_precompute_expn_asy.py +24 -0
- scipy/special/tests/test_precompute_gammainc.py +108 -0
- scipy/special/tests/test_precompute_utils.py +36 -0
- scipy/special/tests/test_round.py +18 -0
- scipy/special/tests/test_sf_error.py +146 -0
- scipy/special/tests/test_sici.py +36 -0
- scipy/special/tests/test_specfun.py +48 -0
- scipy/special/tests/test_spence.py +32 -0
- scipy/special/tests/test_spfun_stats.py +61 -0
- scipy/special/tests/test_sph_harm.py +85 -0
- scipy/special/tests/test_spherical_bessel.py +400 -0
- scipy/special/tests/test_support_alternative_backends.py +248 -0
- scipy/special/tests/test_trig.py +72 -0
- scipy/special/tests/test_ufunc_signatures.py +46 -0
- scipy/special/tests/test_wright_bessel.py +205 -0
- scipy/special/tests/test_wrightomega.py +117 -0
- scipy/special/tests/test_zeta.py +301 -0
- scipy/stats/__init__.py +670 -0
- scipy/stats/_ansari_swilk_statistics.cp313-win_arm64.lib +0 -0
- scipy/stats/_ansari_swilk_statistics.cp313-win_arm64.pyd +0 -0
- scipy/stats/_axis_nan_policy.py +692 -0
- scipy/stats/_biasedurn.cp313-win_arm64.lib +0 -0
- scipy/stats/_biasedurn.cp313-win_arm64.pyd +0 -0
- scipy/stats/_biasedurn.pxd +27 -0
- scipy/stats/_binned_statistic.py +795 -0
- scipy/stats/_binomtest.py +375 -0
- scipy/stats/_bws_test.py +177 -0
- scipy/stats/_censored_data.py +459 -0
- scipy/stats/_common.py +5 -0
- scipy/stats/_constants.py +42 -0
- scipy/stats/_continued_fraction.py +387 -0
- scipy/stats/_continuous_distns.py +12486 -0
- scipy/stats/_correlation.py +210 -0
- scipy/stats/_covariance.py +636 -0
- scipy/stats/_crosstab.py +204 -0
- scipy/stats/_discrete_distns.py +2098 -0
- scipy/stats/_distn_infrastructure.py +4201 -0
- scipy/stats/_distr_params.py +299 -0
- scipy/stats/_distribution_infrastructure.py +5750 -0
- scipy/stats/_entropy.py +428 -0
- scipy/stats/_finite_differences.py +145 -0
- scipy/stats/_fit.py +1351 -0
- scipy/stats/_hypotests.py +2060 -0
- scipy/stats/_kde.py +732 -0
- scipy/stats/_ksstats.py +600 -0
- scipy/stats/_levy_stable/__init__.py +1231 -0
- scipy/stats/_levy_stable/levyst.cp313-win_arm64.lib +0 -0
- scipy/stats/_levy_stable/levyst.cp313-win_arm64.pyd +0 -0
- scipy/stats/_mannwhitneyu.py +492 -0
- scipy/stats/_mgc.py +550 -0
- scipy/stats/_morestats.py +4626 -0
- scipy/stats/_mstats_basic.py +3658 -0
- scipy/stats/_mstats_extras.py +521 -0
- scipy/stats/_multicomp.py +449 -0
- scipy/stats/_multivariate.py +7281 -0
- scipy/stats/_new_distributions.py +452 -0
- scipy/stats/_odds_ratio.py +466 -0
- scipy/stats/_page_trend_test.py +486 -0
- scipy/stats/_probability_distribution.py +1964 -0
- scipy/stats/_qmc.py +2956 -0
- scipy/stats/_qmc_cy.cp313-win_arm64.lib +0 -0
- scipy/stats/_qmc_cy.cp313-win_arm64.pyd +0 -0
- scipy/stats/_qmc_cy.pyi +54 -0
- scipy/stats/_qmvnt.py +454 -0
- scipy/stats/_qmvnt_cy.cp313-win_arm64.lib +0 -0
- scipy/stats/_qmvnt_cy.cp313-win_arm64.pyd +0 -0
- scipy/stats/_quantile.py +335 -0
- scipy/stats/_rcont/__init__.py +4 -0
- scipy/stats/_rcont/rcont.cp313-win_arm64.lib +0 -0
- scipy/stats/_rcont/rcont.cp313-win_arm64.pyd +0 -0
- scipy/stats/_relative_risk.py +263 -0
- scipy/stats/_resampling.py +2352 -0
- scipy/stats/_result_classes.py +40 -0
- scipy/stats/_sampling.py +1314 -0
- scipy/stats/_sensitivity_analysis.py +713 -0
- scipy/stats/_sobol.cp313-win_arm64.lib +0 -0
- scipy/stats/_sobol.cp313-win_arm64.pyd +0 -0
- scipy/stats/_sobol.pyi +54 -0
- scipy/stats/_sobol_direction_numbers.npz +0 -0
- scipy/stats/_stats.cp313-win_arm64.lib +0 -0
- scipy/stats/_stats.cp313-win_arm64.pyd +0 -0
- scipy/stats/_stats.pxd +10 -0
- scipy/stats/_stats_mstats_common.py +322 -0
- scipy/stats/_stats_py.py +11089 -0
- scipy/stats/_stats_pythran.cp313-win_arm64.lib +0 -0
- scipy/stats/_stats_pythran.cp313-win_arm64.pyd +0 -0
- scipy/stats/_survival.py +683 -0
- scipy/stats/_tukeylambda_stats.py +199 -0
- scipy/stats/_unuran/__init__.py +0 -0
- scipy/stats/_unuran/unuran_wrapper.cp313-win_arm64.lib +0 -0
- scipy/stats/_unuran/unuran_wrapper.cp313-win_arm64.pyd +0 -0
- scipy/stats/_unuran/unuran_wrapper.pyi +179 -0
- scipy/stats/_variation.py +126 -0
- scipy/stats/_warnings_errors.py +38 -0
- scipy/stats/_wilcoxon.py +265 -0
- scipy/stats/biasedurn.py +16 -0
- scipy/stats/contingency.py +521 -0
- scipy/stats/distributions.py +24 -0
- scipy/stats/kde.py +18 -0
- scipy/stats/morestats.py +27 -0
- scipy/stats/mstats.py +140 -0
- scipy/stats/mstats_basic.py +42 -0
- scipy/stats/mstats_extras.py +25 -0
- scipy/stats/mvn.py +17 -0
- scipy/stats/qmc.py +236 -0
- scipy/stats/sampling.py +73 -0
- scipy/stats/stats.py +41 -0
- scipy/stats/tests/__init__.py +0 -0
- scipy/stats/tests/common_tests.py +356 -0
- scipy/stats/tests/data/_mvt.py +171 -0
- scipy/stats/tests/data/fisher_exact_results_from_r.py +607 -0
- scipy/stats/tests/data/jf_skew_t_gamlss_pdf_data.npy +0 -0
- scipy/stats/tests/data/levy_stable/stable-Z1-cdf-sample-data.npy +0 -0
- scipy/stats/tests/data/levy_stable/stable-Z1-pdf-sample-data.npy +0 -0
- scipy/stats/tests/data/levy_stable/stable-loc-scale-sample-data.npy +0 -0
- scipy/stats/tests/data/nist_anova/AtmWtAg.dat +108 -0
- scipy/stats/tests/data/nist_anova/SiRstv.dat +85 -0
- scipy/stats/tests/data/nist_anova/SmLs01.dat +249 -0
- scipy/stats/tests/data/nist_anova/SmLs02.dat +1869 -0
- scipy/stats/tests/data/nist_anova/SmLs03.dat +18069 -0
- scipy/stats/tests/data/nist_anova/SmLs04.dat +249 -0
- scipy/stats/tests/data/nist_anova/SmLs05.dat +1869 -0
- scipy/stats/tests/data/nist_anova/SmLs06.dat +18069 -0
- scipy/stats/tests/data/nist_anova/SmLs07.dat +249 -0
- scipy/stats/tests/data/nist_anova/SmLs08.dat +1869 -0
- scipy/stats/tests/data/nist_anova/SmLs09.dat +18069 -0
- scipy/stats/tests/data/nist_linregress/Norris.dat +97 -0
- scipy/stats/tests/data/rel_breitwigner_pdf_sample_data_ROOT.npy +0 -0
- scipy/stats/tests/data/studentized_range_mpmath_ref.json +1499 -0
- scipy/stats/tests/test_axis_nan_policy.py +1388 -0
- scipy/stats/tests/test_binned_statistic.py +568 -0
- scipy/stats/tests/test_censored_data.py +152 -0
- scipy/stats/tests/test_contingency.py +294 -0
- scipy/stats/tests/test_continued_fraction.py +173 -0
- scipy/stats/tests/test_continuous.py +2198 -0
- scipy/stats/tests/test_continuous_basic.py +1053 -0
- scipy/stats/tests/test_continuous_fit_censored.py +683 -0
- scipy/stats/tests/test_correlation.py +80 -0
- scipy/stats/tests/test_crosstab.py +115 -0
- scipy/stats/tests/test_discrete_basic.py +580 -0
- scipy/stats/tests/test_discrete_distns.py +700 -0
- scipy/stats/tests/test_distributions.py +10413 -0
- scipy/stats/tests/test_entropy.py +322 -0
- scipy/stats/tests/test_fast_gen_inversion.py +435 -0
- scipy/stats/tests/test_fit.py +1090 -0
- scipy/stats/tests/test_hypotests.py +1991 -0
- scipy/stats/tests/test_kdeoth.py +676 -0
- scipy/stats/tests/test_marray.py +289 -0
- scipy/stats/tests/test_mgc.py +217 -0
- scipy/stats/tests/test_morestats.py +3259 -0
- scipy/stats/tests/test_mstats_basic.py +2071 -0
- scipy/stats/tests/test_mstats_extras.py +172 -0
- scipy/stats/tests/test_multicomp.py +405 -0
- scipy/stats/tests/test_multivariate.py +4381 -0
- scipy/stats/tests/test_odds_ratio.py +148 -0
- scipy/stats/tests/test_qmc.py +1492 -0
- scipy/stats/tests/test_quantile.py +199 -0
- scipy/stats/tests/test_rank.py +345 -0
- scipy/stats/tests/test_relative_risk.py +95 -0
- scipy/stats/tests/test_resampling.py +2000 -0
- scipy/stats/tests/test_sampling.py +1450 -0
- scipy/stats/tests/test_sensitivity_analysis.py +310 -0
- scipy/stats/tests/test_stats.py +9707 -0
- scipy/stats/tests/test_survival.py +466 -0
- scipy/stats/tests/test_tukeylambda_stats.py +85 -0
- scipy/stats/tests/test_variation.py +216 -0
- scipy/version.py +12 -0
- scipy-1.16.2.dist-info/DELVEWHEEL +2 -0
- scipy-1.16.2.dist-info/LICENSE.txt +912 -0
- scipy-1.16.2.dist-info/METADATA +1061 -0
- scipy-1.16.2.dist-info/RECORD +1530 -0
- scipy-1.16.2.dist-info/WHEEL +4 -0
- scipy.libs/msvcp140-5f1c5dd31916990d94181e07bc3afb32.dll +0 -0
- scipy.libs/scipy_openblas-f3ac85b1f412f7e86514c923dc4058d1.dll +0 -0
@@ -0,0 +1,1399 @@
|
|
1
|
+
import os
|
2
|
+
from collections import OrderedDict
|
3
|
+
from os.path import join as pjoin, dirname
|
4
|
+
from glob import glob
|
5
|
+
from io import BytesIO
|
6
|
+
import re
|
7
|
+
from tempfile import mkdtemp
|
8
|
+
|
9
|
+
import warnings
|
10
|
+
import shutil
|
11
|
+
import gzip
|
12
|
+
|
13
|
+
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
|
14
|
+
assert_equal, assert_, assert_warns, assert_allclose)
|
15
|
+
import pytest
|
16
|
+
from pytest import raises as assert_raises
|
17
|
+
|
18
|
+
import numpy as np
|
19
|
+
from numpy import array
|
20
|
+
from scipy.sparse import issparse, eye_array, coo_array, csc_array
|
21
|
+
|
22
|
+
import scipy.io
|
23
|
+
from scipy.io.matlab import MatlabOpaque, MatlabFunction, MatlabObject
|
24
|
+
import scipy.io.matlab._byteordercodes as boc
|
25
|
+
from scipy.io.matlab._miobase import (matdims, MatWriteError, MatReadError,
|
26
|
+
matfile_version, MatWriteWarning)
|
27
|
+
from scipy.io.matlab._mio import mat_reader_factory, loadmat, savemat, whosmat
|
28
|
+
from scipy.io.matlab._mio5 import (
|
29
|
+
MatFile5Writer, MatFile5Reader, varmats_from_mat, to_writeable,
|
30
|
+
EmptyStructMarker)
|
31
|
+
import scipy.io.matlab._mio5_params as mio5p
|
32
|
+
|
33
|
+
|
34
|
+
test_data_path = pjoin(dirname(__file__), 'data')
|
35
|
+
pytestmark = pytest.mark.thread_unsafe
|
36
|
+
|
37
|
+
|
38
|
+
def mlarr(*args, **kwargs):
|
39
|
+
"""Convenience function to return matlab-compatible 2-D array."""
|
40
|
+
arr = np.array(*args, **kwargs)
|
41
|
+
arr.shape = matdims(arr)
|
42
|
+
return arr
|
43
|
+
|
44
|
+
|
45
|
+
# Define cases to test
|
46
|
+
theta = np.pi/4*np.arange(9,dtype=float).reshape(1,9)
|
47
|
+
case_table4 = [
|
48
|
+
{'name': 'double',
|
49
|
+
'classes': {'testdouble': 'double'},
|
50
|
+
'expected': {'testdouble': theta}
|
51
|
+
}]
|
52
|
+
case_table4.append(
|
53
|
+
{'name': 'string',
|
54
|
+
'classes': {'teststring': 'char'},
|
55
|
+
'expected': {'teststring':
|
56
|
+
array(['"Do nine men interpret?" "Nine men," I nod.'])}
|
57
|
+
})
|
58
|
+
case_table4.append(
|
59
|
+
{'name': 'complex',
|
60
|
+
'classes': {'testcomplex': 'double'},
|
61
|
+
'expected': {'testcomplex': np.cos(theta) + 1j*np.sin(theta)}
|
62
|
+
})
|
63
|
+
A = np.zeros((3,5))
|
64
|
+
A[0] = list(range(1,6))
|
65
|
+
A[:,0] = list(range(1,4))
|
66
|
+
case_table4.append(
|
67
|
+
{'name': 'matrix',
|
68
|
+
'classes': {'testmatrix': 'double'},
|
69
|
+
'expected': {'testmatrix': A},
|
70
|
+
})
|
71
|
+
case_table4.append(
|
72
|
+
{'name': 'sparse',
|
73
|
+
'classes': {'testsparse': 'sparse'},
|
74
|
+
'expected': {'testsparse': coo_array(A)},
|
75
|
+
})
|
76
|
+
B = A.astype(complex)
|
77
|
+
B[0,0] += 1j
|
78
|
+
case_table4.append(
|
79
|
+
{'name': 'sparsecomplex',
|
80
|
+
'classes': {'testsparsecomplex': 'sparse'},
|
81
|
+
'expected': {'testsparsecomplex': coo_array(B)},
|
82
|
+
})
|
83
|
+
case_table4.append(
|
84
|
+
{'name': 'multi',
|
85
|
+
'classes': {'theta': 'double', 'a': 'double'},
|
86
|
+
'expected': {'theta': theta, 'a': A},
|
87
|
+
})
|
88
|
+
case_table4.append(
|
89
|
+
{'name': 'minus',
|
90
|
+
'classes': {'testminus': 'double'},
|
91
|
+
'expected': {'testminus': mlarr(-1)},
|
92
|
+
})
|
93
|
+
case_table4.append(
|
94
|
+
{'name': 'onechar',
|
95
|
+
'classes': {'testonechar': 'char'},
|
96
|
+
'expected': {'testonechar': array(['r'])},
|
97
|
+
})
|
98
|
+
# Cell arrays stored as object arrays
|
99
|
+
CA = mlarr(( # tuple for object array creation
|
100
|
+
[],
|
101
|
+
mlarr([1]),
|
102
|
+
mlarr([[1,2]]),
|
103
|
+
mlarr([[1,2,3]])), dtype=object).reshape(1,-1)
|
104
|
+
CA[0,0] = array(
|
105
|
+
['This cell contains this string and 3 arrays of increasing length'])
|
106
|
+
case_table5 = [
|
107
|
+
{'name': 'cell',
|
108
|
+
'classes': {'testcell': 'cell'},
|
109
|
+
'expected': {'testcell': CA}}]
|
110
|
+
CAE = mlarr(( # tuple for object array creation
|
111
|
+
mlarr(1),
|
112
|
+
mlarr(2),
|
113
|
+
mlarr([]),
|
114
|
+
mlarr([]),
|
115
|
+
mlarr(3)), dtype=object).reshape(1,-1)
|
116
|
+
objarr = np.empty((1,1),dtype=object)
|
117
|
+
objarr[0,0] = mlarr(1)
|
118
|
+
case_table5.append(
|
119
|
+
{'name': 'scalarcell',
|
120
|
+
'classes': {'testscalarcell': 'cell'},
|
121
|
+
'expected': {'testscalarcell': objarr}
|
122
|
+
})
|
123
|
+
case_table5.append(
|
124
|
+
{'name': 'emptycell',
|
125
|
+
'classes': {'testemptycell': 'cell'},
|
126
|
+
'expected': {'testemptycell': CAE}})
|
127
|
+
case_table5.append(
|
128
|
+
{'name': 'stringarray',
|
129
|
+
'classes': {'teststringarray': 'char'},
|
130
|
+
'expected': {'teststringarray': array(
|
131
|
+
['one ', 'two ', 'three'])},
|
132
|
+
})
|
133
|
+
case_table5.append(
|
134
|
+
{'name': '3dmatrix',
|
135
|
+
'classes': {'test3dmatrix': 'double'},
|
136
|
+
'expected': {
|
137
|
+
'test3dmatrix': np.transpose(np.reshape(list(range(1,25)), (4,3,2)))}
|
138
|
+
})
|
139
|
+
st_sub_arr = array([np.sqrt(2),np.exp(1),np.pi]).reshape(1,3)
|
140
|
+
dtype = [(n, object) for n in ['stringfield', 'doublefield', 'complexfield']]
|
141
|
+
st1 = np.zeros((1,1), dtype)
|
142
|
+
st1['stringfield'][0,0] = array(['Rats live on no evil star.'])
|
143
|
+
st1['doublefield'][0,0] = st_sub_arr
|
144
|
+
st1['complexfield'][0,0] = st_sub_arr * (1 + 1j)
|
145
|
+
case_table5.append(
|
146
|
+
{'name': 'struct',
|
147
|
+
'classes': {'teststruct': 'struct'},
|
148
|
+
'expected': {'teststruct': st1}
|
149
|
+
})
|
150
|
+
CN = np.zeros((1,2), dtype=object)
|
151
|
+
CN[0,0] = mlarr(1)
|
152
|
+
CN[0,1] = np.zeros((1,3), dtype=object)
|
153
|
+
CN[0,1][0,0] = mlarr(2, dtype=np.uint8)
|
154
|
+
CN[0,1][0,1] = mlarr([[3]], dtype=np.uint8)
|
155
|
+
CN[0,1][0,2] = np.zeros((1,2), dtype=object)
|
156
|
+
CN[0,1][0,2][0,0] = mlarr(4, dtype=np.uint8)
|
157
|
+
CN[0,1][0,2][0,1] = mlarr(5, dtype=np.uint8)
|
158
|
+
case_table5.append(
|
159
|
+
{'name': 'cellnest',
|
160
|
+
'classes': {'testcellnest': 'cell'},
|
161
|
+
'expected': {'testcellnest': CN},
|
162
|
+
})
|
163
|
+
st2 = np.empty((1,1), dtype=[(n, object) for n in ['one', 'two']])
|
164
|
+
st2[0,0]['one'] = mlarr(1)
|
165
|
+
st2[0,0]['two'] = np.empty((1,1), dtype=[('three', object)])
|
166
|
+
st2[0,0]['two'][0,0]['three'] = array(['number 3'])
|
167
|
+
case_table5.append(
|
168
|
+
{'name': 'structnest',
|
169
|
+
'classes': {'teststructnest': 'struct'},
|
170
|
+
'expected': {'teststructnest': st2}
|
171
|
+
})
|
172
|
+
a = np.empty((1,2), dtype=[(n, object) for n in ['one', 'two']])
|
173
|
+
a[0,0]['one'] = mlarr(1)
|
174
|
+
a[0,0]['two'] = mlarr(2)
|
175
|
+
a[0,1]['one'] = array(['number 1'])
|
176
|
+
a[0,1]['two'] = array(['number 2'])
|
177
|
+
case_table5.append(
|
178
|
+
{'name': 'structarr',
|
179
|
+
'classes': {'teststructarr': 'struct'},
|
180
|
+
'expected': {'teststructarr': a}
|
181
|
+
})
|
182
|
+
ODT = np.dtype([(n, object) for n in
|
183
|
+
['expr', 'inputExpr', 'args',
|
184
|
+
'isEmpty', 'numArgs', 'version']])
|
185
|
+
MO = MatlabObject(np.zeros((1,1), dtype=ODT), 'inline')
|
186
|
+
m0 = MO[0,0]
|
187
|
+
m0['expr'] = array(['x'])
|
188
|
+
m0['inputExpr'] = array([' x = INLINE_INPUTS_{1};'])
|
189
|
+
m0['args'] = array(['x'])
|
190
|
+
m0['isEmpty'] = mlarr(0)
|
191
|
+
m0['numArgs'] = mlarr(1)
|
192
|
+
m0['version'] = mlarr(1)
|
193
|
+
case_table5.append(
|
194
|
+
{'name': 'object',
|
195
|
+
'classes': {'testobject': 'object'},
|
196
|
+
'expected': {'testobject': MO}
|
197
|
+
})
|
198
|
+
fp_u_str = open(pjoin(test_data_path, 'japanese_utf8.txt'), 'rb')
|
199
|
+
u_str = fp_u_str.read().decode('utf-8')
|
200
|
+
fp_u_str.close()
|
201
|
+
case_table5.append(
|
202
|
+
{'name': 'unicode',
|
203
|
+
'classes': {'testunicode': 'char'},
|
204
|
+
'expected': {'testunicode': array([u_str])}
|
205
|
+
})
|
206
|
+
case_table5.append(
|
207
|
+
{'name': 'sparse',
|
208
|
+
'classes': {'testsparse': 'sparse'},
|
209
|
+
'expected': {'testsparse': coo_array(A)},
|
210
|
+
})
|
211
|
+
case_table5.append(
|
212
|
+
{'name': 'sparsecomplex',
|
213
|
+
'classes': {'testsparsecomplex': 'sparse'},
|
214
|
+
'expected': {'testsparsecomplex': coo_array(B)},
|
215
|
+
})
|
216
|
+
case_table5.append(
|
217
|
+
{'name': 'bool',
|
218
|
+
'classes': {'testbools': 'logical'},
|
219
|
+
'expected': {'testbools':
|
220
|
+
array([[True], [False]])},
|
221
|
+
})
|
222
|
+
|
223
|
+
case_table5_rt = case_table5[:]
|
224
|
+
# Inline functions can't be concatenated in matlab, so RT only
|
225
|
+
case_table5_rt.append(
|
226
|
+
{'name': 'objectarray',
|
227
|
+
'classes': {'testobjectarray': 'object'},
|
228
|
+
'expected': {'testobjectarray': np.repeat(MO, 2).reshape(1,2)}})
|
229
|
+
|
230
|
+
|
231
|
+
def types_compatible(var1, var2):
|
232
|
+
"""Check if types are same or compatible.
|
233
|
+
|
234
|
+
0-D numpy scalars are compatible with bare python scalars.
|
235
|
+
"""
|
236
|
+
type1 = type(var1)
|
237
|
+
type2 = type(var2)
|
238
|
+
if type1 is type2:
|
239
|
+
return True
|
240
|
+
if type1 is np.ndarray and var1.shape == ():
|
241
|
+
return type(var1.item()) is type2
|
242
|
+
if type2 is np.ndarray and var2.shape == ():
|
243
|
+
return type(var2.item()) is type1
|
244
|
+
return False
|
245
|
+
|
246
|
+
|
247
|
+
def _check_level(label, expected, actual):
|
248
|
+
""" Check one level of a potentially nested array """
|
249
|
+
if issparse(expected): # allow different types of sparse matrices
|
250
|
+
assert_(issparse(actual))
|
251
|
+
assert_array_almost_equal(actual.toarray(),
|
252
|
+
expected.toarray(),
|
253
|
+
err_msg=label,
|
254
|
+
decimal=5)
|
255
|
+
return
|
256
|
+
# Check types are as expected
|
257
|
+
assert_(types_compatible(expected, actual),
|
258
|
+
f"Expected type {type(expected)}, got {type(actual)} at {label}")
|
259
|
+
# A field in a record array may not be an ndarray
|
260
|
+
# A scalar from a record array will be type np.void
|
261
|
+
if not isinstance(expected, np.void | np.ndarray | MatlabObject):
|
262
|
+
assert_equal(expected, actual)
|
263
|
+
return
|
264
|
+
# This is an ndarray-like thing
|
265
|
+
assert_(expected.shape == actual.shape,
|
266
|
+
msg=f'Expected shape {expected.shape}, got {actual.shape} at {label}')
|
267
|
+
ex_dtype = expected.dtype
|
268
|
+
if ex_dtype.hasobject: # array of objects
|
269
|
+
if isinstance(expected, MatlabObject):
|
270
|
+
assert_equal(expected.classname, actual.classname)
|
271
|
+
for i, ev in enumerate(expected):
|
272
|
+
level_label = f"{label}, [{i}], "
|
273
|
+
_check_level(level_label, ev, actual[i])
|
274
|
+
return
|
275
|
+
if ex_dtype.fields: # probably recarray
|
276
|
+
for fn in ex_dtype.fields:
|
277
|
+
level_label = f"{label}, field {fn}, "
|
278
|
+
_check_level(level_label,
|
279
|
+
expected[fn], actual[fn])
|
280
|
+
return
|
281
|
+
if ex_dtype.type in (str, # string or bool
|
282
|
+
np.str_,
|
283
|
+
np.bool_):
|
284
|
+
assert_equal(actual, expected, err_msg=label)
|
285
|
+
return
|
286
|
+
# Something numeric
|
287
|
+
assert_array_almost_equal(actual, expected, err_msg=label, decimal=5)
|
288
|
+
|
289
|
+
|
290
|
+
def _load_check_case(name, files, case):
|
291
|
+
for file_name in files:
|
292
|
+
matdict = loadmat(file_name, struct_as_record=True, spmatrix=False)
|
293
|
+
label = f"test {name}; file {file_name}"
|
294
|
+
for k, expected in case.items():
|
295
|
+
k_label = f"{label}, variable {k}"
|
296
|
+
assert_(k in matdict, f"Missing key at {k_label}")
|
297
|
+
_check_level(k_label, expected, matdict[k])
|
298
|
+
|
299
|
+
|
300
|
+
def _whos_check_case(name, files, case, classes):
|
301
|
+
for file_name in files:
|
302
|
+
label = f"test {name}; file {file_name}"
|
303
|
+
|
304
|
+
whos = whosmat(file_name)
|
305
|
+
|
306
|
+
expected_whos = [
|
307
|
+
(k, expected.shape, classes[k]) for k, expected in case.items()]
|
308
|
+
|
309
|
+
whos.sort()
|
310
|
+
expected_whos.sort()
|
311
|
+
assert_equal(whos, expected_whos,
|
312
|
+
f"{label}: {whos!r} != {expected_whos!r}"
|
313
|
+
)
|
314
|
+
|
315
|
+
|
316
|
+
# Round trip tests
|
317
|
+
def _rt_check_case(name, expected, format):
|
318
|
+
mat_stream = BytesIO()
|
319
|
+
savemat(mat_stream, expected, format=format)
|
320
|
+
mat_stream.seek(0)
|
321
|
+
_load_check_case(name, [mat_stream], expected)
|
322
|
+
|
323
|
+
|
324
|
+
# generator for tests
|
325
|
+
def _cases(version, filt='test%(name)s_*.mat'):
|
326
|
+
if version == '4':
|
327
|
+
cases = case_table4
|
328
|
+
elif version == '5':
|
329
|
+
cases = case_table5
|
330
|
+
else:
|
331
|
+
assert version == '5_rt'
|
332
|
+
cases = case_table5_rt
|
333
|
+
for case in cases:
|
334
|
+
name = case['name']
|
335
|
+
expected = case['expected']
|
336
|
+
if filt is None:
|
337
|
+
files = None
|
338
|
+
else:
|
339
|
+
use_filt = pjoin(test_data_path, filt % dict(name=name))
|
340
|
+
files = glob(use_filt)
|
341
|
+
assert len(files) > 0, \
|
342
|
+
f"No files for test {name} using filter {filt}"
|
343
|
+
classes = case['classes']
|
344
|
+
yield name, files, expected, classes
|
345
|
+
|
346
|
+
|
347
|
+
@pytest.mark.parametrize('version', ('4', '5'))
|
348
|
+
def test_load(version):
|
349
|
+
for case in _cases(version):
|
350
|
+
_load_check_case(*case[:3])
|
351
|
+
|
352
|
+
|
353
|
+
@pytest.mark.parametrize('version', ('4', '5'))
|
354
|
+
def test_whos(version):
|
355
|
+
for case in _cases(version):
|
356
|
+
_whos_check_case(*case)
|
357
|
+
|
358
|
+
|
359
|
+
# generator for round trip tests
|
360
|
+
@pytest.mark.parametrize('version, fmts', [
|
361
|
+
('4', ['4', '5']),
|
362
|
+
('5_rt', ['5']),
|
363
|
+
])
|
364
|
+
def test_round_trip(version, fmts):
|
365
|
+
for case in _cases(version, filt=None):
|
366
|
+
for fmt in fmts:
|
367
|
+
_rt_check_case(case[0], case[2], fmt)
|
368
|
+
|
369
|
+
|
370
|
+
def test_gzip_simple():
|
371
|
+
xdense = np.zeros((20,20))
|
372
|
+
xdense[2,3] = 2.3
|
373
|
+
xdense[4,5] = 4.5
|
374
|
+
x = csc_array(xdense)
|
375
|
+
|
376
|
+
name = 'gzip_test'
|
377
|
+
expected = {'x':x}
|
378
|
+
format = '4'
|
379
|
+
|
380
|
+
tmpdir = mkdtemp()
|
381
|
+
try:
|
382
|
+
fname = pjoin(tmpdir,name)
|
383
|
+
mat_stream = gzip.open(fname, mode='wb')
|
384
|
+
savemat(mat_stream, expected, format=format)
|
385
|
+
mat_stream.close()
|
386
|
+
|
387
|
+
mat_stream = gzip.open(fname, mode='rb')
|
388
|
+
actual = loadmat(mat_stream, struct_as_record=True, spmatrix=False)
|
389
|
+
mat_stream.close()
|
390
|
+
finally:
|
391
|
+
shutil.rmtree(tmpdir)
|
392
|
+
|
393
|
+
assert_array_almost_equal(actual['x'].toarray(),
|
394
|
+
expected['x'].toarray(),
|
395
|
+
err_msg=repr(actual))
|
396
|
+
|
397
|
+
|
398
|
+
def test_multiple_open():
|
399
|
+
# Ticket #1039, on Windows: check that files are not left open
|
400
|
+
tmpdir = mkdtemp()
|
401
|
+
try:
|
402
|
+
x = dict(x=np.zeros((2, 2)))
|
403
|
+
|
404
|
+
fname = pjoin(tmpdir, "a.mat")
|
405
|
+
|
406
|
+
# Check that file is not left open
|
407
|
+
savemat(fname, x)
|
408
|
+
os.unlink(fname)
|
409
|
+
savemat(fname, x)
|
410
|
+
loadmat(fname)
|
411
|
+
os.unlink(fname)
|
412
|
+
|
413
|
+
# Check that stream is left open
|
414
|
+
f = open(fname, 'wb')
|
415
|
+
savemat(f, x)
|
416
|
+
f.seek(0)
|
417
|
+
f.close()
|
418
|
+
|
419
|
+
f = open(fname, 'rb')
|
420
|
+
loadmat(f)
|
421
|
+
f.seek(0)
|
422
|
+
f.close()
|
423
|
+
finally:
|
424
|
+
shutil.rmtree(tmpdir)
|
425
|
+
|
426
|
+
|
427
|
+
def test_mat73():
|
428
|
+
# Check any hdf5 files raise an error
|
429
|
+
filenames = glob(
|
430
|
+
pjoin(test_data_path, 'testhdf5*.mat'))
|
431
|
+
assert_(len(filenames) > 0)
|
432
|
+
for filename in filenames:
|
433
|
+
fp = open(filename, 'rb')
|
434
|
+
assert_raises(NotImplementedError,
|
435
|
+
loadmat,
|
436
|
+
fp,
|
437
|
+
struct_as_record=True)
|
438
|
+
fp.close()
|
439
|
+
|
440
|
+
|
441
|
+
def test_warnings():
|
442
|
+
# This test is an echo of the previous behavior, which was to raise a
|
443
|
+
# warning if the user triggered a search for mat files on the Python system
|
444
|
+
# path. We can remove the test in the next version after upcoming (0.13).
|
445
|
+
fname = pjoin(test_data_path, 'testdouble_7.1_GLNX86.mat')
|
446
|
+
with warnings.catch_warnings():
|
447
|
+
warnings.simplefilter('error')
|
448
|
+
# This should not generate a warning
|
449
|
+
loadmat(fname, struct_as_record=True)
|
450
|
+
# This neither
|
451
|
+
loadmat(fname, struct_as_record=False)
|
452
|
+
|
453
|
+
|
454
|
+
def test_regression_653():
|
455
|
+
# Saving a dictionary with only invalid keys used to raise an error. Now we
|
456
|
+
# save this as an empty struct in matlab space.
|
457
|
+
sio = BytesIO()
|
458
|
+
savemat(sio, {'d':{1:2}}, format='5')
|
459
|
+
back = loadmat(sio)['d']
|
460
|
+
# Check we got an empty struct equivalent
|
461
|
+
assert_equal(back.shape, (1,1))
|
462
|
+
assert_equal(back.dtype, np.dtype(object))
|
463
|
+
assert_(back[0,0] is None)
|
464
|
+
|
465
|
+
|
466
|
+
def test_structname_len():
|
467
|
+
# Test limit for length of field names in structs
|
468
|
+
lim = 31
|
469
|
+
fldname = 'a' * lim
|
470
|
+
st1 = np.zeros((1,1), dtype=[(fldname, object)])
|
471
|
+
savemat(BytesIO(), {'longstruct': st1}, format='5')
|
472
|
+
fldname = 'a' * (lim+1)
|
473
|
+
st1 = np.zeros((1,1), dtype=[(fldname, object)])
|
474
|
+
assert_raises(ValueError, savemat, BytesIO(),
|
475
|
+
{'longstruct': st1}, format='5')
|
476
|
+
|
477
|
+
|
478
|
+
def test_4_and_long_field_names_incompatible():
|
479
|
+
# Long field names option not supported in 4
|
480
|
+
my_struct = np.zeros((1,1),dtype=[('my_fieldname',object)])
|
481
|
+
assert_raises(ValueError, savemat, BytesIO(),
|
482
|
+
{'my_struct':my_struct}, format='4', long_field_names=True)
|
483
|
+
|
484
|
+
|
485
|
+
def test_long_field_names():
|
486
|
+
# Test limit for length of field names in structs
|
487
|
+
lim = 63
|
488
|
+
fldname = 'a' * lim
|
489
|
+
st1 = np.zeros((1,1), dtype=[(fldname, object)])
|
490
|
+
savemat(BytesIO(), {'longstruct': st1}, format='5',long_field_names=True)
|
491
|
+
fldname = 'a' * (lim+1)
|
492
|
+
st1 = np.zeros((1,1), dtype=[(fldname, object)])
|
493
|
+
assert_raises(ValueError, savemat, BytesIO(),
|
494
|
+
{'longstruct': st1}, format='5',long_field_names=True)
|
495
|
+
|
496
|
+
|
497
|
+
def test_long_field_names_in_struct():
|
498
|
+
# Regression test - long_field_names was erased if you passed a struct
|
499
|
+
# within a struct
|
500
|
+
lim = 63
|
501
|
+
fldname = 'a' * lim
|
502
|
+
cell = np.ndarray((1,2),dtype=object)
|
503
|
+
st1 = np.zeros((1,1), dtype=[(fldname, object)])
|
504
|
+
cell[0,0] = st1
|
505
|
+
cell[0,1] = st1
|
506
|
+
savemat(BytesIO(), {'longstruct': cell}, format='5',long_field_names=True)
|
507
|
+
#
|
508
|
+
# Check to make sure it fails with long field names off
|
509
|
+
#
|
510
|
+
assert_raises(ValueError, savemat, BytesIO(),
|
511
|
+
{'longstruct': cell}, format='5', long_field_names=False)
|
512
|
+
|
513
|
+
|
514
|
+
def test_cell_with_one_thing_in_it():
|
515
|
+
# Regression test - make a cell array that's 1 x 2 and put two
|
516
|
+
# strings in it. It works. Make a cell array that's 1 x 1 and put
|
517
|
+
# a string in it. It should work but, in the old days, it didn't.
|
518
|
+
cells = np.ndarray((1,2),dtype=object)
|
519
|
+
cells[0,0] = 'Hello'
|
520
|
+
cells[0,1] = 'World'
|
521
|
+
savemat(BytesIO(), {'x': cells}, format='5')
|
522
|
+
|
523
|
+
cells = np.ndarray((1,1),dtype=object)
|
524
|
+
cells[0,0] = 'Hello, world'
|
525
|
+
savemat(BytesIO(), {'x': cells}, format='5')
|
526
|
+
|
527
|
+
|
528
|
+
def test_writer_properties():
|
529
|
+
# Tests getting, setting of properties of matrix writer
|
530
|
+
mfw = MatFile5Writer(BytesIO())
|
531
|
+
assert_equal(mfw.global_vars, [])
|
532
|
+
mfw.global_vars = ['avar']
|
533
|
+
assert_equal(mfw.global_vars, ['avar'])
|
534
|
+
assert_equal(mfw.unicode_strings, False)
|
535
|
+
mfw.unicode_strings = True
|
536
|
+
assert_equal(mfw.unicode_strings, True)
|
537
|
+
assert_equal(mfw.long_field_names, False)
|
538
|
+
mfw.long_field_names = True
|
539
|
+
assert_equal(mfw.long_field_names, True)
|
540
|
+
|
541
|
+
|
542
|
+
def test_use_small_element():
|
543
|
+
# Test whether we're using small data element or not
|
544
|
+
sio = BytesIO()
|
545
|
+
wtr = MatFile5Writer(sio)
|
546
|
+
# First check size for no sde for name
|
547
|
+
arr = np.zeros(10)
|
548
|
+
wtr.put_variables({'aaaaa': arr})
|
549
|
+
w_sz = len(sio.getvalue())
|
550
|
+
# Check small name results in largish difference in size
|
551
|
+
sio.truncate(0)
|
552
|
+
sio.seek(0)
|
553
|
+
wtr.put_variables({'aaaa': arr})
|
554
|
+
assert_(w_sz - len(sio.getvalue()) > 4)
|
555
|
+
# Whereas increasing name size makes less difference
|
556
|
+
sio.truncate(0)
|
557
|
+
sio.seek(0)
|
558
|
+
wtr.put_variables({'aaaaaa': arr})
|
559
|
+
assert_(len(sio.getvalue()) - w_sz < 4)
|
560
|
+
|
561
|
+
|
562
|
+
def test_save_dict():
|
563
|
+
# Test that both dict and OrderedDict can be saved (as recarray),
|
564
|
+
# loaded as matstruct, and preserve order
|
565
|
+
ab_exp = np.array([[(1, 2)]], dtype=[('a', object), ('b', object)])
|
566
|
+
for dict_type in (dict, OrderedDict):
|
567
|
+
# Initialize with tuples to keep order
|
568
|
+
d = dict_type([('a', 1), ('b', 2)])
|
569
|
+
stream = BytesIO()
|
570
|
+
savemat(stream, {'dict': d})
|
571
|
+
stream.seek(0)
|
572
|
+
vals = loadmat(stream)['dict']
|
573
|
+
assert_equal(vals.dtype.names, ('a', 'b'))
|
574
|
+
assert_array_equal(vals, ab_exp)
|
575
|
+
|
576
|
+
|
577
|
+
def test_1d_shape():
|
578
|
+
# New 5 behavior is 1D -> row vector
|
579
|
+
arr = np.arange(5)
|
580
|
+
for format in ('4', '5'):
|
581
|
+
# Column is the default
|
582
|
+
stream = BytesIO()
|
583
|
+
savemat(stream, {'oned': arr}, format=format)
|
584
|
+
vals = loadmat(stream)
|
585
|
+
assert_equal(vals['oned'].shape, (1, 5))
|
586
|
+
# can be explicitly 'column' for oned_as
|
587
|
+
stream = BytesIO()
|
588
|
+
savemat(stream, {'oned':arr},
|
589
|
+
format=format,
|
590
|
+
oned_as='column')
|
591
|
+
vals = loadmat(stream)
|
592
|
+
assert_equal(vals['oned'].shape, (5,1))
|
593
|
+
# but different from 'row'
|
594
|
+
stream = BytesIO()
|
595
|
+
savemat(stream, {'oned':arr},
|
596
|
+
format=format,
|
597
|
+
oned_as='row')
|
598
|
+
vals = loadmat(stream)
|
599
|
+
assert_equal(vals['oned'].shape, (1,5))
|
600
|
+
|
601
|
+
|
602
|
+
def test_compression():
|
603
|
+
arr = np.zeros(100).reshape((5,20))
|
604
|
+
arr[2,10] = 1
|
605
|
+
stream = BytesIO()
|
606
|
+
savemat(stream, {'arr':arr})
|
607
|
+
raw_len = len(stream.getvalue())
|
608
|
+
vals = loadmat(stream)
|
609
|
+
assert_array_equal(vals['arr'], arr)
|
610
|
+
stream = BytesIO()
|
611
|
+
savemat(stream, {'arr':arr}, do_compression=True)
|
612
|
+
compressed_len = len(stream.getvalue())
|
613
|
+
vals = loadmat(stream)
|
614
|
+
assert_array_equal(vals['arr'], arr)
|
615
|
+
assert_(raw_len > compressed_len)
|
616
|
+
# Concatenate, test later
|
617
|
+
arr2 = arr.copy()
|
618
|
+
arr2[0,0] = 1
|
619
|
+
stream = BytesIO()
|
620
|
+
savemat(stream, {'arr':arr, 'arr2':arr2}, do_compression=False)
|
621
|
+
vals = loadmat(stream)
|
622
|
+
assert_array_equal(vals['arr2'], arr2)
|
623
|
+
stream = BytesIO()
|
624
|
+
savemat(stream, {'arr':arr, 'arr2':arr2}, do_compression=True)
|
625
|
+
vals = loadmat(stream)
|
626
|
+
assert_array_equal(vals['arr2'], arr2)
|
627
|
+
|
628
|
+
|
629
|
+
def test_single_object():
|
630
|
+
stream = BytesIO()
|
631
|
+
savemat(stream, {'A':np.array(1, dtype=object)})
|
632
|
+
|
633
|
+
|
634
|
+
def test_skip_variable():
|
635
|
+
# Test skipping over the first of two variables in a MAT file
|
636
|
+
# using mat_reader_factory and put_variables to read them in.
|
637
|
+
#
|
638
|
+
# This is a regression test of a problem that's caused by
|
639
|
+
# using the compressed file reader seek instead of the raw file
|
640
|
+
# I/O seek when skipping over a compressed chunk.
|
641
|
+
#
|
642
|
+
# The problem arises when the chunk is large: this file has
|
643
|
+
# a 256x256 array of random (uncompressible) doubles.
|
644
|
+
#
|
645
|
+
filename = pjoin(test_data_path,'test_skip_variable.mat')
|
646
|
+
#
|
647
|
+
# Prove that it loads with loadmat
|
648
|
+
#
|
649
|
+
d = loadmat(filename, struct_as_record=True)
|
650
|
+
assert_('first' in d)
|
651
|
+
assert_('second' in d)
|
652
|
+
#
|
653
|
+
# Make the factory
|
654
|
+
#
|
655
|
+
factory, file_opened = mat_reader_factory(filename, struct_as_record=True)
|
656
|
+
#
|
657
|
+
# This is where the factory breaks with an error in MatMatrixGetter.to_next
|
658
|
+
#
|
659
|
+
d = factory.get_variables('second')
|
660
|
+
assert_('second' in d)
|
661
|
+
factory.mat_stream.close()
|
662
|
+
|
663
|
+
|
664
|
+
def test_empty_struct():
|
665
|
+
# ticket 885
|
666
|
+
filename = pjoin(test_data_path,'test_empty_struct.mat')
|
667
|
+
# before ticket fix, this would crash with ValueError, empty data
|
668
|
+
# type
|
669
|
+
d = loadmat(filename, struct_as_record=True)
|
670
|
+
a = d['a']
|
671
|
+
assert_equal(a.shape, (1,1))
|
672
|
+
assert_equal(a.dtype, np.dtype(object))
|
673
|
+
assert_(a[0,0] is None)
|
674
|
+
stream = BytesIO()
|
675
|
+
arr = np.array((), dtype='U')
|
676
|
+
# before ticket fix, this used to give data type not understood
|
677
|
+
savemat(stream, {'arr':arr})
|
678
|
+
d = loadmat(stream)
|
679
|
+
a2 = d['arr']
|
680
|
+
assert_array_equal(a2, arr)
|
681
|
+
|
682
|
+
|
683
|
+
def test_save_empty_dict():
|
684
|
+
# saving empty dict also gives empty struct
|
685
|
+
stream = BytesIO()
|
686
|
+
savemat(stream, {'arr': {}})
|
687
|
+
d = loadmat(stream)
|
688
|
+
a = d['arr']
|
689
|
+
assert_equal(a.shape, (1,1))
|
690
|
+
assert_equal(a.dtype, np.dtype(object))
|
691
|
+
assert_(a[0,0] is None)
|
692
|
+
|
693
|
+
|
694
|
+
def assert_any_equal(output, alternatives):
|
695
|
+
""" Assert `output` is equal to at least one element in `alternatives`
|
696
|
+
"""
|
697
|
+
one_equal = False
|
698
|
+
for expected in alternatives:
|
699
|
+
if np.all(output == expected):
|
700
|
+
one_equal = True
|
701
|
+
break
|
702
|
+
assert_(one_equal)
|
703
|
+
|
704
|
+
|
705
|
+
def test_to_writeable():
|
706
|
+
# Test to_writeable function
|
707
|
+
res = to_writeable(np.array([1])) # pass through ndarrays
|
708
|
+
assert_equal(res.shape, (1,))
|
709
|
+
assert_array_equal(res, 1)
|
710
|
+
# Dict fields can be written in any order
|
711
|
+
expected1 = np.array([(1, 2)], dtype=[('a', '|O8'), ('b', '|O8')])
|
712
|
+
expected2 = np.array([(2, 1)], dtype=[('b', '|O8'), ('a', '|O8')])
|
713
|
+
alternatives = (expected1, expected2)
|
714
|
+
assert_any_equal(to_writeable({'a':1,'b':2}), alternatives)
|
715
|
+
# Fields with underscores discarded with a warning message.
|
716
|
+
with pytest.warns(MatWriteWarning, match='Starting field name with'):
|
717
|
+
assert_any_equal(to_writeable({'a':1, 'b':2, '_c':3}), alternatives)
|
718
|
+
# Not-string fields discarded
|
719
|
+
assert_any_equal(to_writeable({'a':1,'b':2, 100:3}), alternatives)
|
720
|
+
# String fields that are valid Python identifiers discarded
|
721
|
+
with pytest.warns(MatWriteWarning, match='Starting field name with'):
|
722
|
+
assert_any_equal(to_writeable({'a':1, 'b':2, '99':3}), alternatives)
|
723
|
+
# Object with field names is equivalent
|
724
|
+
|
725
|
+
class klass:
|
726
|
+
pass
|
727
|
+
|
728
|
+
c = klass
|
729
|
+
c.a = 1
|
730
|
+
c.b = 2
|
731
|
+
assert_any_equal(to_writeable(c), alternatives)
|
732
|
+
# empty list and tuple go to empty array
|
733
|
+
res = to_writeable([])
|
734
|
+
assert_equal(res.shape, (0,))
|
735
|
+
assert_equal(res.dtype.type, np.float64)
|
736
|
+
res = to_writeable(())
|
737
|
+
assert_equal(res.shape, (0,))
|
738
|
+
assert_equal(res.dtype.type, np.float64)
|
739
|
+
# None -> None
|
740
|
+
assert_(to_writeable(None) is None)
|
741
|
+
# String to strings
|
742
|
+
assert_equal(to_writeable('a string').dtype.type, np.str_)
|
743
|
+
# Scalars to numpy to NumPy scalars
|
744
|
+
res = to_writeable(1)
|
745
|
+
assert_equal(res.shape, ())
|
746
|
+
assert_equal(res.dtype.type, np.array(1).dtype.type)
|
747
|
+
assert_array_equal(res, 1)
|
748
|
+
# Empty dict returns EmptyStructMarker
|
749
|
+
assert_(to_writeable({}) is EmptyStructMarker)
|
750
|
+
# Object does not have (even empty) __dict__
|
751
|
+
assert_(to_writeable(object()) is None)
|
752
|
+
# Custom object does have empty __dict__, returns EmptyStructMarker
|
753
|
+
|
754
|
+
class C:
|
755
|
+
pass
|
756
|
+
|
757
|
+
assert_(to_writeable(c()) is EmptyStructMarker)
|
758
|
+
# dict keys with legal characters are convertible
|
759
|
+
res = to_writeable({'a': 1})['a']
|
760
|
+
assert_equal(res.shape, (1,))
|
761
|
+
assert_equal(res.dtype.type, np.object_)
|
762
|
+
# Only fields with illegal characters, falls back to EmptyStruct
|
763
|
+
with pytest.warns(MatWriteWarning, match='Starting field name with'):
|
764
|
+
assert_(to_writeable({'1':1}) is EmptyStructMarker)
|
765
|
+
|
766
|
+
with pytest.warns(MatWriteWarning, match='Starting field name with'):
|
767
|
+
assert_(to_writeable({'_a':1}) is EmptyStructMarker)
|
768
|
+
# Unless there are valid fields, in which case structured array
|
769
|
+
with pytest.warns(MatWriteWarning, match='Starting field name with'):
|
770
|
+
assert_equal(to_writeable({'1':1, 'f': 2}),
|
771
|
+
np.array([(2,)], dtype=[('f', '|O8')]))
|
772
|
+
|
773
|
+
|
774
|
+
def test_recarray():
|
775
|
+
# check roundtrip of structured array
|
776
|
+
dt = [('f1', 'f8'),
|
777
|
+
('f2', 'S10')]
|
778
|
+
arr = np.zeros((2,), dtype=dt)
|
779
|
+
arr[0]['f1'] = 0.5
|
780
|
+
arr[0]['f2'] = 'python'
|
781
|
+
arr[1]['f1'] = 99
|
782
|
+
arr[1]['f2'] = 'not perl'
|
783
|
+
stream = BytesIO()
|
784
|
+
savemat(stream, {'arr': arr})
|
785
|
+
d = loadmat(stream, struct_as_record=False)
|
786
|
+
a20 = d['arr'][0,0]
|
787
|
+
assert_equal(a20.f1, 0.5)
|
788
|
+
assert_equal(a20.f2, 'python')
|
789
|
+
d = loadmat(stream, struct_as_record=True)
|
790
|
+
a20 = d['arr'][0,0]
|
791
|
+
assert_equal(a20['f1'], 0.5)
|
792
|
+
assert_equal(a20['f2'], 'python')
|
793
|
+
# structs always come back as object types
|
794
|
+
assert_equal(a20.dtype, np.dtype([('f1', 'O'),
|
795
|
+
('f2', 'O')]))
|
796
|
+
a21 = d['arr'].flat[1]
|
797
|
+
assert_equal(a21['f1'], 99)
|
798
|
+
assert_equal(a21['f2'], 'not perl')
|
799
|
+
|
800
|
+
|
801
|
+
def test_save_object():
|
802
|
+
class C:
|
803
|
+
pass
|
804
|
+
c = C()
|
805
|
+
c.field1 = 1
|
806
|
+
c.field2 = 'a string'
|
807
|
+
stream = BytesIO()
|
808
|
+
savemat(stream, {'c': c})
|
809
|
+
d = loadmat(stream, struct_as_record=False)
|
810
|
+
c2 = d['c'][0,0]
|
811
|
+
assert_equal(c2.field1, 1)
|
812
|
+
assert_equal(c2.field2, 'a string')
|
813
|
+
d = loadmat(stream, struct_as_record=True)
|
814
|
+
c2 = d['c'][0,0]
|
815
|
+
assert_equal(c2['field1'], 1)
|
816
|
+
assert_equal(c2['field2'], 'a string')
|
817
|
+
|
818
|
+
|
819
|
+
def test_read_opts():
|
820
|
+
# tests if read is seeing option sets, at initialization and after
|
821
|
+
# initialization
|
822
|
+
arr = np.arange(6).reshape(1,6)
|
823
|
+
stream = BytesIO()
|
824
|
+
savemat(stream, {'a': arr})
|
825
|
+
rdr = MatFile5Reader(stream)
|
826
|
+
back_dict = rdr.get_variables()
|
827
|
+
rarr = back_dict['a']
|
828
|
+
assert_array_equal(rarr, arr)
|
829
|
+
rdr = MatFile5Reader(stream, squeeze_me=True)
|
830
|
+
assert_array_equal(rdr.get_variables()['a'], arr.reshape((6,)))
|
831
|
+
rdr.squeeze_me = False
|
832
|
+
assert_array_equal(rarr, arr)
|
833
|
+
rdr = MatFile5Reader(stream, byte_order=boc.native_code)
|
834
|
+
assert_array_equal(rdr.get_variables()['a'], arr)
|
835
|
+
# inverted byte code leads to error on read because of swapped
|
836
|
+
# header etc.
|
837
|
+
rdr = MatFile5Reader(stream, byte_order=boc.swapped_code)
|
838
|
+
assert_raises(Exception, rdr.get_variables)
|
839
|
+
rdr.byte_order = boc.native_code
|
840
|
+
assert_array_equal(rdr.get_variables()['a'], arr)
|
841
|
+
arr = np.array(['a string'])
|
842
|
+
stream.truncate(0)
|
843
|
+
stream.seek(0)
|
844
|
+
savemat(stream, {'a': arr})
|
845
|
+
rdr = MatFile5Reader(stream)
|
846
|
+
assert_array_equal(rdr.get_variables()['a'], arr)
|
847
|
+
rdr = MatFile5Reader(stream, chars_as_strings=False)
|
848
|
+
carr = np.atleast_2d(np.array(list(arr.item()), dtype='U1'))
|
849
|
+
assert_array_equal(rdr.get_variables()['a'], carr)
|
850
|
+
rdr.chars_as_strings = True
|
851
|
+
assert_array_equal(rdr.get_variables()['a'], arr)
|
852
|
+
|
853
|
+
|
854
|
+
def test_empty_string():
|
855
|
+
# make sure reading empty string does not raise error
|
856
|
+
estring_fname = pjoin(test_data_path, 'single_empty_string.mat')
|
857
|
+
fp = open(estring_fname, 'rb')
|
858
|
+
rdr = MatFile5Reader(fp)
|
859
|
+
d = rdr.get_variables()
|
860
|
+
fp.close()
|
861
|
+
assert_array_equal(d['a'], np.array([], dtype='U1'))
|
862
|
+
# Empty string round trip. Matlab cannot distinguish
|
863
|
+
# between a string array that is empty, and a string array
|
864
|
+
# containing a single empty string, because it stores strings as
|
865
|
+
# arrays of char. There is no way of having an array of char that
|
866
|
+
# is not empty, but contains an empty string.
|
867
|
+
stream = BytesIO()
|
868
|
+
savemat(stream, {'a': np.array([''])})
|
869
|
+
rdr = MatFile5Reader(stream)
|
870
|
+
d = rdr.get_variables()
|
871
|
+
assert_array_equal(d['a'], np.array([], dtype='U1'))
|
872
|
+
stream.truncate(0)
|
873
|
+
stream.seek(0)
|
874
|
+
savemat(stream, {'a': np.array([], dtype='U1')})
|
875
|
+
rdr = MatFile5Reader(stream)
|
876
|
+
d = rdr.get_variables()
|
877
|
+
assert_array_equal(d['a'], np.array([], dtype='U1'))
|
878
|
+
stream.close()
|
879
|
+
|
880
|
+
|
881
|
+
def test_corrupted_data():
|
882
|
+
import zlib
|
883
|
+
for exc, fname in [(ValueError, 'corrupted_zlib_data.mat'),
|
884
|
+
(zlib.error, 'corrupted_zlib_checksum.mat')]:
|
885
|
+
with open(pjoin(test_data_path, fname), 'rb') as fp:
|
886
|
+
rdr = MatFile5Reader(fp)
|
887
|
+
assert_raises(exc, rdr.get_variables)
|
888
|
+
|
889
|
+
|
890
|
+
def test_corrupted_data_check_can_be_disabled():
|
891
|
+
with open(pjoin(test_data_path, 'corrupted_zlib_data.mat'), 'rb') as fp:
|
892
|
+
rdr = MatFile5Reader(fp, verify_compressed_data_integrity=False)
|
893
|
+
rdr.get_variables()
|
894
|
+
|
895
|
+
|
896
|
+
def test_read_both_endian():
|
897
|
+
# make sure big- and little- endian data is read correctly
|
898
|
+
for fname in ('big_endian.mat', 'little_endian.mat'):
|
899
|
+
fp = open(pjoin(test_data_path, fname), 'rb')
|
900
|
+
rdr = MatFile5Reader(fp)
|
901
|
+
d = rdr.get_variables()
|
902
|
+
fp.close()
|
903
|
+
assert_array_equal(d['strings'],
|
904
|
+
np.array([['hello'],
|
905
|
+
['world']], dtype=object))
|
906
|
+
assert_array_equal(d['floats'],
|
907
|
+
np.array([[2., 3.],
|
908
|
+
[3., 4.]], dtype=np.float32))
|
909
|
+
|
910
|
+
|
911
|
+
def test_write_opposite_endian():
|
912
|
+
# We don't support writing opposite endian .mat files, but we need to behave
|
913
|
+
# correctly if the user supplies an other-endian NumPy array to write out.
|
914
|
+
float_arr = np.array([[2., 3.],
|
915
|
+
[3., 4.]])
|
916
|
+
int_arr = np.arange(6).reshape((2, 3))
|
917
|
+
uni_arr = np.array(['hello', 'world'], dtype='U')
|
918
|
+
stream = BytesIO()
|
919
|
+
savemat(stream, {
|
920
|
+
'floats': float_arr.byteswap().view(float_arr.dtype.newbyteorder()),
|
921
|
+
'ints': int_arr.byteswap().view(int_arr.dtype.newbyteorder()),
|
922
|
+
'uni_arr': uni_arr.byteswap().view(uni_arr.dtype.newbyteorder()),
|
923
|
+
})
|
924
|
+
rdr = MatFile5Reader(stream)
|
925
|
+
d = rdr.get_variables()
|
926
|
+
assert_array_equal(d['floats'], float_arr)
|
927
|
+
assert_array_equal(d['ints'], int_arr)
|
928
|
+
assert_array_equal(d['uni_arr'], uni_arr)
|
929
|
+
stream.close()
|
930
|
+
|
931
|
+
|
932
|
+
def test_logical_array():
|
933
|
+
# The roundtrip test doesn't verify that we load the data up with the
|
934
|
+
# correct (bool) dtype
|
935
|
+
with open(pjoin(test_data_path, 'testbool_8_WIN64.mat'), 'rb') as fobj:
|
936
|
+
rdr = MatFile5Reader(fobj, mat_dtype=True)
|
937
|
+
d = rdr.get_variables()
|
938
|
+
x = np.array([[True], [False]], dtype=np.bool_)
|
939
|
+
assert_array_equal(d['testbools'], x)
|
940
|
+
assert_equal(d['testbools'].dtype, x.dtype)
|
941
|
+
|
942
|
+
|
943
|
+
def test_logical_out_type():
|
944
|
+
# Confirm that bool type written as uint8, uint8 class
|
945
|
+
# See gh-4022
|
946
|
+
stream = BytesIO()
|
947
|
+
barr = np.array([False, True, False])
|
948
|
+
savemat(stream, {'barray': barr})
|
949
|
+
stream.seek(0)
|
950
|
+
reader = MatFile5Reader(stream)
|
951
|
+
reader.initialize_read()
|
952
|
+
reader.read_file_header()
|
953
|
+
hdr, _ = reader.read_var_header()
|
954
|
+
assert_equal(hdr.mclass, mio5p.mxUINT8_CLASS)
|
955
|
+
assert_equal(hdr.is_logical, True)
|
956
|
+
var = reader.read_var_array(hdr, False)
|
957
|
+
assert_equal(var.dtype.type, np.uint8)
|
958
|
+
|
959
|
+
|
960
|
+
def test_roundtrip_zero_dimensions():
|
961
|
+
stream = BytesIO()
|
962
|
+
savemat(stream, {'d':np.empty((10, 0))})
|
963
|
+
d = loadmat(stream)
|
964
|
+
assert d['d'].shape == (10, 0)
|
965
|
+
|
966
|
+
|
967
|
+
def test_mat4_3d():
|
968
|
+
# test behavior when writing 3-D arrays to matlab 4 files
|
969
|
+
stream = BytesIO()
|
970
|
+
arr = np.arange(24).reshape((2,3,4))
|
971
|
+
assert_raises(ValueError, savemat, stream, {'a': arr}, True, '4')
|
972
|
+
|
973
|
+
|
974
|
+
def test_func_read():
|
975
|
+
func_eg = pjoin(test_data_path, 'testfunc_7.4_GLNX86.mat')
|
976
|
+
fp = open(func_eg, 'rb')
|
977
|
+
rdr = MatFile5Reader(fp)
|
978
|
+
d = rdr.get_variables()
|
979
|
+
fp.close()
|
980
|
+
assert isinstance(d['testfunc'], MatlabFunction)
|
981
|
+
stream = BytesIO()
|
982
|
+
wtr = MatFile5Writer(stream)
|
983
|
+
# This test mat file has `__header__` field.
|
984
|
+
with pytest.warns(MatWriteWarning, match='Starting field name with'):
|
985
|
+
assert_raises(MatWriteError, wtr.put_variables, d)
|
986
|
+
|
987
|
+
|
988
|
+
def test_mat_dtype():
|
989
|
+
double_eg = pjoin(test_data_path, 'testmatrix_6.1_SOL2.mat')
|
990
|
+
fp = open(double_eg, 'rb')
|
991
|
+
rdr = MatFile5Reader(fp, mat_dtype=False)
|
992
|
+
d = rdr.get_variables()
|
993
|
+
fp.close()
|
994
|
+
assert_equal(d['testmatrix'].dtype.kind, 'u')
|
995
|
+
|
996
|
+
fp = open(double_eg, 'rb')
|
997
|
+
rdr = MatFile5Reader(fp, mat_dtype=True)
|
998
|
+
d = rdr.get_variables()
|
999
|
+
fp.close()
|
1000
|
+
assert_equal(d['testmatrix'].dtype.kind, 'f')
|
1001
|
+
|
1002
|
+
|
1003
|
+
def test_sparse_in_struct():
|
1004
|
+
# reproduces bug found by DC where Cython code was insisting on
|
1005
|
+
# ndarray return type, but getting sparse matrix
|
1006
|
+
st = {'sparsefield': eye_array(4)}
|
1007
|
+
stream = BytesIO()
|
1008
|
+
savemat(stream, {'a':st})
|
1009
|
+
d = loadmat(stream, struct_as_record=True)
|
1010
|
+
assert_array_equal(d['a'][0, 0]['sparsefield'].toarray(), np.eye(4))
|
1011
|
+
|
1012
|
+
|
1013
|
+
def test_mat_struct_squeeze():
|
1014
|
+
stream = BytesIO()
|
1015
|
+
in_d = {'st':{'one':1, 'two':2}}
|
1016
|
+
savemat(stream, in_d)
|
1017
|
+
# no error without squeeze
|
1018
|
+
loadmat(stream, struct_as_record=False)
|
1019
|
+
# previous error was with squeeze, with mat_struct
|
1020
|
+
loadmat(stream, struct_as_record=False, squeeze_me=True)
|
1021
|
+
|
1022
|
+
|
1023
|
+
def test_scalar_squeeze():
|
1024
|
+
stream = BytesIO()
|
1025
|
+
in_d = {'scalar': [[0.1]], 'string': 'my name', 'st':{'one':1, 'two':2}}
|
1026
|
+
savemat(stream, in_d)
|
1027
|
+
out_d = loadmat(stream, squeeze_me=True)
|
1028
|
+
assert_(isinstance(out_d['scalar'], float))
|
1029
|
+
assert_(isinstance(out_d['string'], str))
|
1030
|
+
assert_(isinstance(out_d['st'], np.ndarray))
|
1031
|
+
|
1032
|
+
|
1033
|
+
def test_str_round():
|
1034
|
+
# from report by Angus McMorland on mailing list 3 May 2010
|
1035
|
+
stream = BytesIO()
|
1036
|
+
in_arr = np.array(['Hello', 'Foob'])
|
1037
|
+
out_arr = np.array(['Hello', 'Foob '])
|
1038
|
+
savemat(stream, dict(a=in_arr))
|
1039
|
+
res = loadmat(stream)
|
1040
|
+
# resulted in ['HloolFoa', 'elWrdobr']
|
1041
|
+
assert_array_equal(res['a'], out_arr)
|
1042
|
+
stream.truncate(0)
|
1043
|
+
stream.seek(0)
|
1044
|
+
# Make Fortran ordered version of string
|
1045
|
+
in_str = in_arr.tobytes(order='F')
|
1046
|
+
in_from_str = np.ndarray(shape=a.shape,
|
1047
|
+
dtype=in_arr.dtype,
|
1048
|
+
order='F',
|
1049
|
+
buffer=in_str)
|
1050
|
+
savemat(stream, dict(a=in_from_str))
|
1051
|
+
assert_array_equal(res['a'], out_arr)
|
1052
|
+
# unicode save did lead to buffer too small error
|
1053
|
+
stream.truncate(0)
|
1054
|
+
stream.seek(0)
|
1055
|
+
in_arr_u = in_arr.astype('U')
|
1056
|
+
out_arr_u = out_arr.astype('U')
|
1057
|
+
savemat(stream, {'a': in_arr_u})
|
1058
|
+
res = loadmat(stream)
|
1059
|
+
assert_array_equal(res['a'], out_arr_u)
|
1060
|
+
|
1061
|
+
|
1062
|
+
def test_fieldnames():
|
1063
|
+
# Check that field names are as expected
|
1064
|
+
stream = BytesIO()
|
1065
|
+
savemat(stream, {'a': {'a':1, 'b':2}})
|
1066
|
+
res = loadmat(stream)
|
1067
|
+
field_names = res['a'].dtype.names
|
1068
|
+
assert_equal(set(field_names), {'a', 'b'})
|
1069
|
+
|
1070
|
+
|
1071
|
+
def test_loadmat_varnames():
|
1072
|
+
# Test that we can get just one variable from a mat file using loadmat
|
1073
|
+
mat5_sys_names = ['__globals__',
|
1074
|
+
'__header__',
|
1075
|
+
'__version__']
|
1076
|
+
for eg_file, sys_v_names in (
|
1077
|
+
(pjoin(test_data_path, 'testmulti_4.2c_SOL2.mat'), []), (pjoin(
|
1078
|
+
test_data_path, 'testmulti_7.4_GLNX86.mat'), mat5_sys_names)):
|
1079
|
+
vars = loadmat(eg_file)
|
1080
|
+
assert_equal(set(vars.keys()), set(['a', 'theta'] + sys_v_names))
|
1081
|
+
vars = loadmat(eg_file, variable_names='a')
|
1082
|
+
assert_equal(set(vars.keys()), set(['a'] + sys_v_names))
|
1083
|
+
vars = loadmat(eg_file, variable_names=['a'])
|
1084
|
+
assert_equal(set(vars.keys()), set(['a'] + sys_v_names))
|
1085
|
+
vars = loadmat(eg_file, variable_names=['theta'])
|
1086
|
+
assert_equal(set(vars.keys()), set(['theta'] + sys_v_names))
|
1087
|
+
vars = loadmat(eg_file, variable_names=('theta',))
|
1088
|
+
assert_equal(set(vars.keys()), set(['theta'] + sys_v_names))
|
1089
|
+
vars = loadmat(eg_file, variable_names=[])
|
1090
|
+
assert_equal(set(vars.keys()), set(sys_v_names))
|
1091
|
+
vnames = ['theta']
|
1092
|
+
vars = loadmat(eg_file, variable_names=vnames)
|
1093
|
+
assert_equal(vnames, ['theta'])
|
1094
|
+
|
1095
|
+
|
1096
|
+
def test_round_types():
|
1097
|
+
# Check that saving, loading preserves dtype in most cases
|
1098
|
+
arr = np.arange(10)
|
1099
|
+
stream = BytesIO()
|
1100
|
+
for dts in ('f8','f4','i8','i4','i2','i1',
|
1101
|
+
'u8','u4','u2','u1','c16','c8'):
|
1102
|
+
stream.truncate(0)
|
1103
|
+
stream.seek(0) # needed for BytesIO in Python 3
|
1104
|
+
savemat(stream, {'arr': arr.astype(dts)})
|
1105
|
+
vars = loadmat(stream)
|
1106
|
+
assert_equal(np.dtype(dts), vars['arr'].dtype)
|
1107
|
+
|
1108
|
+
|
1109
|
+
def test_varmats_from_mat():
|
1110
|
+
# Make a mat file with several variables, write it, read it back
|
1111
|
+
names_vars = (('arr', mlarr(np.arange(10))),
|
1112
|
+
('mystr', mlarr('a string')),
|
1113
|
+
('mynum', mlarr(10)))
|
1114
|
+
|
1115
|
+
# Dict like thing to give variables in defined order
|
1116
|
+
class C:
|
1117
|
+
def items(self):
|
1118
|
+
return names_vars
|
1119
|
+
stream = BytesIO()
|
1120
|
+
savemat(stream, C())
|
1121
|
+
varmats = varmats_from_mat(stream)
|
1122
|
+
assert_equal(len(varmats), 3)
|
1123
|
+
for i in range(3):
|
1124
|
+
name, var_stream = varmats[i]
|
1125
|
+
exp_name, exp_res = names_vars[i]
|
1126
|
+
assert_equal(name, exp_name)
|
1127
|
+
res = loadmat(var_stream)
|
1128
|
+
assert_array_equal(res[name], exp_res)
|
1129
|
+
|
1130
|
+
|
1131
|
+
def test_one_by_zero():
|
1132
|
+
# Test 1x0 chars get read correctly
|
1133
|
+
func_eg = pjoin(test_data_path, 'one_by_zero_char.mat')
|
1134
|
+
fp = open(func_eg, 'rb')
|
1135
|
+
rdr = MatFile5Reader(fp)
|
1136
|
+
d = rdr.get_variables()
|
1137
|
+
fp.close()
|
1138
|
+
assert_equal(d['var'].shape, (0,))
|
1139
|
+
|
1140
|
+
|
1141
|
+
def test_load_mat4_le():
|
1142
|
+
# We were getting byte order wrong when reading little-endian floa64 dense
|
1143
|
+
# matrices on big-endian platforms
|
1144
|
+
mat4_fname = pjoin(test_data_path, 'test_mat4_le_floats.mat')
|
1145
|
+
vars = loadmat(mat4_fname)
|
1146
|
+
assert_array_equal(vars['a'], [[0.1, 1.2]])
|
1147
|
+
|
1148
|
+
|
1149
|
+
def test_unicode_mat4():
|
1150
|
+
# Mat4 should save unicode as latin1
|
1151
|
+
bio = BytesIO()
|
1152
|
+
var = {'second_cat': 'Schrödinger'}
|
1153
|
+
savemat(bio, var, format='4')
|
1154
|
+
var_back = loadmat(bio)
|
1155
|
+
assert_equal(var_back['second_cat'], var['second_cat'])
|
1156
|
+
|
1157
|
+
|
1158
|
+
def test_logical_sparse():
|
1159
|
+
# Test we can read logical sparse stored in mat file as bytes.
|
1160
|
+
# See https://github.com/scipy/scipy/issues/3539.
|
1161
|
+
# In some files saved by MATLAB, the sparse data elements (Real Part
|
1162
|
+
# Subelement in MATLAB speak) are stored with apparent type double
|
1163
|
+
# (miDOUBLE) but are in fact single bytes.
|
1164
|
+
filename = pjoin(test_data_path,'logical_sparse.mat')
|
1165
|
+
# Before fix, this would crash with:
|
1166
|
+
# ValueError: indices and data should have the same size
|
1167
|
+
d = loadmat(filename, struct_as_record=True, spmatrix=False)
|
1168
|
+
log_sp = d['sp_log_5_4']
|
1169
|
+
assert_(issparse(log_sp) and log_sp.format == "csc")
|
1170
|
+
assert_equal(log_sp.dtype.type, np.bool_)
|
1171
|
+
assert_array_equal(log_sp.toarray(),
|
1172
|
+
[[True, True, True, False],
|
1173
|
+
[False, False, True, False],
|
1174
|
+
[False, False, True, False],
|
1175
|
+
[False, False, False, False],
|
1176
|
+
[False, False, False, False]])
|
1177
|
+
|
1178
|
+
|
1179
|
+
def test_empty_sparse():
|
1180
|
+
# Can we read empty sparse matrices?
|
1181
|
+
sio = BytesIO()
|
1182
|
+
import scipy.sparse
|
1183
|
+
empty_sparse = scipy.sparse.csr_array([[0,0],[0,0]])
|
1184
|
+
savemat(sio, dict(x=empty_sparse))
|
1185
|
+
sio.seek(0)
|
1186
|
+
|
1187
|
+
res = loadmat(sio, spmatrix=False)
|
1188
|
+
assert not scipy.sparse.isspmatrix(res['x'])
|
1189
|
+
res = loadmat(sio, spmatrix=True)
|
1190
|
+
assert scipy.sparse.isspmatrix(res['x'])
|
1191
|
+
res = loadmat(sio) # chk default
|
1192
|
+
assert scipy.sparse.isspmatrix(res['x'])
|
1193
|
+
|
1194
|
+
assert_array_equal(res['x'].shape, empty_sparse.shape)
|
1195
|
+
assert_array_equal(res['x'].toarray(), 0)
|
1196
|
+
# Do empty sparse matrices get written with max nnz 1?
|
1197
|
+
# See https://github.com/scipy/scipy/issues/4208
|
1198
|
+
sio.seek(0)
|
1199
|
+
reader = MatFile5Reader(sio)
|
1200
|
+
reader.initialize_read()
|
1201
|
+
reader.read_file_header()
|
1202
|
+
hdr, _ = reader.read_var_header()
|
1203
|
+
assert_equal(hdr.nzmax, 1)
|
1204
|
+
|
1205
|
+
|
1206
|
+
def test_empty_mat_error():
|
1207
|
+
# Test we get a specific warning for an empty mat file
|
1208
|
+
sio = BytesIO()
|
1209
|
+
assert_raises(MatReadError, loadmat, sio)
|
1210
|
+
|
1211
|
+
|
1212
|
+
def test_miuint32_compromise():
|
1213
|
+
# Reader should accept miUINT32 for miINT32, but check signs
|
1214
|
+
# mat file with miUINT32 for miINT32, but OK values
|
1215
|
+
filename = pjoin(test_data_path, 'miuint32_for_miint32.mat')
|
1216
|
+
res = loadmat(filename)
|
1217
|
+
assert_equal(res['an_array'], np.arange(10)[None, :])
|
1218
|
+
# mat file with miUINT32 for miINT32, with negative value
|
1219
|
+
filename = pjoin(test_data_path, 'bad_miuint32.mat')
|
1220
|
+
with assert_raises(ValueError):
|
1221
|
+
loadmat(filename)
|
1222
|
+
|
1223
|
+
|
1224
|
+
def test_miutf8_for_miint8_compromise():
|
1225
|
+
# Check reader accepts ascii as miUTF8 for array names
|
1226
|
+
filename = pjoin(test_data_path, 'miutf8_array_name.mat')
|
1227
|
+
res = loadmat(filename)
|
1228
|
+
assert_equal(res['array_name'], [[1]])
|
1229
|
+
# mat file with non-ascii utf8 name raises error
|
1230
|
+
filename = pjoin(test_data_path, 'bad_miutf8_array_name.mat')
|
1231
|
+
with assert_raises(ValueError):
|
1232
|
+
loadmat(filename)
|
1233
|
+
|
1234
|
+
|
1235
|
+
def test_bad_utf8():
|
1236
|
+
# Check that reader reads bad UTF with 'replace' option
|
1237
|
+
filename = pjoin(test_data_path,'broken_utf8.mat')
|
1238
|
+
res = loadmat(filename)
|
1239
|
+
assert_equal(res['bad_string'],
|
1240
|
+
b'\x80 am broken'.decode('utf8', 'replace'))
|
1241
|
+
|
1242
|
+
|
1243
|
+
def test_save_unicode_field(tmpdir):
|
1244
|
+
filename = os.path.join(str(tmpdir), 'test.mat')
|
1245
|
+
test_dict = {'a':{'b':1,'c':'test_str'}}
|
1246
|
+
savemat(filename, test_dict)
|
1247
|
+
|
1248
|
+
|
1249
|
+
def test_save_custom_array_type(tmpdir):
|
1250
|
+
class CustomArray:
|
1251
|
+
def __array__(self, dtype=None, copy=None):
|
1252
|
+
return np.arange(6.0).reshape(2, 3)
|
1253
|
+
a = CustomArray()
|
1254
|
+
filename = os.path.join(str(tmpdir), 'test.mat')
|
1255
|
+
savemat(filename, {'a': a})
|
1256
|
+
out = loadmat(filename)
|
1257
|
+
assert_array_equal(out['a'], np.array(a))
|
1258
|
+
|
1259
|
+
|
1260
|
+
def test_filenotfound():
|
1261
|
+
# Check the correct error is thrown
|
1262
|
+
assert_raises(OSError, loadmat, "NotExistentFile00.mat")
|
1263
|
+
assert_raises(OSError, loadmat, "NotExistentFile00")
|
1264
|
+
|
1265
|
+
|
1266
|
+
def test_simplify_cells():
|
1267
|
+
# Test output when simplify_cells=True
|
1268
|
+
filename = pjoin(test_data_path, 'testsimplecell.mat')
|
1269
|
+
res1 = loadmat(filename, simplify_cells=True)
|
1270
|
+
res2 = loadmat(filename, simplify_cells=False)
|
1271
|
+
assert_(isinstance(res1["s"], dict))
|
1272
|
+
assert_(isinstance(res2["s"], np.ndarray))
|
1273
|
+
assert_array_equal(res1["s"]["mycell"], np.array(["a", "b", "c"]))
|
1274
|
+
|
1275
|
+
|
1276
|
+
@pytest.mark.parametrize('version, filt, regex', [
|
1277
|
+
(0, '_4*_*', None),
|
1278
|
+
(1, '_5*_*', None),
|
1279
|
+
(1, '_6*_*', None),
|
1280
|
+
(1, '_7*_*', '^((?!hdf5).)*$'), # not containing hdf5
|
1281
|
+
(2, '_7*_*', '.*hdf5.*'),
|
1282
|
+
(1, '8*_*', None),
|
1283
|
+
])
|
1284
|
+
def test_matfile_version(version, filt, regex):
|
1285
|
+
use_filt = pjoin(test_data_path, f'test*{filt}.mat')
|
1286
|
+
files = glob(use_filt)
|
1287
|
+
if regex is not None:
|
1288
|
+
files = [file for file in files if re.match(regex, file) is not None]
|
1289
|
+
assert len(files) > 0, \
|
1290
|
+
f"No files for version {version} using filter {filt}"
|
1291
|
+
for file in files:
|
1292
|
+
got_version = matfile_version(file)
|
1293
|
+
assert got_version[0] == version
|
1294
|
+
|
1295
|
+
|
1296
|
+
def test_opaque():
|
1297
|
+
"""Test that we can read a MatlabOpaque object."""
|
1298
|
+
data = loadmat(pjoin(test_data_path, 'parabola.mat'))
|
1299
|
+
assert isinstance(data['parabola'], MatlabFunction)
|
1300
|
+
assert isinstance(data['parabola'].item()[3].item()[3], MatlabOpaque)
|
1301
|
+
|
1302
|
+
|
1303
|
+
def test_opaque_simplify():
|
1304
|
+
"""Test that we can read a MatlabOpaque object when simplify_cells=True."""
|
1305
|
+
data = loadmat(pjoin(test_data_path, 'parabola.mat'), simplify_cells=True)
|
1306
|
+
assert isinstance(data['parabola'], MatlabFunction)
|
1307
|
+
|
1308
|
+
|
1309
|
+
def test_deprecation():
|
1310
|
+
"""Test that access to previous attributes still works."""
|
1311
|
+
# This should be accessible immediately from scipy.io import
|
1312
|
+
with assert_warns(DeprecationWarning):
|
1313
|
+
scipy.io.matlab.mio5_params.MatlabOpaque
|
1314
|
+
|
1315
|
+
# These should be importable but warn as well
|
1316
|
+
with assert_warns(DeprecationWarning):
|
1317
|
+
from scipy.io.matlab.miobase import MatReadError # noqa: F401
|
1318
|
+
|
1319
|
+
|
1320
|
+
def test_gh_17992(tmp_path):
|
1321
|
+
rng = np.random.default_rng(12345)
|
1322
|
+
outfile = tmp_path / "lists.mat"
|
1323
|
+
array_one = rng.random((5,3))
|
1324
|
+
array_two = rng.random((6,3))
|
1325
|
+
list_of_arrays = [array_one, array_two]
|
1326
|
+
savemat(outfile,
|
1327
|
+
{'data': list_of_arrays},
|
1328
|
+
long_field_names=True,
|
1329
|
+
do_compression=True)
|
1330
|
+
# round trip check
|
1331
|
+
new_dict = {}
|
1332
|
+
loadmat(outfile,
|
1333
|
+
new_dict)
|
1334
|
+
assert_allclose(new_dict["data"][0][0], array_one)
|
1335
|
+
assert_allclose(new_dict["data"][0][1], array_two)
|
1336
|
+
|
1337
|
+
|
1338
|
+
def test_gh_19659(tmp_path):
|
1339
|
+
d = {
|
1340
|
+
"char_array": np.array([list("char"), list("char")], dtype="U1"),
|
1341
|
+
"string_array": np.array(["string", "string"]),
|
1342
|
+
}
|
1343
|
+
outfile = tmp_path / "tmp.mat"
|
1344
|
+
# should not error:
|
1345
|
+
savemat(outfile, d, format="4")
|
1346
|
+
|
1347
|
+
|
1348
|
+
def test_large_m4():
|
1349
|
+
# Test we can read a Matlab 4 file with array > 2GB.
|
1350
|
+
# (In fact, test we get the correct error from reading a truncated
|
1351
|
+
# version).
|
1352
|
+
# See https://github.com/scipy/scipy/issues/21256
|
1353
|
+
# Data file is first 1024 bytes of:
|
1354
|
+
# >>> a = np.zeros((134217728, 3))
|
1355
|
+
# >>> siom.savemat('big_m4.mat', {'a': a}, format='4')
|
1356
|
+
truncated_mat = pjoin(test_data_path, 'debigged_m4.mat')
|
1357
|
+
match = ("Not enough bytes to read matrix 'a';"
|
1358
|
+
if np.intp == np.int64 else
|
1359
|
+
"Variable 'a' has byte length longer than largest possible")
|
1360
|
+
with pytest.raises(ValueError, match=match):
|
1361
|
+
loadmat(truncated_mat)
|
1362
|
+
|
1363
|
+
|
1364
|
+
def test_gh_19223():
|
1365
|
+
from scipy.io.matlab import varmats_from_mat # noqa: F401
|
1366
|
+
|
1367
|
+
|
1368
|
+
def test_invalid_field_name_warning():
|
1369
|
+
names_vars = (
|
1370
|
+
('_1', mlarr(np.arange(10))),
|
1371
|
+
('mystr', mlarr('a string')))
|
1372
|
+
check_mat_write_warning(names_vars)
|
1373
|
+
|
1374
|
+
names_vars = (('mymap', {"a": 1, "_b": 2}),)
|
1375
|
+
check_mat_write_warning(names_vars)
|
1376
|
+
|
1377
|
+
names_vars = (('mymap', {"a": 1, "1a": 2}),)
|
1378
|
+
check_mat_write_warning(names_vars)
|
1379
|
+
|
1380
|
+
|
1381
|
+
def check_mat_write_warning(names_vars):
|
1382
|
+
class C:
|
1383
|
+
def items(self):
|
1384
|
+
return names_vars
|
1385
|
+
|
1386
|
+
stream = BytesIO()
|
1387
|
+
with pytest.warns(MatWriteWarning, match='Starting field name with'):
|
1388
|
+
savemat(stream, C())
|
1389
|
+
|
1390
|
+
|
1391
|
+
def test_corrupt_files():
|
1392
|
+
# Test we can detect truncated or corrupt (all zero) files.
|
1393
|
+
for n in (2, 4, 10, 19):
|
1394
|
+
with pytest.raises(MatReadError,
|
1395
|
+
match="Mat file appears to be truncated"):
|
1396
|
+
loadmat(BytesIO(b'\x00' * n))
|
1397
|
+
with pytest.raises(MatReadError,
|
1398
|
+
match="Mat file appears to be corrupt"):
|
1399
|
+
loadmat(BytesIO(b'\x00' * 20))
|