o
    Ge[                     @   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%i 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'i ed+ed,ed-ed.ed/e d0e!d1e"d2ed3ed4ed5ed6ed7ed8ed9e#d:e$d;Z(i 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eded@ed*edAeZ)i 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eded@edAeZ*	 edBddCedDddCedEddCiZ+dFdG Z,i Z-dHD ]Z.ee&e.ee'e.e,e+e.dIZ/e/e-e.< q[G dJdK dKZ0G dLdM dMej1Z2G dNdO dOej1Z3G dPdQ dQej1Z4e5g dRZ6dS )Sz 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u8file_header))descriptionS116)subsystem_offsetr   )versionr   )endian_testS2tag_full)mdtyper   
byte_countr   tag_smalldata)byte_count_mdtyper   )dataS4array_flags))	data_typer   r(   )flags_classr   )nzmaxr   U1int8uint8int16uint16int32uint32int64uint64singledoublecellstructobjectcharsparsefunctionopaquec32c24c16c8S1b1utf_8)codecwidthutf_16utf_32c              	   C   s|   i }|dkrdp	d}|   D ]+\}}|d }zd| W n ty*   d||< Y qw |d dkr5||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))
    <_le_berK    NrL   r   )itemsencodeLookupErrorcopy)template
byte_ordercodecspostfixkvrK    r]   e/var/www/html/SPIRAL.web.tool/spiral_venv/lib/python3.10/site-packages/scipy/io/matlab/mio5_params.py_convert_codecs   s   
r_   z<>)dtypesclassesrY   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__r]   r]   r]   r^   rb      s    rb   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 || }||_|S N)npasarrayview	classname)clsinput_arrayrl   objr]   r]   r^   __new__   s   zMatlabObject.__new__c                 C   s   t |dd | _d S )Nrl   )getattrrl   )selfro   r]   r]   r^   __array_finalize__   s   zMatlabObject.__array_finalize__rh   )rc   rd   re   rf   rp   rs   r]   r]   r]   r^   rg      s    
	rg   c                   @      e Zd ZdZdd ZdS )MatlabFunctionz. Subclass to signal this is a matlab function c                 C      t || }|S rh   ri   rj   rk   rm   rn   ro   r]   r]   r^   rp         zMatlabFunction.__new__Nrc   rd   re   rf   rp   r]   r]   r]   r^   ru          ru   c                   @   rt   )MatlabOpaquez3 Subclass to signal this is a matlab opaque matrix c                 C   rv   rh   rw   rx   r]   r]   r^   rp      ry   zMatlabOpaque.__new__Nrz   r]   r]   r]   r^   r|      r{   r|   ))s0O)s1r~   )s2r~   )arrr~   )7rf   numpyri   miobaser   miINT8miUINT8miINT16miUINT16miINT32miUINT32miSINGLEmiDOUBLEmiINT64miUINT64miMATRIXmiCOMPRESSEDmiUTF8miUTF16miUTF32mxCELL_CLASSmxSTRUCT_CLASSmxOBJECT_CLASSmxCHAR_CLASSmxSPARSE_CLASSmxDOUBLE_CLASSmxSINGLE_CLASSmxINT8_CLASSmxUINT8_CLASSmxINT16_CLASSmxUINT16_CLASSmxINT32_CLASSmxUINT32_CLASSmxINT64_CLASSmxUINT64_CLASSmxFUNCTION_CLASSmxOPAQUE_CLASSmxOBJECT_CLASS_FROM_MATRIX_Hmdtypes_templatemclass_dtypes_templatemclass_infoNP_TO_MTYPESNP_TO_MXTYPEScodecs_templater_   MDTYPES	_bytecode_defrb   ndarrayrg   ru   r|   dtypeOPAQUE_DTYPEr]   r]   r]   r^   <module>   s   	
	
	
	



!
