§
    ÈÁ³gêi  ã            	       ó  — d Z ddlZddlZddlmZ ej        j        j        Zej	        j
        Z
g d¢Zg d¢Zdd„Zd„ Z G d„ dej        ¦  «        Zd	„ ZeZ	 	 	 dd„Zdddddd
ddej        f	d„Zd„ Zd„ Z	 	 dej        dœd„Zdd„ZdS )a,  :mod:`numpy.ma..mrecords`

Defines the equivalent of :class:`numpy.recarrays` for masked arrays,
where fields can be accessed as attributes.
Note that :class:`numpy.ma.MaskedArray` already supports structured datatypes
and the masking of individual fields.

.. moduleauthor:: Pierre Gerard-Marchant

é    N)ÚMaskedRecordsÚ	mrecarrayÚ
fromarraysÚfromrecordsÚfromtextfileÚaddfield)Ú_dataÚ_maskÚ
_fieldmaskÚdtypec                 ó�  — t          | ¦  «        }d„ t          |¦  «        D ¦   «         }|€|}n~t          |t          t          f¦  «        r|}n=t          |t
          ¦  «        r|                     d¦  «        }nt          d|›�¦  «        ‚t          |¦  «        }||k     r|||d…         z  }g }t          ||| j	        ¦  «        D ]o\  }}}|t          v rC|d         t          v r|                     ||d         f¦  «         Œ<|                     |¦  «         ŒR|                     ||d         f¦  «         Œpt          j        |¦  «        S )zÓ
    Checks that field names ``descr`` are not reserved keywords.

    If this is the case, a default 'f%i' is substituted.  If the argument
    `names` is not None, updates the field names to valid names.

    c                 ó   — g | ]}d |z  ‘ŒS )úf%i© ©Ú.0Úis     úO/var/www/html/mpstechhub/venv/lib/python3.11/site-packages/numpy/ma/mrecords.pyú
<listcomp>z_checknames.<locals>.<listcomp>-   s   € Ð6Ð6Ð6 1�U˜Q‘YÐ6Ð6Ð6ó    Nú,zillegal input names r   é   )ÚlenÚrangeÚ
isinstanceÚtupleÚlistÚstrÚsplitÚ	NameErrorÚzipÚdescrÚreserved_fieldsÚappendÚnpr   )	r"   ÚnamesÚndescrÚdefault_namesÚ	new_namesÚnnamesÚnÚdÚts	            r   Ú_checknamesr.   $   sU  € õ �‰ZŒZ€FØ6Ð6­¨f©¬Ð6Ñ6Ô6€MØ€}Ø!ˆ	ˆ	å�e�e¥T˜]Ñ+Ô+ð 	>ØˆIˆIÝ˜�sÑ#Ô#ð 	>ØŸš CÑ(Ô(ˆIˆIåÐ<°5Ð<Ð<Ñ=Ô=Ð=Ý�Y‘”ˆØ�FŠ?ˆ?Ø˜ v w wÔ/Ñ/ˆIØ€FÝ˜ M°5´;Ñ?Ô?ð %ð %‰	ˆˆAˆqØ•ÐÐØ�Œt•Ð&Ð&Ø—’˜q ! A¤$˜iÑ(Ô(Ð(Ð(à—’˜aÑ Ô Ð Ð à�MŠM˜1˜a œd˜)Ñ$Ô$Ð$Ð$ÝŒ8�FÑÔÐr   c                 ó²   — d„ | j         j        D ¦   «         }t          j        | j        |¬¦  «        }t          dgt          |¦  «        z  ¦  «        |_        |S )Nc                 ó   — g | ]}|d f‘ŒS )z|b1r   ©r   r+   s     r   r   z"_get_fieldmask.<locals>.<listcomp>G   s   € Ð3Ð3Ð3˜Qˆq�%ˆjÐ3Ð3Ð3r   ©r   F)r   r&   r%   ÚemptyÚshaper   r   Úflat)ÚselfÚmdescrÚfdmasks      r   Ú_get_fieldmaskr9   F   sQ   € Ø3Ð3 $¤*Ô"2Ð3Ñ3Ô3€FÝŒX�d”j¨Ð/Ñ/Ô/€FÝ˜˜¥# f¡+¤+Ñ-Ñ.Ô.€F„KØ€Mr   c                   óÐ   — e Zd ZdZdddddddddej        ddddfd„Zd„ Zed„ ¦   «         Z	ed	„ ¦   «         Z
d
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zdd„Zd„ Zd„ Zd„ Zdd„Zd„ Zd„ Zd„ ZdS )r   až  

    Attributes
    ----------
    _data : recarray
        Underlying data, as a record array.
    _mask : boolean array
        Mask of the records. A record is masked when all its fields are
        masked.
    _fieldmask : boolean recarray
        Record array of booleans, setting the mask of each individual field
        of each record.
    _fill_value : record
        Filling values for each field.

    Nr   FTc                 óð  ‡— t           j                             | |||||||||	|
¬¦  «        }t          j        |j        ¦  «        Š|t          j        u st          j        |¦  «        s(|s%t          dgt          ‰¦  «        z  ¦  «        |_
        nçt          j        ||¬¦  «        }|j        |j        k    rk|j        |j        }}|dk    rt          j        ||j        ¦  «        }n<||k    rt          j        ||j        ¦  «        }nd}t          j        |||fz  ¦  «        ‚|s|                     |¦  «         d|_        n7|j        ‰k    r|}n"t          j        ˆfd„|D ¦   «         ‰¬¦  «        }||_
        |S )	N)	r   ÚbufÚoffsetÚstridesÚformatsr&   ÚtitlesÚ	byteorderÚalignedF)Úcopyr   z?Mask and data not compatible: data size is %i, mask size is %i.Tc                 óP   •— g | ]"}t          |gt          ‰¦  «        z  ¦  «        ‘Œ#S r   ©r   r   )r   ÚmÚmdtypes     €r   r   z)MaskedRecords.__new__.<locals>.<listcomp>‚   s.   ø€ Ð%MÐ%MÐ%MÀ1¥e¨Q¨Cµ#°f±+´+Ñ,=Ñ&>Ô&>Ð%MÐ%MÐ%Mr   r2   )r%   ÚrecarrayÚ__new__ÚmaÚmake_mask_descrr   ÚnomaskÚsizer   r   r
   Úarrayr4   ÚresizeÚreshapeÚMAErrorÚ__setmask__Ú_sharedmask)Úclsr4   r   r<   r=   r>   r?   r&   r@   rA   rB   ÚmaskÚ	hard_maskÚ
fill_valueÚ	keep_maskrC   Úoptionsr6   ÚndÚnmÚmsgr
   rG   s                         @r   rI   zMaskedRecords.__new___   s�  ø€ õ Œ{×"Ò" 3¨°UÀÈFØ+2¸GÈ5Ø*0¸IØ+2ð #ñ 5ô 5ˆõ
 Ô# D¤JÑ/Ô/ˆØ•2”9ÐÐ¥B¤G¨D¡M¤MÐØð :Ý" E 7­S°©[¬[Ñ#8Ñ9Ô9�”
øå”8˜D tÐ,Ñ,Ô,ˆDØŒz˜TœZÒ'Ð'Ø œI t¤y�R�Ø˜’7�7Ýœ9 T¨4¬:Ñ6Ô6�D�DØ˜2’X�XÝœ: d¨D¬JÑ7Ô7�D�Dð-�Cåœ* S¨B°¨8¡^Ñ4Ô4Ð4Øð 	#Ø× Ò  Ñ&Ô&Ð&Ø#'�Ô Ð à”: Ò'Ð'Ø �E�EåœHÐ%MÐ%MÐ%MÐ%MÈÐ%MÑ%MÔ%MØ+1ð3ñ 3ô 3�Eà"�”
Øˆr   c                 óL  ‡— t          |dd ¦  «        }|€¸t          |dt          j        ¦  «        }t          j                             | d¦  «        }|t          j        u rt          j        | j        |¬¦  «        }nSt          j        |¦  «        Št          j	        ˆfd„|D ¦   «         ‰¬¦  «         
                    t          j        ¦  «        }| j        }|                     |¬¦  «         |                      |¦  «         |d         t          j        k    rt          j        |d<   d S )Nr
   r   r2   c                 óP   •— g | ]"}t          |gt          ‰¦  «        z  ¦  «        ‘Œ#S r   rE   )r   rF   r7   s     €r   r   z4MaskedRecords.__array_finalize__.<locals>.<listcomp>‘   s.   ø€ Ð!LÐ!LÐ!L¸q¥%¨¨­c°&©k¬kÑ(9Ñ":Ô":Ð!LÐ!LÐ!Lr   ©r
   Ú
_baseclass)ÚgetattrrJ   rL   r%   ÚndarrayÚ__getattribute__Úmake_mask_noner4   rK   rN   ÚviewrH   Ú__dict__ÚupdateÚ_update_from)r6   Úobjr
   ÚobjmaskÚ_dtypeÚ_dictr7   s         @r   Ú__array_finalize__z MaskedRecords.__array_finalize__‡   s  ø€ å˜˜W dÑ+Ô+ˆØˆ=Ý˜c 7­B¬IÑ6Ô6ˆGÝ”Z×0Ò0°°wÑ?Ô?ˆFØ�"œ)Ð#Ð#ÝÔ)¨$¬*¸FÐCÑCÔC��åÔ+¨FÑ3Ô3�ÝœÐ!LÐ!LÐ!LÐ!LÀGÐ!LÑ!LÔ!LØ%+ð-ñ -ô -ß-1ªTµ"´+Ñ->Ô->ð ð ”ˆØ�Š˜5ˆÑ!Ô!Ð!Ø×Ò˜#ÑÔÐØ�Ô¥"¤*Ò,Ð,Ý"$¤+ˆE�,ÑØˆr   c                 óV   — t           j                             | t           j        ¦  «        S )z2
        Returns the data as a recarray.

        )r%   rb   re   rH   ©r6   s    r   r	   zMaskedRecords._data›   s   € õ Œz�Š˜t¥R¤[Ñ1Ô1Ð1r   c                 ó   — | j         S )z!
        Alias to mask.

        r_   ro   s    r   r   zMaskedRecords._fieldmask£   s   € ð ŒzÐr   c                 ó`   — | j         rt          | j        ¦  «        S t          | j        ¦  «        S )z%
        Returns the length

        )Úndimr   r	   r   ro   s    r   Ú__len__zMaskedRecords.__len__«   s*   € ð Œ9ð 	#Ý�t”z‘?”?Ð"å�4”:‰ŒÐr   c                 ó$  — 	 t                                | |¦  «        S # t          $ r Y nw xY wt          j                             | d¦  «        j        }	 ||         d d…         }n,# t          t          f$ r}t          d|› �¦  «        |‚d }~ww xY wt          j                             | d¦  «        }t          j                             | |d         ¦  «        } |j	        |Ž }|j
        j        �t          d¦  «        ‚d}|                     dd ¦  «        }	|	�a	 |	|         }	n# t          $ r Y nw xY wt          |	j
        ¦  «        }
|	                     t           |
r|
fnd	f¦  «                             ¦   «         }|j        s|r}|                     t&          j        ¦  «        }t          j        |_        d
|_        |	|_        |                     dd ¦  «        }|�&	 ||         |_        n,# t2          $ r
 d |_        Y nw xY wn|                     ¦   «         }|S )Nr   é   úrecord array has no attribute rf   r`   z4MaskedRecords is currently limited tosimple records.Fr
   r   TÚ_fill_value)Úobjectrc   ÚAttributeErrorr%   rb   ÚfieldsÚ	TypeErrorÚKeyErrorre   Úgetfieldr   r&   ÚNotImplementedErrorÚgetÚ
IndexErrorr   ÚboolÚanyr4   rJ   ÚMaskedArrayr`   Ú_isfieldr
   rw   Ú
ValueErrorÚitem)r6   ÚattrÚ	fielddictÚresÚeÚ
_localdictr	   ri   Ú	hasmaskedr
   Útp_lenrw   s               r   rc   zMaskedRecords.__getattribute__¶   sR  € ð	Ý×*Ò*¨4°Ñ6Ô6Ð6øÝð 	ð 	ð 	àˆDð	øøøõ ”J×/Ò/°°gÑ>Ô>ÔEˆ	ð	@Ø˜D”/ " 1 "Ô%ˆCˆCøÝ�8Ð$ð 	@ð 	@ð 	@Ý Ø7°Ð7Ð7ñ9ô 9Ø>?ð@øøøøð	@øøøõ ”Z×0Ò0°°zÑBÔBˆ
Ý”
—’  j°Ô&>Ñ?Ô?ˆØˆeŒn˜cÐ"ˆØŒ9Œ?Ð&Ý%ð '8ñ 9ô 9ð 9ð ˆ	Ø—’˜w¨Ñ-Ô-ˆØÐðØ˜dœ��øÝð ð ð à�ðøøøõ ˜œÑ%Ô%ˆFØŸ
š
¥D¸Ð+F¨F¨9¨9ÀBÐ#HÑIÔI×MÒMÑOÔOˆIØŒIð 	˜ð 	Ø—(’(�2œ>Ñ*Ô*ˆCÝœZˆCŒNØˆCŒLØˆCŒIà$Ÿ.š.¨¸Ñ=Ô=ˆKØÐ&ð+Ø&1°$Ô&7�C”O�OøÝ!ð +ð +ð +Ø&*�C”O�O�Oð+øøøð 'ð —(’(‘*”*ˆCØˆ
sH   ‚ �
*©*ÁA$ Á$BÁ5BÂBÄD Ä
D,Ä+D,ÇG$ Ç$G8Ç7G8c                 óè  — |dv r|                       |¦  «         dS t                               | d¦  «        }||v}	 t                               | ||¦  «        }t          j                             | d¦  «        j        pi }||vr|S |r/	 t                               | |¦  «         nu# t          $ r |cY S w xY wnb# t          $ rU t          j                             | d¦  «        j        pi }t          j                             | d¦  «        pi }||v s||v s‚ Y nw xY w	 ||         dd…         }n,# t          t          f$ r}	t          d|› �¦  «        |	‚d}	~	ww xY w|t          j        u r|d         }
|
�|d         |         }n|}d	}n(t          j        |¦  «        }t          j        |¦  «        }t	          j                             | d
¦  «        j        |g|¢R Ž }|d                              ||¦  «         |S )z<
        Sets the attribute attr to the value val.

        )rU   Ú	fieldmaskNrf   r   Ú_optinforu   rv   rw   Tr	   r
   )rR   rx   rc   Ú__setattr__r%   rb   rz   Ú__delattr__Ú	Exceptionr{   r|   ry   rJ   ÚmaskedÚfilledÚgetmaskarrayÚsetfieldÚ__setitem__)r6   r‡   Úvalr‹   ÚnewattrÚretrˆ   Úoptinfor‰   rŠ   rw   ÚdvalÚmvalri   s                 r   r‘   zMaskedRecords.__setattr__å   sY  € ð Ð(Ð(Ð(Ø×Ò˜SÑ!Ô!Ð!ØˆFå×,Ò,¨T°:Ñ>Ô>ˆ
à˜jÐ(ˆð	å×$Ò$ T¨4°Ñ5Ô5ˆCõ œ
×3Ò3°D¸'ÑBÔBÔIÐOÈRˆIà˜9Ð$Ð$Ø�
Øð ðÝ×&Ò& t¨TÑ2Ô2Ð2Ð2øÝ ð ð ð Ø�J�J�Jðøøøðøõ ð 	ð 	ð 	åœ
×3Ò3°D¸'ÑBÔBÔIÐOÈRˆIÝ”j×1Ò1°$¸
ÑCÔCÐIÀrˆGØ˜IÐ%Ð%¨°¨¨Øøøð	øøøð(	@Ø˜D”/ " 1 "Ô%ˆCˆCøÝ�8Ð$ð 	@ð 	@ð 	@Ý Ø7°Ð7Ð7ñ9ô 9Ø>?ð@øøøøð	@øøøð •"”)ÐÐØ$ ]Ô3ˆKØÐ&Ø! -Ô0°Ô6��à�ØˆDˆDå”9˜S‘>”>ˆDÝ”? 3Ñ'Ô'ˆDÝŒj×)Ò)¨$°Ñ8Ô8ÔAÀ$ÐMÈÐMÐMÐMˆØ�7Ô×'Ò'¨¨dÑ3Ô3Ð3Øˆ
s<   ¼B7 ÂB$ Â$B3Â2B3Â7ADÄDÄD+ Ä+EÄ<EÅEc                 ó~  — | j         }t          j                             | d¦  «        }t          j                             | |d         ¦  «        }t          |t          ¦  «        rl||                              t          j        ¦  «        }||         |_	        d|_
        |d         }|�||         |_        |j        s|j	        rt          j        S |S t          j        ||         ¦  «                             t          ¦  «        }t          j        ||         ¦  «                             t          j        ¦  «        |_	        |S )z„
        Returns all the fields sharing the same fieldname base.

        The fieldname base is either `_data` or `_mask`.

        r
   r`   Trw   )rf   r%   rb   rc   re   r   r   rJ   rƒ   r
   rS   rw   rr   r”   Úasarrayr   rH   )r6   Úindxr‹   r
   r	   ri   Úfvals          r   Ú__getitem__zMaskedRecords.__getitem__  s  € ð ”]ˆ
Ý”
×+Ò+¨D°'Ñ:Ô:ˆÝ”
—’  j°Ô&>Ñ?Ô?ˆå�d�CÑ Ô ð 	ð
 ˜”+×"Ò"¥2¤>Ñ2Ô2ˆCØ˜dœˆCŒIØ"ˆCŒOØ˜mÔ,ˆDØÐØ"& t¤*�”à”8ð ! ¤	ð !Ý”yÐ ØˆJõ Œj˜˜tœÑ%Ô%×*Ò*­9Ñ5Ô5ˆÝ”J˜u Tœ{Ñ+Ô+×0Ò0µ´Ñ=Ô=ˆŒ	Øˆ
r   c                 ó®   — t           j                             | ||¦  «         t          |t          ¦  «        rt          j        |¦  «        | j        |<   dS dS )z2
        Sets the given record to value.

        N)rJ   rƒ   r˜   r   r   r–   r
   )r6   r¡   Úvalues      r   r˜   zMaskedRecords.__setitem__=  sV   € õ
 	Œ×"Ò" 4¨¨uÑ5Ô5Ð5Ý�d�CÑ Ô ð 	6Ý!œ¨uÑ5Ô5ˆDŒJ�tÑÐÐð	6ð 	6r   c                 ó.  ‡ — ‰ j         dk    rBd„ t          ˆ fd„‰ j        j        D ¦   «         Ž D ¦   «         }dd                     |¦  «        › d�S d„ t          ˆ fd„‰ j        j        D ¦   «         ¦  «        D ¦   «         }d	d                     |¦  «        › d
�S )z8
        Calculates the string representation.

        r   c                 óT   — g | ]%}d d                      d„ |D ¦   «         ¦  «        › d�‘Œ&S )ú(r   c                 ó,   — g | ]}t          |¦  «        ‘ŒS r   ©r   r   s     r   r   z4MaskedRecords.__str__.<locals>.<listcomp>.<listcomp>L  s   € Ð!4Ð!4Ð!4¨Q¥# a¡&¤&Ð!4Ð!4Ð!4r   ú)©Újoin©r   Úss     r   r   z)MaskedRecords.__str__.<locals>.<listcomp>L  sT   € ð Qð Qð QØð 9˜ŸšÐ!4Ð!4°!Ð!4Ñ!4Ô!4Ñ5Ô5Ð8Ð8Ð8ð Qð Qð Qr   c                 ó0   •— g | ]}t          ‰|¦  «        ‘ŒS r   ©ra   ©r   Úfr6   s     €r   r   z)MaskedRecords.__str__.<locals>.<listcomp>M  s#   ø€ Ð"NÐ"NÐ"N¸¥7¨4°Ñ#3Ô#3Ð"NÐ"NÐ"Nr   ú[z, ú]c                 óN   — g | ]"}d                       d„ |D ¦   «         ¦  «        › ‘Œ#S )r   c                 ó,   — g | ]}t          |¦  «        ‘ŒS r   rª   r   s     r   r   z4MaskedRecords.__str__.<locals>.<listcomp>.<listcomp>P  s   € Ð 3Ð 3Ð 3¨A¥ Q¡¤Ð 3Ð 3Ð 3r   r¬   r®   s     r   r   z)MaskedRecords.__str__.<locals>.<listcomp>P  sL   € ð Pð Pð PØð —x’xÐ 3Ð 3°Ð 3Ñ 3Ô 3Ñ4Ô4Ð6ð Pð Pð Pr   c                 ó0   •— g | ]}t          ‰|¦  «        ‘ŒS r   r±   r²   s     €r   r   z)MaskedRecords.__str__.<locals>.<listcomp>Q  s#   ø€ Ð!MÐ!MÐ!M°q¥'¨$°Ñ"2Ô"2Ð!MÐ!MÐ!Mr   r¨   r«   )rM   r!   r   r&   r­   )r6   Úmstrs   ` r   Ú__str__zMaskedRecords.__str__F  sÍ   ø€ ð
 Œ9�qŠ=ˆ=ðQð QÝ Ð"NÐ"NÐ"NÐ"N¸T¼ZÔ=MÐ"NÑ"NÔ"NÐOðQñ Qô QˆDà)�t—y’y ‘”Ð)Ð)Ð)Ð)ðPð PÝ Ð!MÐ!MÐ!MÐ!M¸D¼JÔ<LÐ!MÑ!MÔ!MÑNÔNðPñ Pô PˆDà)�t—y’y ‘”Ð)Ð)Ð)Ð)r   c                 óB  ‡ ‡— ‰ j         j        }dt          d„ |D ¦   «         ¦  «        dz   fz  Šˆˆ fd„‰ j         j        D ¦   «         }|                     dd¦  «         |                     ‰d‰ j        fz  dg¦  «         t          d	                     |¦  «        ¦  «        S )
z6
        Calculates the repr representation.

        z%%%is : %%sc                 ó,   — g | ]}t          |¦  «        ‘ŒS r   )r   r1   s     r   r   z*MaskedRecords.__repr__.<locals>.<listcomp>Z  s   € Ð#;Ð#;Ð#;¨q¥C¨¡F¤FÐ#;Ð#;Ð#;r   é   c                 ó:   •— g | ]}‰|t          ‰|¦  «        fz  ‘ŒS r   r±   )r   r³   Úfmtr6   s     €€r   r   z*MaskedRecords.__repr__.<locals>.<listcomp>[  s-   ø€ ÐIÐIÐI°1�3˜!�W T¨1Ñ-Ô-Ð.Ñ.ÐIÐIÐIr   r   zmasked_records(z    fill_valuez              )ú
)r   r&   ÚmaxÚinsertÚextendrW   r   r­   )r6   Ú_namesÚreprstrr¿   s   `  @r   Ú__repr__zMaskedRecords.__repr__T  s¶   øø€ ð
 ”Ô!ˆØ�sÐ#;Ð#;°FÐ#;Ñ#;Ô#;Ñ<Ô<¸qÑ@ÐBÑBˆØIÐIÐIÐIÐI¸¼
Ô8HÐIÑIÔIˆØ�Š�qÐ+Ñ,Ô,Ð,Ø�Š˜Ð/°´ÐAÑAØ)ð+ñ 	,ô 	,ð 	,å�4—9’9˜WÑ%Ô%Ñ&Ô&Ð&r   c                 óÎ  — |€E|€!t           j                             | ¦  «        }�nDt           j                             | |¦  «        }�n"|€ÿ	 t          |t           j        ¦  «        r!t           j                             | |¦  «        }n t           j                             | |¦  «        }nÃ# t          $ r• t          j        |¦  «        }|j        €P| j        j        d         }|  	                    ¦   «                              ||¦  «        }| 
                    | ¦  «         n t           j                             | |¦  «        }d|_        Y n%w xY wt           j                             | ||¦  «        }t          |dt          j        ¦  «        t          j        urTt          j        |j        ¦  «        }| j                             |t           j        ¦  «        |_        |j        |j        _        |S )z3
        Returns a view of the mrecarray.

        Nr   r
   )r%   rb   re   Ú
issubclassr{   r   rz   Ú	__class__Ú	__bases__Ú	__array__rh   rw   ra   rJ   rL   rK   r
   r4   )r6   r   ÚtypeÚoutputÚbasetyperG   s         r   re   zMaskedRecords.viewa  s�  € ð ˆ=Øˆ|ÝœŸš¨Ñ.Ô.�‘åœŸš¨¨tÑ4Ô4�‘àˆ\ð*Ý˜e¥R¤ZÑ0Ô0ð :ÝœZŸ_š_¨T°5Ñ9Ô9�F�FåœZŸ_š_¨T°5Ñ9Ô9�Føøåð *ð *ð *Ýœ ™œ�ð ”<Ð'Ø#œ~Ô7¸Ô:�HØ!Ÿ^š^Ñ-Ô-×2Ò2°5¸(ÑCÔC�FØ×'Ò'¨Ñ-Ô-Ð-Ð-åœZŸ_š_¨T°5Ñ9Ô9�FØ%)�Ô"Ð"Ð"ð*øøøõ ”Z—_’_ T¨5°$Ñ7Ô7ˆFå�F˜G¥R¤YÑ/Ô/µr´yÐ@Ð@ÝÔ'¨¬Ñ5Ô5ˆFØœ:Ÿ?š?¨6µ2´:Ñ>Ô>ˆFŒLØ!'¤ˆFŒLÔØˆs   ÁAB' Â'BEÅEc                 ó   — d| _         dS )z+
        Forces the mask to hard.

        TN©Ú	_hardmaskro   s    r   Úharden_maskzMaskedRecords.harden_mask‰  s   € ð
 ˆŒˆˆr   c                 ó   — d| _         dS )z*
        Forces the mask to soft

        FNrÐ   ro   s    r   Úsoften_maskzMaskedRecords.soften_mask�  s   € ð
 ˆŒˆˆr   c                 ó´   — | j                              ¦   «                              t          | ¦  «        ¦  «        }| j                             ¦   «         |_        |S )z7
        Returns a copy of the masked record.

        )r	   rC   re   rÌ   r
   )r6   Úcopieds     r   rC   zMaskedRecords.copy—  sA   € ð
 ”—’Ñ"Ô"×'Ò'­¨T©
¬
Ñ3Ô3ˆØ”z—’Ñ(Ô(ˆŒØˆr   c                 óZ  — |�'|                       |¦  «                             ¦   «         S t          j        |                       ¦   «                              ¦   «         t          ¬¦  «        }t          j        | j                             ¦   «         ¦  «        }d||<   |                     ¦   «         S )a  
        Return the data portion of the array as a list.

        Data items are converted to the nearest compatible Python type.
        Masked values are converted to fill_value. If fill_value is None,
        the corresponding entries in the output list will be ``None``.

        Nr2   )r•   Útolistr%   rN   rx   r
   )r6   rW   ÚresultrU   s       r   rØ   zMaskedRecords.tolist   s„   € ð Ð!Ø—;’;˜zÑ*Ô*×1Ò1Ñ3Ô3Ð3Ý”˜$Ÿ+š+™-œ-×.Ò.Ñ0Ô0½Ð?Ñ?Ô?ˆÝŒx˜œ
×)Ò)Ñ+Ô+Ñ,Ô,ˆØˆˆt‰Ø�}Š}‰ŒÐr   c                 ó¦   — d| j         | j        | j        j        | j                             ¦   «         | j                             ¦   «         | j        f}|S )zWReturn the internal state of the masked array.

        This is for pickling.

        r   )r4   r   ÚflagsÚfncr	   Útobytesr
   rw   )r6   Ústates     r   Ú__getstate__zMaskedRecords.__getstate__°  sN   € ð Ø”Ø”Ø””Ø”×#Ò#Ñ%Ô%Ø”×#Ò#Ñ%Ô%ØÔ!ðˆð ˆr   c                 ó  — |\  }}}}}}}t           j                             | ||||f¦  «         t          j        d„ | j        j        D ¦   «         ¦  «        }	| j        d                              ||	||f¦  «         || _        dS )at  
        Restore the internal state of the masked array.

        This is for pickling.  ``state`` is typically the output of the
        ``__getstate__`` output, and is a 5-tuple:

        - class name
        - a tuple giving the shape of the data
        - a typecode for the data
        - a binary string for the data
        - a binary string for the mask.

        c                 ó0   — g | ]\  }}|t           j        f‘ŒS r   ©r%   r�   )r   ÚkÚ_s      r   r   z.MaskedRecords.__setstate__.<locals>.<listcomp>Ð  s"   € ÐGÐGÐG©F¨Q°˜A�rœw˜<ÐGÐGÐGr   r
   N)r%   rb   Ú__setstate__r   r"   rf   rW   )
r6   rÞ   ÚverÚshpÚtypÚisfÚrawÚmskÚflvrG   s
             r   rå   zMaskedRecords.__setstate__À  s‹   € ð /4Ñ+ˆˆc�3˜˜S # sÝ
Œ
×Ò  s¨C°°cÐ&:Ñ;Ô;Ð;Ý”ÐGÐG°d´jÔ6FÐGÑGÔGÑHÔHˆØŒ�gÔ×+Ò+¨S°&¸#¸sÐ,CÑDÔDÐDØˆŒˆˆr   c                 óV   — t           | j        | j        ddf|                      ¦   «         fS )z?
        Return a 3-tuple for pickling a MaskedArray.

        )r   Úb)Ú_mrreconstructrÉ   r`   rß   ro   s    r   Ú
__reduce__zMaskedRecords.__reduce__Ô  s0   € õ
 Ø” ¤°$¸Ð=Ø×!Ò!Ñ#Ô#ð%ð 	%r   )NN©N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rJ   rL   rI   rm   Úpropertyr	   r   rs   rc   r‘   r£   r˜   rº   rÆ   re   rÒ   rÔ   rC   rØ   rß   rå   rð   r   r   r   r   r   M   sŒ  € € € € € ðð ð" #'¨D¸ÀDØ D°Ø¨Ø”Y¨%¸DÈDØð	&ð &ð &ð &ðPð ð ð( ð2ð 2ñ „Xð2ð ðð ñ „Xðð	ð 	ð 	ð-ð -ð -ð^6ð 6ð 6ðpð ð ð@6ð 6ð 6ð*ð *ð *ð'ð 'ð 'ð&ð &ð &ð &ðPð ð ðð ð ðð ð ðð ð ð ð ð ð ð ð ð ð(%ð %ð %ð %ð %r   r   c                 óò   — t           j                             |||¦  «                             | ¦  «        }t           j                             t           j        |d¦  «        }|                      | |||¬¦  «        S )zK
    Build a new MaskedArray from the information stored in a pickle.

    Úb1)rU   r   )r%   rb   rI   re   )ÚsubtypeÚ	baseclassÚ	baseshaperÎ   r	   r
   s         r   rï   rï   Þ  s`   € õ
 ŒJ×Ò˜y¨)°XÑ>Ô>×CÒCÀGÑLÔL€EÝŒJ×Ò�rœz¨9°dÑ;Ô;€EØ�?Š?˜7 E°¸Xˆ?ÑGÔGÐGr   Fc	           
      ó  — d„ | D ¦   «         }	d„ | D ¦   «         }
t           j                             |	|||||||¬¦  «                             t          ¦  «        }t          t          |
Ž ¦  «        |j        _        |�||_	        |S )a  
    Creates a mrecarray from a (flat) list of masked arrays.

    Parameters
    ----------
    arraylist : sequence
        A list of (masked) arrays. Each element of the sequence is first converted
        to a masked array if needed. If a 2D array is passed as argument, it is
        processed line by line
    dtype : {None, dtype}, optional
        Data type descriptor.
    shape : {None, integer}, optional
        Number of records. If None, shape is defined from the shape of the
        first array in the list.
    formats : {None, sequence}, optional
        Sequence of formats for each individual field. If None, the formats will
        be autodetected by inspecting the fields and selecting the highest dtype
        possible.
    names : {None, sequence}, optional
        Sequence of the names of each field.
    fill_value : {None, sequence}, optional
        Sequence of data to be used as filling values.

    Notes
    -----
    Lists of tuples should be preferred over lists of lists for faster processing.

    c                 ó6   — g | ]}t          j        |¦  «        ‘ŒS r   )rJ   Úgetdata©r   Úxs     r   r   zfromarrays.<locals>.<listcomp>  s    € Ð1Ð1Ð1 !•”
˜1‘”Ð1Ð1Ð1r   c                 óZ   — g | ](}t          j        t          j        |¦  «        ¦  «        ‘Œ)S r   )r%   Ú
atleast_1drJ   r–   rÿ   s     r   r   zfromarrays.<locals>.<listcomp>  s,   € ÐEÐEÐE°a•”�bœo¨aÑ0Ô0Ñ1Ô1ÐEÐEÐEr   ©r   r4   r?   r&   r@   rB   rA   )
r%   Úrecr   re   r   r   r!   r
   r5   rW   )Ú	arraylistr   r4   r?   r&   r@   rB   rA   rW   ÚdatalistÚmasklistÚ_arrays               r   r   r   ï  s”   € ð> 2Ð1 yÐ1Ñ1Ô1€HØEÐE¸9ÐEÑEÔE€HÝŒV×Ò˜xØ%*°%ÀØ%*°6À7Ø)2ð ñ 4ô 4÷ 59²D½±O´Oð õ �S (˜^Ñ,Ô,€F„LÔØÐØ&ˆÔØ€Mr   c
           
      óÐ  — t          | dd¦  «        }
t          | t          j        ¦  «        rht          | t          j        ¦  «        r1|                      ¦   «                              t          j        ¦  «        } |€| j        }|  	                    ¦   «         } t          j
                             | |||||||¬¦  «                             t          ¦  «        }|�||_        |	t          j        urnt          j        |	¦  «        }	t!          |	j        ¦  «        }|r|	|j        _        n7|	j        dk    rd„ |	D ¦   «         |j        _        n|                     |	¦  «         |
�|
|j        dd…<   |S )aN  
    Creates a MaskedRecords from a list of records.

    Parameters
    ----------
    reclist : sequence
        A list of records. Each element of the sequence is first converted
        to a masked array if needed. If a 2D array is passed as argument, it is
        processed line by line
    dtype : {None, dtype}, optional
        Data type descriptor.
    shape : {None,int}, optional
        Number of records. If None, ``shape`` is defined from the shape of the
        first array in the list.
    formats : {None, sequence}, optional
        Sequence of formats for each individual field. If None, the formats will
        be autodetected by inspecting the fields and selecting the highest dtype
        possible.
    names : {None, sequence}, optional
        Sequence of the names of each field.
    fill_value : {None, sequence}, optional
        Sequence of data to be used as filling values.
    mask : {nomask, sequence}, optional.
        External mask to apply on the data.

    Notes
    -----
    Lists of tuples should be preferred over lists of lists for faster processing.

    r
   Nr  ru   c                 ó,   — g | ]}t          |¦  «        ‘ŒS r   )r   )r   rF   s     r   r   zfromrecords.<locals>.<listcomp>S  s   € Ð6Ð6Ð6¨A�u Q™xœxÐ6Ð6Ð6r   )ra   r   r%   rb   rJ   rƒ   r•   re   r   rØ   r  r   r   rW   rL   r    r   r
   r5   rr   rR   )Úreclistr   r4   r?   r&   r@   rB   rA   rW   rU   r
   ÚmrecÚmaskrecordlengths                r   r   r     sT  € õD �G˜W dÑ+Ô+€Eå�'�2œ:Ñ&Ô&ð #å�g�rœ~Ñ.Ô.ð 	8Ø—n’nÑ&Ô&×+Ò+­B¬JÑ7Ô7ˆGàˆ=Ø”MˆEØ—.’.Ñ"Ô"ˆÝŒ6×Ò˜g¨U¸%ÈØ %¨fØ")°Yð ñ @ô @ç@DÂÅYÁÄð 	ð ÐØ$ˆŒà•2”9ÐÐÝŒz˜$ÑÔˆÝ˜tœz™?œ?ÐØð 	#Ø"ˆDŒJŒOˆOØŒY˜!Š^ˆ^Ø6Ð6°Ð6Ñ6Ô6ˆDŒJŒOˆOà×Ò˜TÑ"Ô"Ð"ØÐØˆŒ
�1�1�1‰Ø€Kr   c                 óÆ  — g }t          j        | ¦  «        } | j        dk    r	| d         } n| j        dk    rt          d¦  «        ‚| D �]}	 t	          |¦  «         |                     t          j        t          ¦  «        ¦  «         Œ@# t          t          f$ rÆ 	 t          |¦  «         |                     t          j        t          ¦  «        ¦  «         n…# t          t          f$ rq 	 t          |¦  «         |                     t          j        t          ¦  «        ¦  «         n1# t          t          f$ r |                     | j        ¦  «         Y nw xY wY nw xY wY �Œw xY w|S )a.  
    Tries to guess the dtypes of the str_ ndarray `arr`.

    Guesses by testing element-wise conversion. Returns a list of dtypes.
    The array is first converted to ndarray. If the array is 2D, the test
    is performed on the first line. An exception is raised if the file is
    3D or more.

    ru   r   zThe array should be 2D at most!)
r%   r    rr   r…   Úintr$   r   r{   ÚfloatÚcomplex)ÚarrÚvartypesr³   s      r   Ú_guessvartypesr  [  so  € ð €HÝ
Œ*�S‰/Œ/€CØ
„x�1‚}€}Ø�!ŒfˆˆØ	Œ�AŠˆÝÐ:Ñ;Ô;Ð;àð +ñ +ˆð	+Ý�‰FŒFˆFð �OŠO�BœH¥S™MœMÑ*Ô*Ð*Ð*øõ �IÐ&ð 	1ð 	1ð 	1ð
1Ý�a‘”�ð —’¥¤­¡¤Ñ0Ô0Ð0Ð0øõ ¥	Ð*ð 7ð 7ð 7ð7Ý˜A‘J”J�Jð —O’O¥B¤H­WÑ$5Ô$5Ñ6Ô6Ð6Ð6øõ #¥IÐ.ð /ð /ð /Ø—O’O C¤IÑ.Ô.Ð.Ð.Ð.ð/øøøøøð7øøøøùð	1øøøð €OsZ   ÁBÂEÂCÂ(-EÃEÃ'D#Ã6-EÄ#+E	ÅEÅE	ÅEÅEÅEÅEÅEc                 óJ  — t          | d¦  «        r| S 	 t          | ¦  «        }n&# t          $ r}t          d| › d�¦  «        |‚d}~ww xY w|                     ¦   «         dd…         dk    r|                     dd¦  «         |S |                     ¦   «          t          d¦  «        ‚)	z1
    Opens the file handle of file `fname`.

    ÚreadlinezNo such file: 'ú'Nru   z\xr   zWow, binary file)ÚhasattrÚopenÚFileNotFoundErrorr  ÚseekÚcloser~   )Úfnamer³   rŠ   s      r   Úopenfiler  €  s»   € õ ˆu�jÑ!Ô!ð ØˆðCÝ�‰KŒKˆˆøÝð Cð Cð CÝÐ :°%Ð :Ð :Ð :Ñ;Ô;ÀÐBøøøøðCøøøà‡z‚z�|„|�B�Q�BÔ˜5Ò Ð Ø	�Šˆq�!‰ŒˆØˆØ‡G‚G�I„I€IÝ
Ð0Ñ
1Ô
1Ð1s   ”$ ¤
A®AÁAú#Ú )Ú	delimitorc                óÂ  ‡‡— |t           j        ur/‰�t          d¦  «        ‚t          j        dt
          d¬¦  «         |Št          | ¦  «        }	 |                     ¦   «         }|d|                     ‰¦  «        …          	                    ¦   «         }	|	 
                    ‰¦  «        }
t          |
¦  «        dk    rnŒm|€|
}t          j        ˆˆfd„|D ¦   «         ¦  «        }|j        \  }}|                     ¦   «          |€t!          |d	         ¦  «        }ncd
„ |D ¦   «         }t          |¦  «        |k    rDd}|dz  }t          j        |t          |¦  «        |fz  d¬¦  «         t!          |d	         ¦  «        }t#          t%          ||¦  «        ¦  «        }d„ |D ¦   «         }|j        |k    }d„ t%          |j        |||¦  «        D ¦   «         }t)          ||¬¦  «        S )a®  
    Creates a mrecarray from data stored in the file `filename`.

    Parameters
    ----------
    fname : {file name/handle}
        Handle of an opened file.
    delimiter : {None, string}, optional
        Alphanumeric character used to separate columns in the file.
        If None, any (group of) white spacestring(s) will be used.
    commentchar : {'#', string}, optional
        Alphanumeric character used to mark the start of a comment.
    missingchar : {'', string}, optional
        String indicating missing data, and used to create the masks.
    varnames : {None, sequence}, optional
        Sequence of the variable names. If None, a list will be created from
        the first non empty line of the file.
    vartypes : {None, sequence}, optional
        Sequence of the variables dtypes. If None, it will be estimated from
        the first non-commented line.


    Ultra simple: the varnames are in the header, one lineNz;fromtextfile() got multiple values for argument 'delimiter'zThe 'delimitor' keyword argument of numpy.ma.mrecords.fromtextfile() is deprecated since NumPy 1.22.0, use 'delimiter' instead.ru   )Ú
stacklevelTr   c                 óœ   •— g | ]H}|d          ‰k    ¯t          |¦  «        dk    ¯!|                     ¦   «                              ‰¦  «        ‘ŒIS )r   r   )r   Ústripr   )r   ÚlineÚcommentcharÚ	delimiters     €€r   r   z fromtextfile.<locals>.<listcomp>Ç  sV   ø€ ð "Nð "Nð "NÀDØ$(¨¤G¨{Ò$:Ð$:½sÀ4¹y¼yÈ1º}¸}ð #'§*¢*¡,¤,×"4Ò"4°YÑ"?Ô"?Ø?L¸}¸}r   r   c                 ó6   — g | ]}t          j        |¦  «        ‘ŒS r   )r%   r   )r   Úvs     r   r   z fromtextfile.<locals>.<listcomp>Ð  s    € Ð2Ð2Ð2 A•B”H˜Q‘K”KÐ2Ð2Ð2r   z&Attempting to %i dtypes for %i fields!z Reverting to default.c                 ó6   — g | ]}t          j        |¦  «        ‘ŒS r   )rJ   Údefault_fill_value)r   r³   s     r   r   z fromtextfile.<locals>.<listcomp>Ù  s#   € Ð9Ð9Ð9¨1�bÔ# AÑ&Ô&Ð9Ð9Ð9r   c                 óH   — g | ]\  }}}}t          j        ||||¬ ¦  «        ‘Œ S ))rU   r   rW   )rJ   Úmasked_array)r   ÚarF   r-   r³   s        r   r   z fromtextfile.<locals>.<listcomp>Þ  sI   € ð Qð Qð QÙ!�a˜˜A˜qõ ” ¨°!ÀÐBÑBÔBð Qð Qð Qr   r2   )r%   Ú_NoValuer{   ÚwarningsÚwarnÚDeprecationWarningr  r  Úfindr%  r   r   rJ   r.  r4   r  r  r   r!   ÚTr   )r  r(  r'  ÚmissingcharÚvarnamesr  r!  Úftextr&  Ú	firstlineÚ	_varnamesÚ
_variablesrä   Únfieldsr\   r7   Úmfillvr
   Ú	_datalists    ``                r   r   r   ”  sF  øø€ ð4 �œÐ#Ð#ØÐ Ýð *ñ +ô +ð +õ 	Œð Eõ )°Qð	8ñ 	8ô 	8ð 	8ð ˆ	õ �U‰OŒO€EðØ�~Š~ÑÔˆØÐ0˜$Ÿ)š) KÑ0Ô0Ð0Ô1×7Ò7Ñ9Ô9ˆ	Ø—O’O IÑ.Ô.ˆ	Ýˆy‰>Œ>˜AÒÐØðð ÐØˆõ ”ð "Nð "Nð "Nð "Nð "NÈEð "Nñ "Nô "Nñ Oô O€JàÔ#�L€QˆØ	‡K‚K�M„M€Mð ÐÝ! *¨Q¤-Ñ0Ô0ˆˆà2Ð2¨Ð2Ñ2Ô2ˆÝˆx‰=Œ=˜GÒ#Ð#Ø:ˆCØÐ+Ñ+ˆCÝŒM˜#¥ X¡¤°Ð 8Ñ8ÀQÐGÑGÔGÐGÝ% j°¤mÑ4Ô4ˆHõ •#�h Ñ)Ô)Ñ*Ô*€FØ9Ð9°Ð9Ñ9Ô9€Fð Œ\˜[Ò(€EðQð QÝ%(¨¬°u¸hÈÑ%OÔ%OðQñ Qô Q€Iõ �i vÐ.Ñ.Ô.Ð.r   c                 ó*  ‡‡‡‡— | j         Š| j        Š|�	|t          v rdt          ‰j        ¦  «        z  }t          j        |¦  «        }t          j        ‰j        j        ||j        fgz   ¦  «        }t          j	        ‰j
        |¦  «        Šˆˆfd„‰j        j                             ¦   «         D ¦   «           ‰j        |j         g‰j        j        |         ¢R Ž  ‰                     t          ¦  «        Št          j        d„ |j        D ¦   «         ¦  «        }t          j	        ‰j
        |¦  «        Šˆˆfd„‰j        j                             ¦   «         D ¦   «           ‰j        t          j        |¦  «        g‰j        j        |         ¢R Ž  ‰‰_        ‰S )zÜAdds a new field to the masked record array

    Uses `newfield` as data and `newfieldname` as name. If `newfieldname`
    is None, the new field name is set to 'fi', where `i` is the number of
    existing fields.

    Nr   c                 ó<   •— g | ]} ‰j          ‰j        |Ž g|¢R Ž ‘ŒS r   ©r—   r}   )r   r³   r	   Únewdatas     €€r   r   zaddfield.<locals>.<listcomp>ö  óG   ø€ ð +ð +ð +Ø	
ð €WÔ�n�e”n aÐ(Ð-¨1Ð-Ð-Ð-ð +ð +ð +r   c                 ó*   — g | ]}|t           j        f‘ŒS r   râ   r1   s     r   r   zaddfield.<locals>.<listcomp>ý  s   € Ð?Ð?Ð?¨1˜1�bœg˜,Ð?Ð?Ð?r   c                 ó<   •— g | ]} ‰j          ‰j        |Ž g|¢R Ž ‘ŒS r   rA  )r   r³   r
   Únewmasks     €€r   r   zaddfield.<locals>.<listcomp>   rC  r   )r	   r
   r#   r   r   rJ   rN   r%   r"   rH   r4   rz   Úvaluesr—   re   r   r&   r–   )	ÚmrecordÚnewfieldÚnewfieldnameÚnewdtypeÚ	newmdtyper	   r
   rB  rF  s	        @@@@r   r   r   ä  sº  øøøø€ ð ŒM€EØŒM€EØÐ˜|­Ð>Ð>Ø�s 5¤;Ñ/Ô/Ñ/ˆÝŒx˜Ñ!Ô!€Hõ Œx˜œÔ)¨l¸H¼NÐ-KÐ,LÑLÑMÔM€HÝŒk˜%œ+ xÑ0Ô0€Gð+ð +ð +ð +ð +ØŒkÔ ×'Ò'Ñ)Ô)ð+ñ +ô +ð +ð €GÔ�X”^ÐI g¤mÔ&:¸<Ô&HÐIÐIÐIÐIØ�lŠl�=Ñ)Ô)€Gõ ”Ð?Ð?°´Ð?Ñ?Ô?Ñ@Ô@€IÝŒk˜%œ+ yÑ1Ô1€Gð+ð +ð +ð +ð +ØŒkÔ ×'Ò'Ñ)Ô)ð+ñ +ô +ð +ð €GÔ•R”_ XÑ.Ô.ð :Ø”mÔ*¨<Ô8ð:ð :ð :ð :à€G„MØ€Nr   rñ   )NNNNNFNN)Nr  r   NN)rõ   r1  Únumpyr%   Únumpy.marJ   Ú_coreÚrecordsÚ_byteorderconvÚcoreÚ_check_fill_valueÚ__all__r#   r.   r9   rƒ   r   rï   r   r   rL   r   r  r  r0  r   r   r   r   r   ú<module>rU     s£  ðð	ð 	ð €€€à Ð Ð Ð Ø Ð Ð Ð Ð Ð ð ”Ô!Ô0€ð ”GÔ-Ð ðð ð €ð
 <Ð;Ð;€ðð ð ð ðDð ð ðN%ð N%ð N%ð N%ð N%�B”Nñ N%ô N%ð N%ðbHð Hð Hð €	ð ;?ØAEØð(ð (ð (ð (ðV  $¨4¸ÀTØ U°dØ b¤ið>ð >ð >ð >ðB"ð "ð "ðJ2ð 2ð 2ð( FHØ)-ðM/à œkðM/ð M/ð M/ð M/ð M/ð`"ð "ð "ð "ð "ð "r   