o
    h	                      @   sB  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&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 d0e!d1e"d2e#d3ed4ed5ed6ed7ed8ed9ed: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dAed+edBe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dAedBeZ+	 edCddDedEddDedFddDiZ,dGdH Z-i Z.dID ]Z/ee'e/ee(e/e-e,e/dJZ0e0e.e/< q_G dKdL dLZ1G dMdN dNej2Z3G dOdP dPej2Z4G dQdR dRej2Z5e6g dSZ7dS )Tz 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u8file_header))descriptionS116)subsystem_offsetrJ   )versionrE   )endian_testS2tag_full)mdtyperG   
byte_countrG   tag_smalldata)byte_count_mdtyperG   )dataS4array_flags))	data_typerG   rU   )flags_classrG   )nzmaxrG   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_berx    Nry   r   )itemsencodeLookupErrorcopy)template
byte_ordercodecspostfixkvrx    r   P/var/www/vscode/kcb/lib/python3.10/site-packages/scipy/io/matlab/_mio5_params.py_convert_codecs   s   
r   z<>)dtypesclassesr   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__r   r   r   r   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   objr   r   r   __new__   s   zMatlabObject.__new__c                 C   s   t |dd | _d S )Nr   )getattrr   )selfr   r   r   r   __array_finalize__   s   zMatlabObject.__array_finalize__r   )r   r   r   r   r   r   r   r   r   r   r      s    
	r   c                   @      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      t || }|S r   r   r   r   r   r   r   r   r   r   r        zMatlabFunction.__new__Nr   r   r   r   r   r   r   r   r   r          r   c                   @   r   )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   r   r   r   r   r   r   r   r     r   zMatlabOpaque.__new__Nr   r   r   r   r   r     r   r   ))s0O)s1r   )s2r   )arrr   )8r   numpyr   _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   r   r   	_bytecode_defr   ndarrayr   r   r   dtyper
   r   r   r   r   <module>   s   	
	
	
	



!	