scipy 1.16.2__cp314-cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/_cyutility.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/_lib/_ccallback_c.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/_lib/_fpumode.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/_lib/_test_ccallback.cp314t-win_arm64.pyd +0 -0
- scipy/_lib/_test_deprecation_call.cp314t-win_arm64.lib +0 -0
- scipy/_lib/_test_deprecation_call.cp314t-win_arm64.pyd +0 -0
- scipy/_lib/_test_deprecation_def.cp314t-win_arm64.lib +0 -0
- scipy/_lib/_test_deprecation_def.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/_lib/_uarray/_uarray.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/_lib/messagestream.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/cluster/_hierarchy.cp314t-win_arm64.pyd +0 -0
- scipy/cluster/_optimal_leaf_ordering.cp314t-win_arm64.lib +0 -0
- scipy/cluster/_optimal_leaf_ordering.cp314t-win_arm64.pyd +0 -0
- scipy/cluster/_vq.cp314t-win_arm64.lib +0 -0
- scipy/cluster/_vq.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/fft/_pocketfft/pypocketfft.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/fftpack/convolve.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/integrate/_dop.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/integrate/_lsoda.cp314t-win_arm64.pyd +0 -0
- scipy/integrate/_ode.py +1395 -0
- scipy/integrate/_odepack.cp314t-win_arm64.lib +0 -0
- scipy/integrate/_odepack.cp314t-win_arm64.pyd +0 -0
- scipy/integrate/_odepack_py.py +273 -0
- scipy/integrate/_quad_vec.py +674 -0
- scipy/integrate/_quadpack.cp314t-win_arm64.lib +0 -0
- scipy/integrate/_quadpack.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/integrate/_test_multivariate.cp314t-win_arm64.pyd +0 -0
- scipy/integrate/_test_odeint_banded.cp314t-win_arm64.lib +0 -0
- scipy/integrate/_test_odeint_banded.cp314t-win_arm64.pyd +0 -0
- scipy/integrate/_vode.cp314t-win_arm64.lib +0 -0
- scipy/integrate/_vode.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/interpolate/_dfitpack.cp314t-win_arm64.pyd +0 -0
- scipy/interpolate/_dierckx.cp314t-win_arm64.lib +0 -0
- scipy/interpolate/_dierckx.cp314t-win_arm64.pyd +0 -0
- scipy/interpolate/_fitpack.cp314t-win_arm64.lib +0 -0
- scipy/interpolate/_fitpack.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/interpolate/_interpnd.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/interpolate/_ppoly.cp314t-win_arm64.pyd +0 -0
- scipy/interpolate/_rbf.py +290 -0
- scipy/interpolate/_rbfinterp.py +550 -0
- scipy/interpolate/_rbfinterp_pythran.cp314t-win_arm64.lib +0 -0
- scipy/interpolate/_rbfinterp_pythran.cp314t-win_arm64.pyd +0 -0
- scipy/interpolate/_rgi.py +764 -0
- scipy/interpolate/_rgi_cython.cp314t-win_arm64.lib +0 -0
- scipy/interpolate/_rgi_cython.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/io/_fast_matrix_market/_fmm_core.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/io/_test_fortran.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/io/matlab/_mio5_utils.cp314t-win_arm64.pyd +0 -0
- scipy/io/matlab/_mio_utils.cp314t-win_arm64.lib +0 -0
- scipy/io/matlab/_mio_utils.cp314t-win_arm64.pyd +0 -0
- scipy/io/matlab/_miobase.py +435 -0
- scipy/io/matlab/_streams.cp314t-win_arm64.lib +0 -0
- scipy/io/matlab/_streams.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/linalg/_cythonized_array_utils.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/linalg/_decomp_interpolative.cp314t-win_arm64.pyd +0 -0
- scipy/linalg/_decomp_ldl.py +356 -0
- scipy/linalg/_decomp_lu.py +401 -0
- scipy/linalg/_decomp_lu_cython.cp314t-win_arm64.lib +0 -0
- scipy/linalg/_decomp_lu_cython.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/linalg/_decomp_update.cp314t-win_arm64.pyd +0 -0
- scipy/linalg/_expm_frechet.py +417 -0
- scipy/linalg/_fblas.cp314t-win_arm64.lib +0 -0
- scipy/linalg/_fblas.cp314t-win_arm64.pyd +0 -0
- scipy/linalg/_flapack.cp314t-win_arm64.lib +0 -0
- scipy/linalg/_flapack.cp314t-win_arm64.pyd +0 -0
- scipy/linalg/_lapack_subroutines.h +1521 -0
- scipy/linalg/_linalg_pythran.cp314t-win_arm64.lib +0 -0
- scipy/linalg/_linalg_pythran.cp314t-win_arm64.pyd +0 -0
- scipy/linalg/_matfuncs.py +1050 -0
- scipy/linalg/_matfuncs_expm.cp314t-win_arm64.lib +0 -0
- scipy/linalg/_matfuncs_expm.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/linalg/_matfuncs_schur_sqrtm.cp314t-win_arm64.pyd +0 -0
- scipy/linalg/_matfuncs_sqrtm.py +107 -0
- scipy/linalg/_matfuncs_sqrtm_triu.cp314t-win_arm64.lib +0 -0
- scipy/linalg/_matfuncs_sqrtm_triu.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/linalg/_solve_toeplitz.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/linalg/cython_blas.cp314t-win_arm64.pyd +0 -0
- scipy/linalg/cython_blas.pxd +169 -0
- scipy/linalg/cython_blas.pyx +1432 -0
- scipy/linalg/cython_lapack.cp314t-win_arm64.lib +0 -0
- scipy/linalg/cython_lapack.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/ndimage/_ctest.cp314t-win_arm64.pyd +0 -0
- scipy/ndimage/_cytest.cp314t-win_arm64.lib +0 -0
- scipy/ndimage/_cytest.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/ndimage/_nd_image.cp314t-win_arm64.pyd +0 -0
- scipy/ndimage/_ndimage_api.py +16 -0
- scipy/ndimage/_ni_docstrings.py +214 -0
- scipy/ndimage/_ni_label.cp314t-win_arm64.lib +0 -0
- scipy/ndimage/_ni_label.cp314t-win_arm64.pyd +0 -0
- scipy/ndimage/_ni_support.py +139 -0
- scipy/ndimage/_rank_filter_1d.cp314t-win_arm64.lib +0 -0
- scipy/ndimage/_rank_filter_1d.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/odr/__odrpack.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/optimize/_bglu_dense.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/optimize/_direct.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/optimize/_group_columns.cp314t-win_arm64.pyd +0 -0
- scipy/optimize/_hessian_update_strategy.py +479 -0
- scipy/optimize/_highspy/__init__.py +0 -0
- scipy/optimize/_highspy/_core.cp314t-win_arm64.lib +0 -0
- scipy/optimize/_highspy/_core.cp314t-win_arm64.pyd +0 -0
- scipy/optimize/_highspy/_highs_options.cp314t-win_arm64.lib +0 -0
- scipy/optimize/_highspy/_highs_options.cp314t-win_arm64.pyd +0 -0
- scipy/optimize/_highspy/_highs_wrapper.py +338 -0
- scipy/optimize/_isotonic.py +157 -0
- scipy/optimize/_lbfgsb.cp314t-win_arm64.lib +0 -0
- scipy/optimize/_lbfgsb.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/optimize/_lsap.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/optimize/_lsq/givens_elimination.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/optimize/_minpack.cp314t-win_arm64.pyd +0 -0
- scipy/optimize/_minpack_py.py +1178 -0
- scipy/optimize/_moduleTNC.cp314t-win_arm64.lib +0 -0
- scipy/optimize/_moduleTNC.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/optimize/_pava_pybind.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/optimize/_slsqplib.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/optimize/_trlib/_trlib.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/optimize/_zeros.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/optimize/cython_optimize/_zeros.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/signal/_max_len_seq_inner.cp314t-win_arm64.pyd +0 -0
- scipy/signal/_peak_finding.py +1310 -0
- scipy/signal/_peak_finding_utils.cp314t-win_arm64.lib +0 -0
- scipy/signal/_peak_finding_utils.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/signal/_sigtools.cp314t-win_arm64.pyd +0 -0
- scipy/signal/_sosfilt.cp314t-win_arm64.lib +0 -0
- scipy/signal/_sosfilt.cp314t-win_arm64.pyd +0 -0
- scipy/signal/_spectral_py.py +2471 -0
- scipy/signal/_spline.cp314t-win_arm64.lib +0 -0
- scipy/signal/_spline.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/signal/_upfirdn_apply.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/sparse/_csparsetools.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/sparse/_sparsetools.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_flow.cp314t-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_laplacian.py +563 -0
- scipy/sparse/csgraph/_matching.cp314t-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_matching.cp314t-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_min_spanning_tree.cp314t-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_min_spanning_tree.cp314t-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_reordering.cp314t-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_reordering.cp314t-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_shortest_path.cp314t-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_shortest_path.cp314t-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_tools.cp314t-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_tools.cp314t-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_traversal.cp314t-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_traversal.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/sparse/linalg/_dsolve/_superlu.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/sparse/linalg/_eigen/arpack/_arpack.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_cpropack.cp314t-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_propack/_dpropack.cp314t-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_dpropack.cp314t-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_propack/_spropack.cp314t-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_spropack.cp314t-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_propack/_zpropack.cp314t-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_zpropack.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/spatial/_ckdtree.cp314t-win_arm64.pyd +0 -0
- scipy/spatial/_distance_pybind.cp314t-win_arm64.lib +0 -0
- scipy/spatial/_distance_pybind.cp314t-win_arm64.pyd +0 -0
- scipy/spatial/_distance_wrap.cp314t-win_arm64.lib +0 -0
- scipy/spatial/_distance_wrap.cp314t-win_arm64.pyd +0 -0
- scipy/spatial/_geometric_slerp.py +238 -0
- scipy/spatial/_hausdorff.cp314t-win_arm64.lib +0 -0
- scipy/spatial/_hausdorff.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/spatial/_qhull.cp314t-win_arm64.pyd +0 -0
- scipy/spatial/_qhull.pyi +213 -0
- scipy/spatial/_spherical_voronoi.py +341 -0
- scipy/spatial/_voronoi.cp314t-win_arm64.lib +0 -0
- scipy/spatial/_voronoi.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/spatial/transform/_rigid_transform.cp314t-win_arm64.pyd +0 -0
- scipy/spatial/transform/_rotation.cp314t-win_arm64.lib +0 -0
- scipy/spatial/transform/_rotation.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/special/_comb.cp314t-win_arm64.pyd +0 -0
- scipy/special/_ellip_harm.py +214 -0
- scipy/special/_ellip_harm_2.cp314t-win_arm64.lib +0 -0
- scipy/special/_ellip_harm_2.cp314t-win_arm64.pyd +0 -0
- scipy/special/_gufuncs.cp314t-win_arm64.lib +0 -0
- scipy/special/_gufuncs.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/special/_specfun.cp314t-win_arm64.pyd +0 -0
- scipy/special/_special_ufuncs.cp314t-win_arm64.lib +0 -0
- scipy/special/_special_ufuncs.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/special/_test_internal.cp314t-win_arm64.pyd +0 -0
- scipy/special/_test_internal.pyi +9 -0
- scipy/special/_testutils.py +321 -0
- scipy/special/_ufuncs.cp314t-win_arm64.lib +0 -0
- scipy/special/_ufuncs.cp314t-win_arm64.pyd +0 -0
- scipy/special/_ufuncs.pyi +522 -0
- scipy/special/_ufuncs.pyx +13173 -0
- scipy/special/_ufuncs_cxx.cp314t-win_arm64.lib +0 -0
- scipy/special/_ufuncs_cxx.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/special/cython_special.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/stats/_ansari_swilk_statistics.cp314t-win_arm64.pyd +0 -0
- scipy/stats/_axis_nan_policy.py +692 -0
- scipy/stats/_biasedurn.cp314t-win_arm64.lib +0 -0
- scipy/stats/_biasedurn.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/stats/_levy_stable/levyst.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/stats/_qmc_cy.cp314t-win_arm64.pyd +0 -0
- scipy/stats/_qmc_cy.pyi +54 -0
- scipy/stats/_qmvnt.py +454 -0
- scipy/stats/_qmvnt_cy.cp314t-win_arm64.lib +0 -0
- scipy/stats/_qmvnt_cy.cp314t-win_arm64.pyd +0 -0
- scipy/stats/_quantile.py +335 -0
- scipy/stats/_rcont/__init__.py +4 -0
- scipy/stats/_rcont/rcont.cp314t-win_arm64.lib +0 -0
- scipy/stats/_rcont/rcont.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/stats/_sobol.cp314t-win_arm64.pyd +0 -0
- scipy/stats/_sobol.pyi +54 -0
- scipy/stats/_sobol_direction_numbers.npz +0 -0
- scipy/stats/_stats.cp314t-win_arm64.lib +0 -0
- scipy/stats/_stats.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/stats/_stats_pythran.cp314t-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.cp314t-win_arm64.lib +0 -0
- scipy/stats/_unuran/unuran_wrapper.cp314t-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
scipy/io/matlab/_mio5.py
ADDED
@@ -0,0 +1,901 @@
|
|
1
|
+
''' Classes for read / write of matlab (TM) 5 files
|
2
|
+
|
3
|
+
The matfile specification last found here:
|
4
|
+
|
5
|
+
https://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/matfile_format.pdf
|
6
|
+
|
7
|
+
(as of December 5 2008)
|
8
|
+
|
9
|
+
=================================
|
10
|
+
Note on functions and mat files
|
11
|
+
=================================
|
12
|
+
|
13
|
+
The document above does not give any hints as to the storage of matlab
|
14
|
+
function handles, or anonymous function handles. I had, therefore, to
|
15
|
+
guess the format of matlab arrays of ``mxFUNCTION_CLASS`` and
|
16
|
+
``mxOPAQUE_CLASS`` by looking at example mat files.
|
17
|
+
|
18
|
+
``mxFUNCTION_CLASS`` stores all types of matlab functions. It seems to
|
19
|
+
contain a struct matrix with a set pattern of fields. For anonymous
|
20
|
+
functions, a sub-fields of one of these fields seems to contain the
|
21
|
+
well-named ``mxOPAQUE_CLASS``. This seems to contain:
|
22
|
+
|
23
|
+
* array flags as for any matlab matrix
|
24
|
+
* 3 int8 strings
|
25
|
+
* a matrix
|
26
|
+
|
27
|
+
It seems that whenever the mat file contains a ``mxOPAQUE_CLASS``
|
28
|
+
instance, there is also an un-named matrix (name == '') at the end of
|
29
|
+
the mat file. I'll call this the ``__function_workspace__`` matrix.
|
30
|
+
|
31
|
+
When I saved two anonymous functions in a mat file, or appended another
|
32
|
+
anonymous function to the mat file, there was still only one
|
33
|
+
``__function_workspace__`` un-named matrix at the end, but larger than
|
34
|
+
that for a mat file with a single anonymous function, suggesting that
|
35
|
+
the workspaces for the two functions had been merged.
|
36
|
+
|
37
|
+
The ``__function_workspace__`` matrix appears to be of double class
|
38
|
+
(``mxCLASS_DOUBLE``), but stored as uint8, the memory for which is in
|
39
|
+
the format of a mini .mat file, without the first 124 bytes of the file
|
40
|
+
header (the description and the subsystem_offset), but with the version
|
41
|
+
U2 bytes, and the S2 endian test bytes. There follow 4 zero bytes,
|
42
|
+
presumably for 8 byte padding, and then a series of ``miMATRIX``
|
43
|
+
entries, as in a standard mat file. The ``miMATRIX`` entries appear to
|
44
|
+
be series of un-named (name == '') matrices, and may also contain arrays
|
45
|
+
of this same mini-mat format.
|
46
|
+
|
47
|
+
I guess that:
|
48
|
+
|
49
|
+
* saving an anonymous function back to a mat file will need the
|
50
|
+
associated ``__function_workspace__`` matrix saved as well for the
|
51
|
+
anonymous function to work correctly.
|
52
|
+
* appending to a mat file that has a ``__function_workspace__`` would
|
53
|
+
involve first pulling off this workspace, appending, checking whether
|
54
|
+
there were any more anonymous functions appended, and then somehow
|
55
|
+
merging the relevant workspaces, and saving at the end of the mat
|
56
|
+
file.
|
57
|
+
|
58
|
+
The mat files I was playing with are in ``tests/data``:
|
59
|
+
|
60
|
+
* sqr.mat
|
61
|
+
* parabola.mat
|
62
|
+
* some_functions.mat
|
63
|
+
|
64
|
+
See ``tests/test_mio.py:test_mio_funcs.py`` for the debugging
|
65
|
+
script I was working with.
|
66
|
+
|
67
|
+
Small fragments of current code adapted from matfile.py by Heiko
|
68
|
+
Henkelmann; parts of the code for simplify_cells=True adapted from
|
69
|
+
http://blog.nephics.com/2019/08/28/better-loadmat-for-scipy/.
|
70
|
+
'''
|
71
|
+
|
72
|
+
import math
|
73
|
+
import os
|
74
|
+
import time
|
75
|
+
import sys
|
76
|
+
import zlib
|
77
|
+
|
78
|
+
from io import BytesIO
|
79
|
+
|
80
|
+
import warnings
|
81
|
+
|
82
|
+
import numpy as np
|
83
|
+
|
84
|
+
import scipy.sparse
|
85
|
+
|
86
|
+
from ._byteordercodes import native_code, swapped_code
|
87
|
+
|
88
|
+
from ._miobase import (MatFileReader, docfiller, matdims, read_dtype,
|
89
|
+
arr_to_chars, arr_dtype_number, MatWriteError,
|
90
|
+
MatReadError, MatReadWarning, MatWriteWarning)
|
91
|
+
|
92
|
+
# Reader object for matlab 5 format variables
|
93
|
+
from ._mio5_utils import VarReader5
|
94
|
+
|
95
|
+
# Constants and helper objects
|
96
|
+
from ._mio5_params import (MatlabObject, MatlabFunction, MDTYPES, NP_TO_MTYPES,
|
97
|
+
NP_TO_MXTYPES, miCOMPRESSED, miMATRIX, miINT8,
|
98
|
+
miUTF8, miUINT32, mxCELL_CLASS, mxSTRUCT_CLASS,
|
99
|
+
mxOBJECT_CLASS, mxCHAR_CLASS, mxSPARSE_CLASS,
|
100
|
+
mxDOUBLE_CLASS, mclass_info, mat_struct)
|
101
|
+
|
102
|
+
from ._streams import ZlibInputStream
|
103
|
+
|
104
|
+
|
105
|
+
def _has_struct(elem):
|
106
|
+
"""Determine if elem is an array and if first array item is a struct."""
|
107
|
+
return (isinstance(elem, np.ndarray) and (elem.size > 0) and (elem.ndim > 0) and
|
108
|
+
isinstance(elem[0], mat_struct))
|
109
|
+
|
110
|
+
|
111
|
+
def _inspect_cell_array(ndarray):
|
112
|
+
"""Construct lists from cell arrays (loaded as numpy ndarrays), recursing
|
113
|
+
into items if they contain mat_struct objects."""
|
114
|
+
elem_list = []
|
115
|
+
for sub_elem in ndarray:
|
116
|
+
if isinstance(sub_elem, mat_struct):
|
117
|
+
elem_list.append(_matstruct_to_dict(sub_elem))
|
118
|
+
elif _has_struct(sub_elem):
|
119
|
+
elem_list.append(_inspect_cell_array(sub_elem))
|
120
|
+
else:
|
121
|
+
elem_list.append(sub_elem)
|
122
|
+
return elem_list
|
123
|
+
|
124
|
+
|
125
|
+
def _matstruct_to_dict(matobj):
|
126
|
+
"""Construct nested dicts from mat_struct objects."""
|
127
|
+
d = {}
|
128
|
+
for f in matobj._fieldnames:
|
129
|
+
elem = matobj.__dict__[f]
|
130
|
+
if isinstance(elem, mat_struct):
|
131
|
+
d[f] = _matstruct_to_dict(elem)
|
132
|
+
elif _has_struct(elem):
|
133
|
+
d[f] = _inspect_cell_array(elem)
|
134
|
+
else:
|
135
|
+
d[f] = elem
|
136
|
+
return d
|
137
|
+
|
138
|
+
|
139
|
+
def _simplify_cells(d):
|
140
|
+
"""Convert mat objects in dict to nested dicts."""
|
141
|
+
for key in d:
|
142
|
+
if isinstance(d[key], mat_struct):
|
143
|
+
d[key] = _matstruct_to_dict(d[key])
|
144
|
+
elif _has_struct(d[key]):
|
145
|
+
d[key] = _inspect_cell_array(d[key])
|
146
|
+
return d
|
147
|
+
|
148
|
+
|
149
|
+
class MatFile5Reader(MatFileReader):
|
150
|
+
''' Reader for Mat 5 mat files
|
151
|
+
Adds the following attribute to base class
|
152
|
+
|
153
|
+
uint16_codec - char codec to use for uint16 char arrays
|
154
|
+
(defaults to system default codec)
|
155
|
+
|
156
|
+
Uses variable reader that has the following standard interface (see
|
157
|
+
abstract class in ``miobase``::
|
158
|
+
|
159
|
+
__init__(self, file_reader)
|
160
|
+
read_header(self)
|
161
|
+
array_from_header(self)
|
162
|
+
|
163
|
+
and added interface::
|
164
|
+
|
165
|
+
set_stream(self, stream)
|
166
|
+
read_full_tag(self)
|
167
|
+
|
168
|
+
'''
|
169
|
+
@docfiller
|
170
|
+
def __init__(self,
|
171
|
+
mat_stream,
|
172
|
+
byte_order=None,
|
173
|
+
mat_dtype=False,
|
174
|
+
squeeze_me=False,
|
175
|
+
chars_as_strings=True,
|
176
|
+
matlab_compatible=False,
|
177
|
+
struct_as_record=True,
|
178
|
+
verify_compressed_data_integrity=True,
|
179
|
+
uint16_codec=None,
|
180
|
+
simplify_cells=False):
|
181
|
+
'''Initializer for matlab 5 file format reader
|
182
|
+
|
183
|
+
%(matstream_arg)s
|
184
|
+
%(load_args)s
|
185
|
+
%(struct_arg)s
|
186
|
+
uint16_codec : {None, string}
|
187
|
+
Set codec to use for uint16 char arrays (e.g., 'utf-8').
|
188
|
+
Use system default codec if None
|
189
|
+
'''
|
190
|
+
super().__init__(
|
191
|
+
mat_stream,
|
192
|
+
byte_order,
|
193
|
+
mat_dtype,
|
194
|
+
squeeze_me,
|
195
|
+
chars_as_strings,
|
196
|
+
matlab_compatible,
|
197
|
+
struct_as_record,
|
198
|
+
verify_compressed_data_integrity,
|
199
|
+
simplify_cells)
|
200
|
+
# Set uint16 codec
|
201
|
+
if not uint16_codec:
|
202
|
+
uint16_codec = sys.getdefaultencoding()
|
203
|
+
self.uint16_codec = uint16_codec
|
204
|
+
# placeholders for readers - see initialize_read method
|
205
|
+
self._file_reader = None
|
206
|
+
self._matrix_reader = None
|
207
|
+
|
208
|
+
def guess_byte_order(self):
|
209
|
+
''' Guess byte order.
|
210
|
+
Sets stream pointer to 0'''
|
211
|
+
self.mat_stream.seek(126)
|
212
|
+
mi = self.mat_stream.read(2)
|
213
|
+
self.mat_stream.seek(0)
|
214
|
+
return mi == b'IM' and '<' or '>'
|
215
|
+
|
216
|
+
def read_file_header(self):
|
217
|
+
''' Read in mat 5 file header '''
|
218
|
+
hdict = {}
|
219
|
+
hdr_dtype = MDTYPES[self.byte_order]['dtypes']['file_header']
|
220
|
+
hdr = read_dtype(self.mat_stream, hdr_dtype)
|
221
|
+
hdict['__header__'] = hdr['description'].item().strip(b' \t\n\000')
|
222
|
+
v_major = hdr['version'] >> 8
|
223
|
+
v_minor = hdr['version'] & 0xFF
|
224
|
+
hdict['__version__'] = f'{v_major}.{v_minor}'
|
225
|
+
return hdict
|
226
|
+
|
227
|
+
def initialize_read(self):
|
228
|
+
''' Run when beginning read of variables
|
229
|
+
|
230
|
+
Sets up readers from parameters in `self`
|
231
|
+
'''
|
232
|
+
# reader for top level stream. We need this extra top-level
|
233
|
+
# reader because we use the matrix_reader object to contain
|
234
|
+
# compressed matrices (so they have their own stream)
|
235
|
+
self._file_reader = VarReader5(self)
|
236
|
+
# reader for matrix streams
|
237
|
+
self._matrix_reader = VarReader5(self)
|
238
|
+
|
239
|
+
def read_var_header(self):
|
240
|
+
''' Read header, return header, next position
|
241
|
+
|
242
|
+
Header has to define at least .name and .is_global
|
243
|
+
|
244
|
+
Parameters
|
245
|
+
----------
|
246
|
+
None
|
247
|
+
|
248
|
+
Returns
|
249
|
+
-------
|
250
|
+
header : object
|
251
|
+
object that can be passed to self.read_var_array, and that
|
252
|
+
has attributes .name and .is_global
|
253
|
+
next_position : int
|
254
|
+
position in stream of next variable
|
255
|
+
'''
|
256
|
+
mdtype, byte_count = self._file_reader.read_full_tag()
|
257
|
+
if not byte_count > 0:
|
258
|
+
raise ValueError("Did not read any bytes")
|
259
|
+
next_pos = self.mat_stream.tell() + byte_count
|
260
|
+
if mdtype == miCOMPRESSED:
|
261
|
+
# Make new stream from compressed data
|
262
|
+
stream = ZlibInputStream(self.mat_stream, byte_count)
|
263
|
+
self._matrix_reader.set_stream(stream)
|
264
|
+
check_stream_limit = self.verify_compressed_data_integrity
|
265
|
+
mdtype, byte_count = self._matrix_reader.read_full_tag()
|
266
|
+
else:
|
267
|
+
check_stream_limit = False
|
268
|
+
self._matrix_reader.set_stream(self.mat_stream)
|
269
|
+
if not mdtype == miMATRIX:
|
270
|
+
raise TypeError(f'Expecting miMATRIX type here, got {mdtype}')
|
271
|
+
header = self._matrix_reader.read_header(check_stream_limit)
|
272
|
+
return header, next_pos
|
273
|
+
|
274
|
+
def read_var_array(self, header, process=True):
|
275
|
+
''' Read array, given `header`
|
276
|
+
|
277
|
+
Parameters
|
278
|
+
----------
|
279
|
+
header : header object
|
280
|
+
object with fields defining variable header
|
281
|
+
process : {True, False} bool, optional
|
282
|
+
If True, apply recursive post-processing during loading of
|
283
|
+
array.
|
284
|
+
|
285
|
+
Returns
|
286
|
+
-------
|
287
|
+
arr : array
|
288
|
+
array with post-processing applied or not according to
|
289
|
+
`process`.
|
290
|
+
'''
|
291
|
+
return self._matrix_reader.array_from_header(header, process)
|
292
|
+
|
293
|
+
def get_variables(self, variable_names=None):
|
294
|
+
''' get variables from stream as dictionary
|
295
|
+
|
296
|
+
variable_names - optional list of variable names to get
|
297
|
+
|
298
|
+
If variable_names is None, then get all variables in file
|
299
|
+
'''
|
300
|
+
if isinstance(variable_names, str):
|
301
|
+
variable_names = [variable_names]
|
302
|
+
elif variable_names is not None:
|
303
|
+
variable_names = list(variable_names)
|
304
|
+
|
305
|
+
self.mat_stream.seek(0)
|
306
|
+
# Here we pass all the parameters in self to the reading objects
|
307
|
+
self.initialize_read()
|
308
|
+
mdict = self.read_file_header()
|
309
|
+
mdict['__globals__'] = []
|
310
|
+
while not self.end_of_stream():
|
311
|
+
hdr, next_position = self.read_var_header()
|
312
|
+
name = 'None' if hdr.name is None else hdr.name.decode('latin1')
|
313
|
+
if name in mdict:
|
314
|
+
msg = (
|
315
|
+
f'Duplicate variable name "{name}" in stream'
|
316
|
+
" - replacing previous with new\nConsider"
|
317
|
+
"scipy.io.matlab.varmats_from_mat to split "
|
318
|
+
"file into single variable files"
|
319
|
+
)
|
320
|
+
warnings.warn(msg, MatReadWarning, stacklevel=2)
|
321
|
+
if name == '':
|
322
|
+
# can only be a matlab 7 function workspace
|
323
|
+
name = '__function_workspace__'
|
324
|
+
# We want to keep this raw because mat_dtype processing
|
325
|
+
# will break the format (uint8 as mxDOUBLE_CLASS)
|
326
|
+
process = False
|
327
|
+
else:
|
328
|
+
process = True
|
329
|
+
if variable_names is not None and name not in variable_names:
|
330
|
+
self.mat_stream.seek(next_position)
|
331
|
+
continue
|
332
|
+
try:
|
333
|
+
res = self.read_var_array(hdr, process)
|
334
|
+
except MatReadError as err:
|
335
|
+
warnings.warn(
|
336
|
+
f'Unreadable variable "{name}", because "{err}"',
|
337
|
+
Warning, stacklevel=2)
|
338
|
+
res = f"Read error: {err}"
|
339
|
+
self.mat_stream.seek(next_position)
|
340
|
+
mdict[name] = res
|
341
|
+
if hdr.is_global:
|
342
|
+
mdict['__globals__'].append(name)
|
343
|
+
if variable_names is not None:
|
344
|
+
variable_names.remove(name)
|
345
|
+
if len(variable_names) == 0:
|
346
|
+
break
|
347
|
+
if self.simplify_cells:
|
348
|
+
return _simplify_cells(mdict)
|
349
|
+
else:
|
350
|
+
return mdict
|
351
|
+
|
352
|
+
def list_variables(self):
|
353
|
+
''' list variables from stream '''
|
354
|
+
self.mat_stream.seek(0)
|
355
|
+
# Here we pass all the parameters in self to the reading objects
|
356
|
+
self.initialize_read()
|
357
|
+
self.read_file_header()
|
358
|
+
vars = []
|
359
|
+
while not self.end_of_stream():
|
360
|
+
hdr, next_position = self.read_var_header()
|
361
|
+
name = 'None' if hdr.name is None else hdr.name.decode('latin1')
|
362
|
+
if name == '':
|
363
|
+
# can only be a matlab 7 function workspace
|
364
|
+
name = '__function_workspace__'
|
365
|
+
|
366
|
+
shape = self._matrix_reader.shape_from_header(hdr)
|
367
|
+
if hdr.is_logical:
|
368
|
+
info = 'logical'
|
369
|
+
else:
|
370
|
+
info = mclass_info.get(hdr.mclass, 'unknown')
|
371
|
+
vars.append((name, shape, info))
|
372
|
+
|
373
|
+
self.mat_stream.seek(next_position)
|
374
|
+
return vars
|
375
|
+
|
376
|
+
|
377
|
+
def varmats_from_mat(file_obj):
|
378
|
+
""" Pull variables out of mat 5 file as a sequence of mat file objects
|
379
|
+
|
380
|
+
This can be useful with a difficult mat file, containing unreadable
|
381
|
+
variables. This routine pulls the variables out in raw form and puts them,
|
382
|
+
unread, back into a file stream for saving or reading. Another use is the
|
383
|
+
pathological case where there is more than one variable of the same name in
|
384
|
+
the file; this routine returns the duplicates, whereas the standard reader
|
385
|
+
will overwrite duplicates in the returned dictionary.
|
386
|
+
|
387
|
+
The file pointer in `file_obj` will be undefined. File pointers for the
|
388
|
+
returned file-like objects are set at 0.
|
389
|
+
|
390
|
+
Parameters
|
391
|
+
----------
|
392
|
+
file_obj : file-like
|
393
|
+
file object containing mat file
|
394
|
+
|
395
|
+
Returns
|
396
|
+
-------
|
397
|
+
named_mats : list
|
398
|
+
list contains tuples of (name, BytesIO) where BytesIO is a file-like
|
399
|
+
object containing mat file contents as for a single variable. The
|
400
|
+
BytesIO contains a string with the original header and a single var. If
|
401
|
+
``var_file_obj`` is an individual BytesIO instance, then save as a mat
|
402
|
+
file with something like ``open('test.mat',
|
403
|
+
'wb').write(var_file_obj.read())``
|
404
|
+
|
405
|
+
Examples
|
406
|
+
--------
|
407
|
+
>>> import scipy.io
|
408
|
+
>>> import numpy as np
|
409
|
+
>>> from io import BytesIO
|
410
|
+
>>> from scipy.io.matlab._mio5 import varmats_from_mat
|
411
|
+
>>> mat_fileobj = BytesIO()
|
412
|
+
>>> scipy.io.savemat(mat_fileobj, {'b': np.arange(10), 'a': 'a string'})
|
413
|
+
>>> varmats = varmats_from_mat(mat_fileobj)
|
414
|
+
>>> sorted([name for name, str_obj in varmats])
|
415
|
+
['a', 'b']
|
416
|
+
"""
|
417
|
+
rdr = MatFile5Reader(file_obj)
|
418
|
+
file_obj.seek(0)
|
419
|
+
# Raw read of top-level file header
|
420
|
+
hdr_len = MDTYPES[native_code]['dtypes']['file_header'].itemsize
|
421
|
+
raw_hdr = file_obj.read(hdr_len)
|
422
|
+
# Initialize variable reading
|
423
|
+
file_obj.seek(0)
|
424
|
+
rdr.initialize_read()
|
425
|
+
rdr.read_file_header()
|
426
|
+
next_position = file_obj.tell()
|
427
|
+
named_mats = []
|
428
|
+
while not rdr.end_of_stream():
|
429
|
+
start_position = next_position
|
430
|
+
hdr, next_position = rdr.read_var_header()
|
431
|
+
name = 'None' if hdr.name is None else hdr.name.decode('latin1')
|
432
|
+
# Read raw variable string
|
433
|
+
file_obj.seek(start_position)
|
434
|
+
byte_count = next_position - start_position
|
435
|
+
var_str = file_obj.read(byte_count)
|
436
|
+
# write to stringio object
|
437
|
+
out_obj = BytesIO()
|
438
|
+
out_obj.write(raw_hdr)
|
439
|
+
out_obj.write(var_str)
|
440
|
+
out_obj.seek(0)
|
441
|
+
named_mats.append((name, out_obj))
|
442
|
+
return named_mats
|
443
|
+
|
444
|
+
|
445
|
+
class EmptyStructMarker:
|
446
|
+
""" Class to indicate presence of empty matlab struct on output """
|
447
|
+
|
448
|
+
|
449
|
+
def to_writeable(source):
|
450
|
+
''' Convert input object ``source`` to something we can write
|
451
|
+
|
452
|
+
Parameters
|
453
|
+
----------
|
454
|
+
source : object
|
455
|
+
|
456
|
+
Returns
|
457
|
+
-------
|
458
|
+
arr : None or ndarray or EmptyStructMarker
|
459
|
+
If `source` cannot be converted to something we can write to a matfile,
|
460
|
+
return None. If `source` is equivalent to an empty dictionary, return
|
461
|
+
``EmptyStructMarker``. Otherwise return `source` converted to an
|
462
|
+
ndarray with contents for writing to matfile.
|
463
|
+
'''
|
464
|
+
if isinstance(source, np.ndarray):
|
465
|
+
return source
|
466
|
+
if source is None:
|
467
|
+
return None
|
468
|
+
if hasattr(source, "__array__"):
|
469
|
+
return np.asarray(source)
|
470
|
+
# Objects that implement mappings
|
471
|
+
is_mapping = (hasattr(source, 'keys') and hasattr(source, 'values') and
|
472
|
+
hasattr(source, 'items'))
|
473
|
+
# Objects that don't implement mappings, but do have dicts
|
474
|
+
if isinstance(source, np.generic):
|
475
|
+
# NumPy scalars are never mappings (PyPy issue workaround)
|
476
|
+
pass
|
477
|
+
elif not is_mapping and hasattr(source, '__dict__'):
|
478
|
+
source = {key: value for key, value in source.__dict__.items()
|
479
|
+
if not key.startswith('_')}
|
480
|
+
is_mapping = True
|
481
|
+
if is_mapping:
|
482
|
+
dtype = []
|
483
|
+
values = []
|
484
|
+
for field, value in source.items():
|
485
|
+
if isinstance(field, str):
|
486
|
+
if field[0] not in '_0123456789':
|
487
|
+
dtype.append((str(field), object))
|
488
|
+
values.append(value)
|
489
|
+
else:
|
490
|
+
msg = (f"Starting field name with a underscore "
|
491
|
+
f"or a digit ({field}) is ignored")
|
492
|
+
warnings.warn(msg, MatWriteWarning, stacklevel=2)
|
493
|
+
if dtype:
|
494
|
+
return np.array([tuple(values)], dtype)
|
495
|
+
else:
|
496
|
+
return EmptyStructMarker
|
497
|
+
# Next try and convert to an array
|
498
|
+
try:
|
499
|
+
narr = np.asanyarray(source)
|
500
|
+
except ValueError:
|
501
|
+
narr = np.asanyarray(source, dtype=object)
|
502
|
+
if narr.dtype.type in (object, np.object_) and \
|
503
|
+
narr.shape == () and narr == source:
|
504
|
+
# No interesting conversion possible
|
505
|
+
return None
|
506
|
+
return narr
|
507
|
+
|
508
|
+
|
509
|
+
# Native byte ordered dtypes for convenience for writers
|
510
|
+
NDT_FILE_HDR = MDTYPES[native_code]['dtypes']['file_header']
|
511
|
+
NDT_TAG_FULL = MDTYPES[native_code]['dtypes']['tag_full']
|
512
|
+
NDT_TAG_SMALL = MDTYPES[native_code]['dtypes']['tag_smalldata']
|
513
|
+
NDT_ARRAY_FLAGS = MDTYPES[native_code]['dtypes']['array_flags']
|
514
|
+
|
515
|
+
|
516
|
+
class VarWriter5:
|
517
|
+
''' Generic matlab matrix writing class '''
|
518
|
+
mat_tag = np.zeros((), NDT_TAG_FULL)
|
519
|
+
mat_tag['mdtype'] = miMATRIX
|
520
|
+
|
521
|
+
def __init__(self, file_writer):
|
522
|
+
self.file_stream = file_writer.file_stream
|
523
|
+
self.unicode_strings = file_writer.unicode_strings
|
524
|
+
self.long_field_names = file_writer.long_field_names
|
525
|
+
self.oned_as = file_writer.oned_as
|
526
|
+
# These are used for top level writes, and unset after
|
527
|
+
self._var_name = None
|
528
|
+
self._var_is_global = False
|
529
|
+
|
530
|
+
def write_bytes(self, arr):
|
531
|
+
self.file_stream.write(arr.tobytes(order='F'))
|
532
|
+
|
533
|
+
def write_string(self, s):
|
534
|
+
self.file_stream.write(s)
|
535
|
+
|
536
|
+
def write_element(self, arr, mdtype=None):
|
537
|
+
''' write tag and data '''
|
538
|
+
if mdtype is None:
|
539
|
+
mdtype = NP_TO_MTYPES[arr.dtype.str[1:]]
|
540
|
+
# Array needs to be in native byte order
|
541
|
+
if arr.dtype.byteorder == swapped_code:
|
542
|
+
arr = arr.byteswap().view(arr.dtype.newbyteorder())
|
543
|
+
byte_count = arr.size*arr.itemsize
|
544
|
+
if byte_count <= 4:
|
545
|
+
self.write_smalldata_element(arr, mdtype, byte_count)
|
546
|
+
else:
|
547
|
+
self.write_regular_element(arr, mdtype, byte_count)
|
548
|
+
|
549
|
+
def write_smalldata_element(self, arr, mdtype, byte_count):
|
550
|
+
# write tag with embedded data
|
551
|
+
tag = np.zeros((), NDT_TAG_SMALL)
|
552
|
+
tag['byte_count_mdtype'] = (byte_count << 16) + mdtype
|
553
|
+
# if arr.tobytes is < 4, the element will be zero-padded as needed.
|
554
|
+
tag['data'] = arr.tobytes(order='F')
|
555
|
+
self.write_bytes(tag)
|
556
|
+
|
557
|
+
def write_regular_element(self, arr, mdtype, byte_count):
|
558
|
+
# write tag, data
|
559
|
+
tag = np.zeros((), NDT_TAG_FULL)
|
560
|
+
tag['mdtype'] = mdtype
|
561
|
+
tag['byte_count'] = byte_count
|
562
|
+
self.write_bytes(tag)
|
563
|
+
self.write_bytes(arr)
|
564
|
+
# pad to next 64-bit boundary
|
565
|
+
bc_mod_8 = byte_count % 8
|
566
|
+
if bc_mod_8:
|
567
|
+
self.file_stream.write(b'\x00' * (8-bc_mod_8))
|
568
|
+
|
569
|
+
def write_header(self,
|
570
|
+
shape,
|
571
|
+
mclass,
|
572
|
+
is_complex=False,
|
573
|
+
is_logical=False,
|
574
|
+
nzmax=0):
|
575
|
+
''' Write header for given data options
|
576
|
+
shape : sequence
|
577
|
+
array shape
|
578
|
+
mclass - mat5 matrix class
|
579
|
+
is_complex - True if matrix is complex
|
580
|
+
is_logical - True if matrix is logical
|
581
|
+
nzmax - max non zero elements for sparse arrays
|
582
|
+
|
583
|
+
We get the name and the global flag from the object, and reset
|
584
|
+
them to defaults after we've used them
|
585
|
+
'''
|
586
|
+
# get name and is_global from one-shot object store
|
587
|
+
name = self._var_name
|
588
|
+
is_global = self._var_is_global
|
589
|
+
# initialize the top-level matrix tag, store position
|
590
|
+
self._mat_tag_pos = self.file_stream.tell()
|
591
|
+
self.write_bytes(self.mat_tag)
|
592
|
+
# write array flags (complex, global, logical, class, nzmax)
|
593
|
+
af = np.zeros((), NDT_ARRAY_FLAGS)
|
594
|
+
af['data_type'] = miUINT32
|
595
|
+
af['byte_count'] = 8
|
596
|
+
flags = is_complex << 3 | is_global << 2 | is_logical << 1
|
597
|
+
af['flags_class'] = mclass | flags << 8
|
598
|
+
af['nzmax'] = nzmax
|
599
|
+
self.write_bytes(af)
|
600
|
+
# shape
|
601
|
+
self.write_element(np.array(shape, dtype='i4'))
|
602
|
+
# write name
|
603
|
+
name = np.asarray(name)
|
604
|
+
if name == '': # empty string zero-terminated
|
605
|
+
self.write_smalldata_element(name, miINT8, 0)
|
606
|
+
else:
|
607
|
+
self.write_element(name, miINT8)
|
608
|
+
# reset the one-shot store to defaults
|
609
|
+
self._var_name = ''
|
610
|
+
self._var_is_global = False
|
611
|
+
|
612
|
+
def update_matrix_tag(self, start_pos):
|
613
|
+
curr_pos = self.file_stream.tell()
|
614
|
+
self.file_stream.seek(start_pos)
|
615
|
+
byte_count = curr_pos - start_pos - 8
|
616
|
+
if byte_count >= 2**32:
|
617
|
+
raise MatWriteError("Matrix too large to save with Matlab "
|
618
|
+
"5 format")
|
619
|
+
self.mat_tag['byte_count'] = byte_count
|
620
|
+
self.write_bytes(self.mat_tag)
|
621
|
+
self.file_stream.seek(curr_pos)
|
622
|
+
|
623
|
+
def write_top(self, arr, name, is_global):
|
624
|
+
""" Write variable at top level of mat file
|
625
|
+
|
626
|
+
Parameters
|
627
|
+
----------
|
628
|
+
arr : array_like
|
629
|
+
array-like object to create writer for
|
630
|
+
name : str, optional
|
631
|
+
name as it will appear in matlab workspace
|
632
|
+
default is empty string
|
633
|
+
is_global : {False, True}, optional
|
634
|
+
whether variable will be global on load into matlab
|
635
|
+
"""
|
636
|
+
# these are set before the top-level header write, and unset at
|
637
|
+
# the end of the same write, because they do not apply for lower levels
|
638
|
+
self._var_is_global = is_global
|
639
|
+
self._var_name = name
|
640
|
+
# write the header and data
|
641
|
+
self.write(arr)
|
642
|
+
|
643
|
+
def write(self, arr):
|
644
|
+
''' Write `arr` to stream at top and sub levels
|
645
|
+
|
646
|
+
Parameters
|
647
|
+
----------
|
648
|
+
arr : array_like
|
649
|
+
array-like object to create writer for
|
650
|
+
'''
|
651
|
+
# store position, so we can update the matrix tag
|
652
|
+
mat_tag_pos = self.file_stream.tell()
|
653
|
+
# First check if these are sparse
|
654
|
+
if scipy.sparse.issparse(arr):
|
655
|
+
self.write_sparse(arr)
|
656
|
+
self.update_matrix_tag(mat_tag_pos)
|
657
|
+
return
|
658
|
+
# Try to convert things that aren't arrays
|
659
|
+
narr = to_writeable(arr)
|
660
|
+
if narr is None:
|
661
|
+
raise TypeError(f'Could not convert {arr} (type {type(arr)}) to array')
|
662
|
+
if isinstance(narr, MatlabObject):
|
663
|
+
self.write_object(narr)
|
664
|
+
elif isinstance(narr, MatlabFunction):
|
665
|
+
raise MatWriteError('Cannot write matlab functions')
|
666
|
+
elif narr is EmptyStructMarker: # empty struct array
|
667
|
+
self.write_empty_struct()
|
668
|
+
elif narr.dtype.fields: # struct array
|
669
|
+
self.write_struct(narr)
|
670
|
+
elif narr.dtype.hasobject: # cell array
|
671
|
+
self.write_cells(narr)
|
672
|
+
elif narr.dtype.kind in ('U', 'S'):
|
673
|
+
if self.unicode_strings:
|
674
|
+
codec = 'UTF8'
|
675
|
+
else:
|
676
|
+
codec = 'ascii'
|
677
|
+
self.write_char(narr, codec)
|
678
|
+
else:
|
679
|
+
self.write_numeric(narr)
|
680
|
+
self.update_matrix_tag(mat_tag_pos)
|
681
|
+
|
682
|
+
def write_numeric(self, arr):
|
683
|
+
imagf = arr.dtype.kind == 'c'
|
684
|
+
logif = arr.dtype.kind == 'b'
|
685
|
+
try:
|
686
|
+
mclass = NP_TO_MXTYPES[arr.dtype.str[1:]]
|
687
|
+
except KeyError:
|
688
|
+
# No matching matlab type, probably complex256 / float128 / float96
|
689
|
+
# Cast data to complex128 / float64.
|
690
|
+
if imagf:
|
691
|
+
arr = arr.astype('c128')
|
692
|
+
elif logif:
|
693
|
+
arr = arr.astype('i1') # Should only contain 0/1
|
694
|
+
else:
|
695
|
+
arr = arr.astype('f8')
|
696
|
+
mclass = mxDOUBLE_CLASS
|
697
|
+
self.write_header(matdims(arr, self.oned_as),
|
698
|
+
mclass,
|
699
|
+
is_complex=imagf,
|
700
|
+
is_logical=logif)
|
701
|
+
if imagf:
|
702
|
+
self.write_element(arr.real)
|
703
|
+
self.write_element(arr.imag)
|
704
|
+
else:
|
705
|
+
self.write_element(arr)
|
706
|
+
|
707
|
+
def write_char(self, arr, codec='ascii'):
|
708
|
+
''' Write string array `arr` with given `codec`
|
709
|
+
'''
|
710
|
+
if arr.size == 0 or np.all(arr == ''):
|
711
|
+
# This an empty string array or a string array containing
|
712
|
+
# only empty strings. Matlab cannot distinguish between a
|
713
|
+
# string array that is empty, and a string array containing
|
714
|
+
# only empty strings, because it stores strings as arrays of
|
715
|
+
# char. There is no way of having an array of char that is
|
716
|
+
# not empty, but contains an empty string. We have to
|
717
|
+
# special-case the array-with-empty-strings because even
|
718
|
+
# empty strings have zero padding, which would otherwise
|
719
|
+
# appear in matlab as a string with a space.
|
720
|
+
shape = (0,) * np.max([arr.ndim, 2])
|
721
|
+
self.write_header(shape, mxCHAR_CLASS)
|
722
|
+
self.write_smalldata_element(arr, miUTF8, 0)
|
723
|
+
return
|
724
|
+
# non-empty string.
|
725
|
+
#
|
726
|
+
# Convert to char array
|
727
|
+
arr = arr_to_chars(arr)
|
728
|
+
# We have to write the shape directly, because we are going
|
729
|
+
# recode the characters, and the resulting stream of chars
|
730
|
+
# may have a different length
|
731
|
+
shape = arr.shape
|
732
|
+
self.write_header(shape, mxCHAR_CLASS)
|
733
|
+
if arr.dtype.kind == 'U' and arr.size:
|
734
|
+
# Make one long string from all the characters. We need to
|
735
|
+
# transpose here, because we're flattening the array, before
|
736
|
+
# we write the bytes. The bytes have to be written in
|
737
|
+
# Fortran order.
|
738
|
+
n_chars = math.prod(shape)
|
739
|
+
st_arr = np.ndarray(shape=(),
|
740
|
+
dtype=arr_dtype_number(arr, n_chars),
|
741
|
+
buffer=arr.T.copy()) # Fortran order
|
742
|
+
# Recode with codec to give byte string
|
743
|
+
st = st_arr.item().encode(codec)
|
744
|
+
# Reconstruct as 1-D byte array
|
745
|
+
arr = np.ndarray(shape=(len(st),),
|
746
|
+
dtype='S1',
|
747
|
+
buffer=st)
|
748
|
+
self.write_element(arr, mdtype=miUTF8)
|
749
|
+
|
750
|
+
def write_sparse(self, arr):
|
751
|
+
''' Sparse matrices are 2D
|
752
|
+
'''
|
753
|
+
A = arr.tocsc() # convert to sparse CSC format
|
754
|
+
A.sort_indices() # MATLAB expects sorted row indices
|
755
|
+
is_complex = (A.dtype.kind == 'c')
|
756
|
+
is_logical = (A.dtype.kind == 'b')
|
757
|
+
nz = A.nnz
|
758
|
+
self.write_header(matdims(arr, self.oned_as),
|
759
|
+
mxSPARSE_CLASS,
|
760
|
+
is_complex=is_complex,
|
761
|
+
is_logical=is_logical,
|
762
|
+
# matlab won't load file with 0 nzmax
|
763
|
+
nzmax=1 if nz == 0 else nz)
|
764
|
+
self.write_element(A.indices.astype('i4'))
|
765
|
+
self.write_element(A.indptr.astype('i4'))
|
766
|
+
self.write_element(A.data.real)
|
767
|
+
if is_complex:
|
768
|
+
self.write_element(A.data.imag)
|
769
|
+
|
770
|
+
def write_cells(self, arr):
|
771
|
+
self.write_header(matdims(arr, self.oned_as),
|
772
|
+
mxCELL_CLASS)
|
773
|
+
# loop over data, column major
|
774
|
+
A = np.atleast_2d(arr).flatten('F')
|
775
|
+
for el in A:
|
776
|
+
self.write(el)
|
777
|
+
|
778
|
+
def write_empty_struct(self):
|
779
|
+
self.write_header((1, 1), mxSTRUCT_CLASS)
|
780
|
+
# max field name length set to 1 in an example matlab struct
|
781
|
+
self.write_element(np.array(1, dtype=np.int32))
|
782
|
+
# Field names element is empty
|
783
|
+
self.write_element(np.array([], dtype=np.int8))
|
784
|
+
|
785
|
+
def write_struct(self, arr):
|
786
|
+
self.write_header(matdims(arr, self.oned_as),
|
787
|
+
mxSTRUCT_CLASS)
|
788
|
+
self._write_items(arr)
|
789
|
+
|
790
|
+
def _write_items(self, arr):
|
791
|
+
# write fieldnames
|
792
|
+
fieldnames = [f[0] for f in arr.dtype.descr]
|
793
|
+
length = max([len(fieldname) for fieldname in fieldnames])+1
|
794
|
+
max_length = (self.long_field_names and 64) or 32
|
795
|
+
if length > max_length:
|
796
|
+
raise ValueError(
|
797
|
+
f"Field names are restricted to {max_length - 1} characters"
|
798
|
+
)
|
799
|
+
self.write_element(np.array([length], dtype='i4'))
|
800
|
+
self.write_element(np.array(fieldnames, dtype=f'S{length}'), mdtype=miINT8)
|
801
|
+
A = np.atleast_2d(arr).flatten('F')
|
802
|
+
for el in A:
|
803
|
+
for f in fieldnames:
|
804
|
+
self.write(el[f])
|
805
|
+
|
806
|
+
def write_object(self, arr):
|
807
|
+
'''Same as writing structs, except different mx class, and extra
|
808
|
+
classname element after header
|
809
|
+
'''
|
810
|
+
self.write_header(matdims(arr, self.oned_as),
|
811
|
+
mxOBJECT_CLASS)
|
812
|
+
self.write_element(np.array(arr.classname, dtype='S'),
|
813
|
+
mdtype=miINT8)
|
814
|
+
self._write_items(arr)
|
815
|
+
|
816
|
+
|
817
|
+
class MatFile5Writer:
|
818
|
+
''' Class for writing mat5 files '''
|
819
|
+
|
820
|
+
@docfiller
|
821
|
+
def __init__(self, file_stream,
|
822
|
+
do_compression=False,
|
823
|
+
unicode_strings=False,
|
824
|
+
global_vars=None,
|
825
|
+
long_field_names=False,
|
826
|
+
oned_as='row'):
|
827
|
+
''' Initialize writer for matlab 5 format files
|
828
|
+
|
829
|
+
Parameters
|
830
|
+
----------
|
831
|
+
%(do_compression)s
|
832
|
+
%(unicode_strings)s
|
833
|
+
global_vars : None or sequence of strings, optional
|
834
|
+
Names of variables to be marked as global for matlab
|
835
|
+
%(long_fields)s
|
836
|
+
%(oned_as)s
|
837
|
+
'''
|
838
|
+
self.file_stream = file_stream
|
839
|
+
self.do_compression = do_compression
|
840
|
+
self.unicode_strings = unicode_strings
|
841
|
+
if global_vars:
|
842
|
+
self.global_vars = global_vars
|
843
|
+
else:
|
844
|
+
self.global_vars = []
|
845
|
+
self.long_field_names = long_field_names
|
846
|
+
self.oned_as = oned_as
|
847
|
+
self._matrix_writer = None
|
848
|
+
|
849
|
+
def write_file_header(self):
|
850
|
+
# write header
|
851
|
+
hdr = np.zeros((), NDT_FILE_HDR)
|
852
|
+
hdr['description'] = (f'MATLAB 5.0 MAT-file Platform: {os.name}, '
|
853
|
+
f'Created on: {time.asctime()}')
|
854
|
+
hdr['version'] = 0x0100
|
855
|
+
hdr['endian_test'] = np.ndarray(shape=(),
|
856
|
+
dtype='S2',
|
857
|
+
buffer=np.uint16(0x4d49))
|
858
|
+
self.file_stream.write(hdr.tobytes())
|
859
|
+
|
860
|
+
def put_variables(self, mdict, write_header=None):
|
861
|
+
''' Write variables in `mdict` to stream
|
862
|
+
|
863
|
+
Parameters
|
864
|
+
----------
|
865
|
+
mdict : mapping
|
866
|
+
mapping with method ``items`` returns name, contents pairs where
|
867
|
+
``name`` which will appear in the matlab workspace in file load, and
|
868
|
+
``contents`` is something writeable to a matlab file, such as a NumPy
|
869
|
+
array.
|
870
|
+
write_header : {None, True, False}, optional
|
871
|
+
If True, then write the matlab file header before writing the
|
872
|
+
variables. If None (the default) then write the file header
|
873
|
+
if we are at position 0 in the stream. By setting False
|
874
|
+
here, and setting the stream position to the end of the file,
|
875
|
+
you can append variables to a matlab file
|
876
|
+
'''
|
877
|
+
# write header if requested, or None and start of file
|
878
|
+
if write_header is None:
|
879
|
+
write_header = self.file_stream.tell() == 0
|
880
|
+
if write_header:
|
881
|
+
self.write_file_header()
|
882
|
+
self._matrix_writer = VarWriter5(self)
|
883
|
+
for name, var in mdict.items():
|
884
|
+
if name[0] == '_':
|
885
|
+
msg = (f"Starting field name with a "
|
886
|
+
f"underscore ({name}) is ignored")
|
887
|
+
warnings.warn(msg, MatWriteWarning, stacklevel=2)
|
888
|
+
continue
|
889
|
+
is_global = name in self.global_vars
|
890
|
+
if self.do_compression:
|
891
|
+
stream = BytesIO()
|
892
|
+
self._matrix_writer.file_stream = stream
|
893
|
+
self._matrix_writer.write_top(var, name.encode('latin1'), is_global)
|
894
|
+
out_str = zlib.compress(stream.getvalue())
|
895
|
+
tag = np.empty((), NDT_TAG_FULL)
|
896
|
+
tag['mdtype'] = miCOMPRESSED
|
897
|
+
tag['byte_count'] = len(out_str)
|
898
|
+
self.file_stream.write(tag.tobytes())
|
899
|
+
self.file_stream.write(out_str)
|
900
|
+
else: # not compressing
|
901
|
+
self._matrix_writer.write_top(var, name.encode('latin1'), is_global)
|