mio5.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # This file is not meant for public use and will be removed in SciPy v2.0.0.
  2. # Use the `scipy.io.matlab` namespace for importing the functions
  3. # included below.
  4. import warnings
  5. from . import _mio5
  6. __all__ = [ # noqa: F822
  7. 'mclass_info', 'mxCHAR_CLASS', 'mxSPARSE_CLASS',
  8. 'BytesIO', 'native_code',
  9. 'swapped_code', 'MatFileReader', 'docfiller', 'matdims',
  10. 'read_dtype', 'arr_to_chars', 'arr_dtype_number', 'MatWriteError',
  11. 'MatReadError', 'MatReadWarning', 'VarReader5', 'MatlabObject',
  12. 'MatlabFunction', 'MDTYPES', 'NP_TO_MTYPES', 'NP_TO_MXTYPES',
  13. 'miCOMPRESSED', 'miMATRIX', 'miINT8', 'miUTF8', 'miUINT32',
  14. 'mxCELL_CLASS', 'mxSTRUCT_CLASS', 'mxOBJECT_CLASS', 'mxDOUBLE_CLASS',
  15. 'mat_struct', 'ZlibInputStream', 'MatFile5Reader', 'varmats_from_mat',
  16. 'EmptyStructMarker', 'to_writeable', 'NDT_FILE_HDR', 'NDT_TAG_FULL',
  17. 'NDT_TAG_SMALL', 'NDT_ARRAY_FLAGS', 'VarWriter5', 'MatFile5Writer'
  18. ]
  19. def __dir__():
  20. return __all__
  21. def __getattr__(name):
  22. if name not in __all__:
  23. raise AttributeError(
  24. "scipy.io.matlab.mio5 is deprecated and has no attribute "
  25. f"{name}. Try looking in scipy.io.matlab instead.")
  26. warnings.warn(f"Please use `{name}` from the `scipy.io.matlab` namespace, "
  27. "the `scipy.io.matlab.mio5` namespace is deprecated.",
  28. category=DeprecationWarning, stacklevel=2)
  29. return getattr(_mio5, name)