mio4.py 1.2 KB

123456789101112131415161718192021222324252627282930313233
  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 _mio4
  6. __all__ = [ # noqa: F822
  7. 'MatFile4Reader', 'MatFile4Writer', 'SYS_LITTLE_ENDIAN',
  8. 'VarHeader4', 'VarReader4', 'VarWriter4', 'arr_to_2d', 'mclass_info',
  9. 'mdtypes_template', 'miDOUBLE', 'miINT16', 'miINT32', 'miSINGLE',
  10. 'miUINT16', 'miUINT8', 'mxCHAR_CLASS', 'mxFULL_CLASS', 'mxSPARSE_CLASS',
  11. 'np_to_mtypes', 'order_codes', 'MatFileReader', 'docfiller',
  12. 'matdims', 'read_dtype', 'convert_dtypes', 'arr_to_chars',
  13. 'arr_dtype_number', 'squeeze_element', 'chars_to_strings'
  14. ]
  15. def __dir__():
  16. return __all__
  17. def __getattr__(name):
  18. if name not in __all__:
  19. raise AttributeError(
  20. "scipy.io.matlab.mio4 is deprecated and has no attribute "
  21. f"{name}. Try looking in scipy.io.matlab instead.")
  22. warnings.warn(f"Please use `{name}` from the `scipy.io.matlab` namespace, "
  23. "the `scipy.io.matlab.mio4` namespace is deprecated.",
  24. category=DeprecationWarning, stacklevel=2)
  25. return getattr(_mio4, name)