a
    Re                   $   @   sx  d Z ddlZddlmZ g 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%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!g d"d#d$d%gd&d'd(gd)g d*d+d+iZ'edededede de!de"de#d ededi
Z(ed,ed-ed.ed/e d0e!d1e"d2e#d3ed4ed5ed6ed7ed8ed9ed:e$d;e%d<iZ)eeeeeeee
eeeee	eeeed=Z*eeeeeee"e eee#e!eeeed>Z+ed?dd@edAdd@edBdd@iZ,dCdD Z-i Z.dED ],Z/ee'e/ee(e/e-e,e/dFZ0e0e.e/< qG dGdH dHZ1G dIdJ dJej2Z3G dKdL dLej2Z4G dMdN dNej2Z5e6g dOZ7dS )Pz 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   rN   )Zflags_classrG   )ZnzmaxrG   U1Zint8Zuint8int16Zuint16int32Zuint32int64Zuint64singledoublecellstructobjectcharsparsefunctionopaque)rI   c32c24c16rH   c8rJ   rF   rD   rB   rK   rG   rE   rC   S1rP   b1)rI   r]   r^   r_   rH   r`   rJ   rF   rD   rB   rK   rG   rE   rC   ra   rb   utf_8)codecwidthutf_16utf_32c              	   C   s   i }|dkrdpd}|   D ]Z\}}|d }zd| W n tyX   d||< Y qY n0 |d dkrn||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_berd    Nre   r   )itemsencodeLookupErrorcopy)templateZ
byte_ordercodecsZpostfixkvrd    rs   P/var/www/sunrise/env/lib/python3.9/site-packages/scipy/io/matlab/_mio5_params.py_convert_codecs   s    

ru   z<>)Zdtypesclassesrp   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__rs   rs   rs   rt   r      s   r   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_arrayr   objrs   rs   rt   __new__   s    zMatlabObject.__new__c                 C   s   t |dd | _d S )Nr   )getattrr   )selfr   rs   rs   rt   __array_finalize__   s    zMatlabObject.__array_finalize__)N)rw   rx   ry   rz   r   r   rs   rs   rs   rt   r      s   
	r   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 r{   r|   r}   r~   r   r   r   rs   rs   rt   r     s    zMatlabFunction.__new__Nrw   rx   ry   rz   r   rs   rs   rs   rt   r      s   r   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 r{   r   r   rs   rs   rt   r     s    zMatlabOpaque.__new__Nr   rs   rs   rs   rt   r     s   r   ))s0O)s1r   )s2r   )Zarrr   )8rz   numpyr|   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   ru   r   Z	_bytecodeZ_defr   Zndarrayr   r   r   Zdtyper
   rs   rs   rs   rt   <module>   s  


!	