Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.9/dist-packages/scipy/io/matlab/mio5.py: 70%

10 statements  

« prev     ^ index     » next       coverage.py v7.3.1, created at 2023-09-23 06:43 +0000

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 

5import warnings 

6from . import _mio5 

7 

8 

9__all__ = [ # noqa: F822 

10 'mclass_info', 'mxCHAR_CLASS', 'mxSPARSE_CLASS', 

11 'BytesIO', 'native_code', 

12 'swapped_code', 'MatFileReader', 'docfiller', 'matdims', 

13 'read_dtype', 'arr_to_chars', 'arr_dtype_number', 'MatWriteError', 

14 'MatReadError', 'MatReadWarning', 'VarReader5', 'MatlabObject', 

15 'MatlabFunction', 'MDTYPES', 'NP_TO_MTYPES', 'NP_TO_MXTYPES', 

16 'miCOMPRESSED', 'miMATRIX', 'miINT8', 'miUTF8', 'miUINT32', 

17 'mxCELL_CLASS', 'mxSTRUCT_CLASS', 'mxOBJECT_CLASS', 'mxDOUBLE_CLASS', 

18 'mat_struct', 'ZlibInputStream', 'MatFile5Reader', 'varmats_from_mat', 

19 'EmptyStructMarker', 'to_writeable', 'NDT_FILE_HDR', 'NDT_TAG_FULL', 

20 'NDT_TAG_SMALL', 'NDT_ARRAY_FLAGS', 'VarWriter5', 'MatFile5Writer' 

21] 

22 

23def __dir__(): 

24 return __all__ 

25 

26 

27def __getattr__(name): 

28 if name not in __all__: 

29 raise AttributeError( 

30 "scipy.io.matlab.mio5 is deprecated and has no attribute " 

31 f"{name}. Try looking in scipy.io.matlab instead.") 

32 

33 warnings.warn(f"Please use `{name}` from the `scipy.io.matlab` namespace, " 

34 "the `scipy.io.matlab.mio5` namespace is deprecated.", 

35 category=DeprecationWarning, stacklevel=2) 

36 

37 return getattr(_mio5, name)