3
Pdc              &   @   s  d Z ddlZddlmZ dZdZdZdZdZ	d	Z
d
ZdZdZdZdZdZdZdZdZdZdZdZdZdZd	Zd
ZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%edededede	de
dedededededededd d[d\d]d^gd'd_d`gd*dadbgd.dcdddedfgd2d2iZ&ededededede de!de"dededi
Z'ed3ed4ed5ed6ed7e d8e!d9e"d:ed;ed<ed=ed>ed?ed@edAe#dBe$dCiZ(eeeeeeee	eeee
eeeeedDZ)eeeeeee!eeee"e eeeedEZ*edFddGedHddGedIddGiZ+dJdK Z,i Z-x4dLD ],Z.ee&e.ee'e.e,e+e.dMZ/e/e-e.< qW G dNdO dOe0Z1G dPdQ dQej2Z3G dRdS dSej2Z4G dTdU dUej2Z5ej6dgdhdidjgZ7dS )kz 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                  	                           
      i1u1i2u2i4u4f4f8i8u8Zfile_headerdescriptionS116subsystem_offsetversionendian_testS2Ztag_fullmdtype
byte_countZtag_smalldatabyte_count_mdtypedataS4Zarray_flags	data_typeflags_classnzmaxU1Zint8Zuint8Zint16Zuint16Zint32Zuint32Zint64Zuint64Zsingledoublecellstructobjectcharsparsefunctionopaque)r   c32c24c16r   c8r   r   r   r   r   r   r   r   S1r-   b1)r   r6   r7   r8   r   r9   r   r   r   r   r   r   r   r   r:   r;   utf_8)codecwidthutf_16utf_32c             C   s   i }|dkrdpd}xf| j  D ]Z\}}|d }ydj| W n tk
rZ   d||< wY nX |d dkrp||7 }|||< qW |j 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=    rL   O/var/www/html/virt/lib64/python3.6/site-packages/scipy/io/matlab/mio5_params.py_convert_codecs   s    rN   z<>)ZdtypesclassesrI   c               @   s   e Zd ZdZdS )
mat_structz Placeholder 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.matlab.loadmat`
    function.
    N)__name__
__module____qualname____doc__rL   rL   rL   rM   rP      s   rP   c               @   s"   e Zd ZdZdddZdd ZdS )MatlabObjectz+ ndarray Subclass to contain matlab object Nc             C   s   t j|j| }||_|S )N)npasarrayview	classname)clsinput_arrayrY   objrL   rL   rM   __new__   s    zMatlabObject.__new__c             C   s   t |dd | _d S )NrY   )getattrrY   )selfr\   rL   rL   rM   __array_finalize__   s    zMatlabObject.__array_finalize__)N)rQ   rR   rS   rT   r]   r`   rL   rL   rL   rM   rU      s   
	rU   c               @   s   e Zd ZdZdd ZdS )MatlabFunctionz. Subclass to signal this is a matlab function c             C   s   t j|j| }|S )N)rV   rW   rX   )rZ   r[   r\   rL   rL   rM   r]      s    zMatlabFunction.__new__N)rQ   rR   rS   rT   r]   rL   rL   rL   rM   ra      s   ra   c               @   s   e Zd ZdZdd ZdS )MatlabOpaquez3 Subclass to signal this is a matlab opaque matrix c             C   s   t j|j| }|S )N)rV   rW   rX   )rZ   r[   r\   rL   rL   rM   r]      s    zMatlabOpaque.__new__N)rQ   rR   rS   rT   r]   rL   rL   rL   rM   rb      s   rb   s0Os1s2arr)r   r    )r!   r   )r"   r   )r#   r$   )r%   r   )r&   r   )r'   r   )r(   r)   )r*   r   )r&   r   )r+   r   )r,   r   )rc   rd   )re   rd   )rf   rd   )rg   rd   )8rT   ZnumpyrV   Zmiobaser   ZmiINT8ZmiUINT8ZmiINT16ZmiUINT16ZmiINT32ZmiUINT32ZmiSINGLEZmiDOUBLEZmiINT64ZmiUINT64ZmiMATRIXZmiCOMPRESSEDZmiUTF8ZmiUTF16ZmiUTF32ZmxCELL_CLASSZmxSTRUCT_CLASSZmxOBJECT_CLASSZmxCHAR_CLASSZmxSPARSE_CLASSZmxDOUBLE_CLASSZmxSINGLE_CLASSZmxINT8_CLASSZmxUINT8_CLASSZmxINT16_CLASSZmxUINT16_CLASSZmxINT32_CLASSZmxUINT32_CLASSZmxINT64_CLASSZmxUINT64_CLASSZmxFUNCTION_CLASSZmxOPAQUE_CLASSZmxOBJECT_CLASS_FROM_MATRIX_HZmdtypes_templateZmclass_dtypes_templateZmclass_infoZNP_TO_MTYPESZNP_TO_MXTYPESZcodecs_templaterN   ZMDTYPESZ	_bytecodeZ_defr1   rP   ZndarrayrU   ra   rb   ZdtypeZOPAQUE_DTYPErL   rL   rL   rM   <module>   s  	

!

