U
    Hvf                   -   @   s  d Z ddlZddlmZ ddddd	d
dddddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1g-ZdZd2Zd3Zd4Z	d5Z
d6Zd7Zd8Zd9Zd:Zd;Zd<Zd=Zd>Zd?ZdZd2Zd3Zd4Zd5Zd6Zd7Zd@Zd8ZdAZdBZd9Z d:Z!d;Z"d<Z#d=Z$d>Z%d?Z&edCedDedEe	dFe
dGedHedIedJedKedLedDedFedHdMdNdOdPdQgdRdSdTgdUdVdWgdXdYdTdZd[gd\d\iZ'edCedDedEedFe dGe!dHe"dKe#dLedIedJi
Z(ed]ed^ed_ed`e dae!dbe"dce#ddedeedfedgedhediedjedke$dle%dmiZ)eeeeeeee
eeeee	eeeednZ*eeeeeee"e eee#e!eeeedoZ+edpddqedrd2dqedsd4dqiZ,dtdu Z-i Z.dvD ],Z/ee'e/ee(e/e-e,e/dwZ0e0e.e/< qRG dxd dZ1G dyd dej2Z3G dzd dej2Z4G d{d dej2Z5e6d|d}d~dgZ7dS )z Constants and classes for matlab 5 read and write

See also mio5_utils.pyx where these same constants arise as c enums.

If you make changes in this file, don't forget to change mio5_utils.pyx
    N   )convert_dtypesMDTYPESMatlabFunctionMatlabObjectMatlabOpaqueNP_TO_MTYPESNP_TO_MXTYPESOPAQUE_DTYPEcodecs_template
mat_structmclass_dtypes_templatemclass_infomdtypes_templatemiCOMPRESSEDmiDOUBLEmiINT16miINT32miINT64miINT8miMATRIXmiSINGLEmiUINT16miUINT32miUINT64miUINT8miUTF16miUTF32miUTF8mxCELL_CLASSmxCHAR_CLASSmxDOUBLE_CLASSmxFUNCTION_CLASSmxINT16_CLASSmxINT32_CLASSmxINT64_CLASSmxINT8_CLASSmxOBJECT_CLASSmxOBJECT_CLASS_FROM_MATRIX_HmxOPAQUE_CLASSmxSINGLE_CLASSmxSPARSE_CLASSmxSTRUCT_CLASSmxUINT16_CLASSmxUINT32_CLASSmxUINT64_CLASSmxUINT8_CLASS                  	                           
      i1u1i2u2i4u4f4f8i8u8Zfile_header)descriptionZS116)Zsubsystem_offsetrJ   )versionrE   )Zendian_testZS2Ztag_full)ZmdtyperG   )Z
byte_countrG   Ztag_smalldata)Zbyte_count_mdtyperG   )dataZS4Zarray_flags)Z	data_typerG   )Zflags_classrG   )ZnzmaxrG   U1Zint8Zuint8Zint16Zuint16Zint32Zuint32Zint64Zuint64Zsingledoublecellstructobjectcharsparsefunctionopaque)rI   c32c24c16rH   c8rJ   rF   rD   rB   rK   rG   rE   rC   S1rO   b1)rI   rX   rY   rZ   rH   r[   rJ   rF   rD   rB   rK   rG   rE   rC   r\   r]   utf_8)codecwidthutf_16utf_32c              	   C   s   i }|dkrdpd}|   D ]\\}}|d }zd| W n  tk
rZ   d||< Y qY nX |d dkrp||7 }|||< q| S )	a   Convert codec template mapping to byte order

    Set codecs not on this system to None

    Parameters
    ----------
    template : mapping
       key, value are respectively codec name, and root name for codec
       (without byte order suffix)
    byte_order : {'<', '>'}
       code for little or big endian

    Returns
    -------
    codecs : dict
       key, value are name, codec (as in .encode(codec))
    <Z_le_ber_    Nr`   r   )itemsencodeLookupErrorcopy)templateZ
byte_ordercodecsZpostfixkvr_    rn   @/tmp/pip-unpacked-wheel-96ln3f52/scipy/io/matlab/_mio5_params.py_convert_codecs   s    

rp   z<>)Zdtypesclassesrk   c                   @   s   e Zd ZdZdS )r   zPlaceholder for holding read data from structs.

    We use instances of this class when the user passes False as a value to the
    ``struct_as_record`` parameter of the :func:`scipy.io.loadmat` function.
    N)__name__
__module____qualname____doc__rn   rn   rn   ro   r      s   c                   @   s"   e Zd ZdZdddZdd ZdS )r   zSubclass of ndarray to signal this is a matlab object.

    This is a simple subclass of :class:`numpy.ndarray` meant to be used
    by :func:`scipy.io.loadmat` and should not be instantiated directly.
    Nc                 C   s   t || }||_|S N)npasarrayview	classname)clsinput_arrayrz   objrn   rn   ro   __new__   s    zMatlabObject.__new__c                 C   s   t |dd | _d S )Nrz   )getattrrz   )selfr}   rn   rn   ro   __array_finalize__   s    zMatlabObject.__array_finalize__)N)rr   rs   rt   ru   r~   r   rn   rn   rn   ro   r      s   
	c                   @   s   e Zd ZdZdd ZdS )r   zSubclass for a MATLAB function.

    This is a simple subclass of :class:`numpy.ndarray` meant to be used
    by :func:`scipy.io.loadmat` and should not be directly instantiated.
    c                 C   s   t || }|S rv   rw   rx   ry   r{   r|   r}   rn   rn   ro   r~     s    zMatlabFunction.__new__Nrr   rs   rt   ru   r~   rn   rn   rn   ro   r      s   c                   @   s   e Zd ZdZdd ZdS )r   zSubclass for a MATLAB opaque matrix.

    This is a simple subclass of :class:`numpy.ndarray` meant to be used
    by :func:`scipy.io.loadmat` and should not be directly instantiated.
    c                 C   s   t || }|S rv   r   r   rn   rn   ro   r~     s    zMatlabOpaque.__new__Nr   rn   rn   rn   ro   r     s   )s0O)s1r   )s2r   )Zarrr   )8ru   Znumpyrw   Z_miobaser   __all__r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r,   r'   r    r+   r!   r*   r&   r0   r#   r-   r$   r.   r%   r/   r"   r)   r(   r   r   r   r   r	   r   rp   r   Z	_bytecodeZ_defr   Zndarrayr   r   r   Zdtyper
   rn   rn   rn   ro   <module>   s                                                                                    !	
