%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib64/python3.9/site-packages/numpy/lib/tests/__pycache__/
Upload File :
Create Path :
Current File : //lib64/python3.9/site-packages/numpy/lib/tests/__pycache__/test_recfunctions.cpython-39.opt-1.pyc

a

z[yc���@s.ddlZddlZddlmZddlmZddlmZddl	m
Z
mZddlm
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZejjjZejjj Z ejjj!Z!ejjj"Z#ejjj$Z%Gdd�d�Z&Gdd	�d	�Z'Gd
d�d�Z(Gdd
�d
�Z)Gdd�d�Z*Gdd�d�Z+Gdd�d�Z,Gdd�d�Z-dS)�N)�
MaskedRecords)�assert_equal)�assert_�
assert_raises)�drop_fields�
rename_fields�get_fieldstructure�recursive_fill_fields�find_duplicates�merge_arrays�
append_fields�stack_arrays�join_by�
repack_fields�unstructured_to_structured�structured_to_unstructured�apply_along_fields�require_fields�assign_fields_by_namec@sleZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�TestRecFunctionscCsrt�ddg�}t�gd��}tjddgddtfgd�}tjd	d
gdtfdd
tfdtfgfgd�}||||f|_dS�N����
����A��?��B�@�rz|S3r!��dtype�r�r�@�����@�a�b�ba�bb��np�array�float�int�data��self�x�y�z�w�r>�G/usr/lib64/python3.9/site-packages/numpy/lib/tests/test_recfunctions.py�setup_methods

�
�zTestRecFunctions.setup_methodcCsH|j\}}}}t||fdd�}t|t�dtfdtfg��t||fdd�}t|t�dtfdtfg��t||fdd�}t|t�dtfddtfg��t||fdd�}t|t�dtfdddtfgfg��t||fdd�}t|t�dtfdtfdtfd	tfg��t||fdd�}t|t�dtfddtfd
dtfd	tfgfgfg��dS)NT�Zflatten�Fr#r!r.r0r1r/)r7�	zip_descrrr3r%r6r5)r9r=r:r;r<�testr>r>r?�test_zip_descr sD���
��
��
���zTestRecFunctions.test_zip_descrcCs&tjddgdtfddtfdtfgfgd�}t|d�}tjdd	gddtfdtfgfgd�}t||�t|d�}tjd
dgdtfgd�}t||�t|dg�}tjdd
gdtfddtfgfgd�}t||�t|ddg�}tjd
dgdtfgd�}t||�t|ddg�}tjddggd�}t||�dS)Nr&r)r.r/r0r1r$)r')r+�r�r*)r)r()r*)r-r>)r3r4r6r5rr�r9r.rD�controlr>r>r?�test_drop_fieldsAs,
�

�



�

z!TestRecFunctions.test_drop_fieldscCs�tjddddgffddddgffgd	tfd
dtfdtdffgfgd
�}t|ddd��}dtfd
dtfdtdffgfg}|�|�}t|j|�t||�dS)Nrrr(�>@r*r,r-gN@r.r/r0r1r$r�BB)r.r1)r3r4r6r5r�viewrr%)r9r.rDZnewdtyperIr>r>r?�test_rename_fieldsas"�� 
z#TestRecFunctions.test_rename_fieldscCs�t�ddtfg�}t|�}t|d�t�dtfddtfdtfgfg�}t|�}t|d�t�dtfdgfg�}t|�}t|d	�t�g�}t|�}t|d
�dS)Nr#r!�rr!r.r/r0r1)r.)r/)r0r1)r.)r/r>r>)r3r%r5�	get_namesrr6�r9�ndtyperDr>r>r?�test_get_namesls
"


zTestRecFunctions.test_get_namescCs�t�ddtfg�}t|�}t|d�t�dtfddtfdtfgfg�}t|�}t|d�t�dtfdgfg�}t|�}t|d	�t�g�}t|�}t|d
�dS)Nr#r!rOr.r/r0r1)r.r/r0r1�r.r/r>)r3r%r5�get_names_flatrr6rQr>r>r?�test_get_names_flat~s
"


z$TestRecFunctions.test_get_names_flatc	Cs�t�ddtfg�}t|�}t|ggd��t�dtfddtfdgfg�}t|�}t|ggdgdgd��t�dtfddtfdd	tfd
tfgfgfg�}t|�}ggdgdgddgddgd�}t||�t�g�}t|�}t|i�dS)Nr#r!rOr�BA�rLz|S1)rr!rWrLrL�BBA�BBB)rr!rWrLrYrZ)r3r%r5rrr6)r9rRrDrIr>r>r?�test_get_fieldstructure�s&
���

z(TestRecFunctions.test_get_fieldstructurecCsftjgd�gd�dtfddtfdgfgd�}t|dd	d
�}ddg}tt|d
�|�t|d||d
�t|dd	d�}gd�}tt|d
�|�t|d||d
�t|dd	d�}gd�}tt|d
�|�t|d||d
�t|dd	d�}gd�}tt|d
�|�t|d||d
�t|dd	d�}gd�}tt|d
�|�t|d||d
�dS)N)�r�r"r!)rr]r\)r)rr!r\)r)r"�C)�r�rrr_r_r_)rr`)r�rrrr!rWrX��maskr%FT�Z
ignoremask�return_indexrr���)�keyre)rrr�r,)rrrr*rL)rrrrhr*)�mar4r6r5r
r�sortedrHr>r>r?�test_find_duplicates�s0
�z%TestRecFunctions.test_find_duplicatescCs�dtfg}tjgd�gd�d��|�}t|ddd�}gd�}tt|d�|�t|d	||d�t|d
dd�}gd�}tt|d�|�t|d	||d�dS)Nr.)rrrrrrhrh)rrrrrrr�rcTrd)rrrhr*rfrF)rrrrhr*�)r6rir4rMr
rrj)r9rRr.rDrIr>r>r?�test_find_duplicates_ignoremask�s

��z0TestRecFunctions.test_find_duplicates_ignoremaskcCs~tjddd�}tjd|d�}tt|�t�d��tt|�jd�ttt|�dd�|�t�tj|f�}tt|�jtju�dS)Nzu1,f4,i8T�Zalignrr$�
)	r3r%�zerosrr�itemsize�recordr�type)r9�dtr.r>r>r?�test_repack_fields�sz#TestRecFunctions.test_repack_fieldscCs�tjdgd�d�}t|�}t|tjddd��tjgd�gd�d�}tjt|dd	g�d
d�}t|t�gd���tjt|dg�d
d�}t|t�gd
���t�d��d�}t||j	�}tjddddgfddddgfddddgfddddgfgdd d!d"gfd#gd�}t||�tjgd�gd�d�}tt
tj|�t�gd$���tt
tj|dd	g�t�gd���tjgd�gd%�d�}t|�}t||j	�}t|j|u�t|j|u�tjd&d'd(gddgd)d*ggfd+d,dgd-d.gd/d0ggfggd1�d�}t|�}t||j	�}t|j|u�t|j|u�t�	dt
fd2t
fg�}	t�	d3|	fd |	fd4|	fg�}
t�d|
�}t|t
d�}t|tjd5t
d��d6d7�}
d8d9�}dAd:d;�}||
|tjtj�d(��}t||�d<tj|f�||
|
tjd'�d'��}t||�d=tj|f�|tj�}t||�d>tj|f�|tj|
|
tjd'�d'��}t||�d?tj|f�|�}tttt�d(|��tttt�d(|�tjd�ttttjd@tjd��dS)BNr*)�r.�i4)r/zf4,u2)�c�f4rr$)r*r,�f8))rrr,)r*r,�)r|��)rr~�)�r:rx)r;rz)r<r{r:r<rf)Zaxis)r(g@�"@�&@)r�@�@�$@rr)rrr(r�r,)r-r|� @r�r)r�rg*@g,@�)g0@�g2@g3@rwr/)�f0rz)�f1Zu2)ryrz�r)gUUUUUU@gUUUUUU@gUUUUUU!@r�)r�)r;rx)r<rxrrrhrmr|r}�	r~rrp�))Zx0rx)Zx1)rxr)Zx2)rx�rrr;r.ry)rrmcSst�||f�S�N)r3r%)ru�shaper>r>r?�subarray szBTestRecFunctions.test_structured_to_unstructured.<locals>.subarraycWst�dd�t|�D��S)NcSsg|]\}}d�|�|f�qS)zx{})�format)�.0�irur>r>r?�
<listcomp>$�zXTestRecFunctions.test_structured_to_unstructured.<locals>.structured.<locals>.<listcomp>)r3r%�	enumerate)Zdtsr>r>r?�
structured#szDTestRecFunctions.test_structured_to_unstructured.<locals>.structuredcSs2t�d|�}t||d�}t||�}|j|j|jfS)Nr>r$)r3rqrrr�r%)rur%�arr�retZbackarrr>r>r?�inspect&s
zATestRecFunctions.test_structured_to_unstructured.<locals>.inspect)rmrGrF)r,)rhr)N)r3rqrrr4Zmean�arangeZreshaperr%rr�baser6Zint32r�
ValueError�NotImplementedError)r9r.�outr/ryZwant�d�ddZdddZpointZtriangler��resr�r�r�rur>r>r?�test_structured_to_unstructured�s�
��
��

���
���

��z0TestRecFunctions.test_structured_to_unstructuredcCs\tjdgd�d�}ddg}tt||�t�d|��tjddg|d�}t||dd	�t|tjd
dg|jd��t||�t|tjdd
g|jd��tjddddgfgd�}ddgfg}tt||�t�d|��tjddg|d�}t||dd	�t|tjddg|jd��t||�t|tjddg|jd��t�d�t�d�}}t||�t|dd�dS)Nr)rw�r/r{�ryZu1r$�r/rzr��rr)rhr*F)Zzero_unassigned)rrr)rrhr*)rrr)rrhr*r.r�)r�)�rh)r�)�rrh))rr))rrhrhrr>)r3�onesrrr4rr%)r9r.Znewdtr/r>r>r?�test_field_assignment_by_nameAs&


z.TestRecFunctions.test_field_assignment_by_nameN)�__name__�
__module__�__qualname__r@rErJrNrSrVr[rkrnrvr�r�r>r>r>r?rs	! !Zrc@seZdZdd�Zdd�ZdS)�TestRecursiveFillFieldscCsdtjddgdtfdtfgd�}tjd|jd�}t||�}tjgd�dtfdtfgd�}t||�dS)N�rr��r�4@rr!r$r��r�r�)r�)r3r4r6r5rqr%r	r�r9r.r/rDrIr>r>r?�test_simple_flexible_s

�z,TestRecursiveFillFields.test_simple_flexiblecCsptjddgddgdtfdtfgd�}tjd|jd	�}t||�}tjgd
�gd�dtfdtfgd�}t||�dS)Nr�r��rrrarr!rbr�r$r�)r�rar`)rir4r6r5rqr%r	rr�r>r>r?�test_masked_flexiblehs�

�z,TestRecursiveFillFields.test_masked_flexibleN)r�r�r�r�r�r>r>r>r?r�]s	r�c@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�TestMergeArrayscCsxt�ddg�}t�gd��}tjddgddtfgd�}tjd	d
gdtfdd
tfdtfdgfgfgd�}||||f|_dS)Nrrrrr r#r!r$�r)rr(r>�r*)r,r-r>r.r/r0r1�bcr2r8r>r>r?r@ws� �zTestMergeArrays.setup_methodcCs||j\}}}}t|�}tjddgdtfgd�}t||�t|f�}t||�t|dd�}t||�t|dd�}t||�dS)NrFr�r�r$FrAT)r7rr3r4r6r�r9�_r:r<rDrIr>r>r?�	test_solo�s



zTestMergeArrays.test_solocCs^|jd}t|dd�}t||�t|dd�}tjddgdtfdtfd	tfgd
�}t||�dS)NrFrAT)rrr()r*r,r-r.r0r1r$)r7rrr3r4r6r5�r9r=rDrIr>r>r?�test_solo_w_flatten�s


�z#TestMergeArrays.test_solo_w_flattencCs�|j\}}}}t||fdd�}tjgd�dtfdtfgd�}t||�t||fdd�}tjgd�gd�dtfdtfgd	�}t||�t|j|j�dS)
NF��usemask�)rr)rr)rfrr�r�r$T�r`r`rarb)r7rr3r4r6rrirc�r9r�r:r;rDrIr>r>r?�
test_standard�s
�

�
zTestMergeArrays.test_standardcCs�|j\}}}}t||fdd�}tjddgdtfddtfgd�}t||�t||fd	d�}tjd
dgdtfdddtfgfgd�}t||�dS)
NTrA)rrr)rr!r"r�r#r!r$F)rr)rr r��r7rr3r4r6r5rr�r>r>r?�test_flatten�s
�

��zTestMergeArrays.test_flattencCs�|j\}}}}t||fdd�}tjddgdtfdtfdtfdtfgd	�}t||�t||fd
d�}dtfddtfddtfdtfd
gfgfgfg}tjddg|d	�}t||�dS)NTrA)rrrr()rr*r,r-r�r.r0r1r$Fr�r/r�)rr�)rr�r�)r9r=r:r�rDrIZcontroldtyper>r>r?�test_flatten_wflexible�s$
��
��
�z&TestMergeArrays.test_flatten_wflexiblecCs�|j\}}}}tjgd�gd�d�}t||fdd�}tjgd�gd�dtfd	tfgd
�}t||�t||fddd�}t||�tt|t��dS)N�rrrh�rrrrlTr�)�rrr�)rfrh)r�r`rar�r�rb)r�Z
asrecarray)	r7rir4rr6rr�
isinstancer)r9r�r:ZmxrDrIr>r>r?�test_wmasked_arrays�s
�

z#TestMergeArrays.test_wmasked_arrayscCs^tt�ddg��dtfg�t�gd��f�}tjgd�gd�dtfdtfgd�}t||�dS)	Nrrr.)r�r�rK)r�r�)rfrKr�r�rb)rr3r4rMr6rir5r)r9rDrIr>r>r?�test_w_singlefield�s�
�z"TestMergeArrays.test_w_singlefieldcCsP|jd}t|t�gd���dtfg�f�tjgd�ddtfdtfgd�dS)Nrfrr^)�rrr�r!r"r)z-1rfrr#r!r$)r7rr3r4rMr6r5)r9r<r>r>r?�test_w_shorter_flex�s

	"
�z#TestMergeArrays.test_w_shorter_flexcCsd|j\}}}}t|d|d|dfdd�}tjdgdtfdtfddd	tfgfgd
�}t||�dS)NrFr�)rr�rrr�r��f2r#r!r$r�)r9r�r:r;r<rDrIr>r>r?�test_singlerecord�s��z!TestMergeArrays.test_singlerecordN)
r�r�r�r@r�r�r�r�r�r�r�r�r�r>r>r>r?r�ts

	r�c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�TestAppendFieldscCsrt�ddg�}t�gd��}tjddgddtfgd�}tjd	d
gdtfdd
tfdtfgfgd�}||||f|_dSrr2r8r>r>r?r@�s�
�zTestAppendFields.setup_methodcCsR|j\}}}}t|dgd�d�}tjgd�gd�dtfdtfgd�}t||�dS)Nrr�r7r�r�r�rb�r7rrir4r6r�r9r�r:rDrIr>r>r?�test_append_singles
�z#TestAppendFields.test_append_singlecCs`|j\}}}}t|dgd�ddggd�}tjgd�gd�dtfd	tfd
tfgd�}t||�dS)NrOr�d��r�))rrr�)rrr�)rfrrf)�rrrr�)rrrr�rr!rbr�r�r>r>r?�test_append_doubles
�z#TestAppendFields.test_append_doublecCsP|jd}t|dgd�d�}tjgd�gd�ddtfdtfgd	�}t||�dS)
Nrfr^rr�)r�r�)rf��r)r�r��rrrr#r!rb)r7rrir4r5r6r)r9r<rDrIr>r>r?�test_append_on_flexs

�z$TestAppendFields.test_append_on_flexcCs`|jd}t|dgd�d�}tjgd�gd�dtfdd	tfd
tfgfdtfgd�}t||�dS)Nrr^rr�))rr'r)r*r+r)rf)rfr�r)�rr`rr�)rr�rr.r/r0r1rb)r7rrir4r6r5rr�r>r>r?�test_append_on_nested s

��z&TestAppendFields.test_append_on_nestedN)r�r�r�r@r�r�r�r�r>r>r>r?r��s
				r�c@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�TestStackArrayscCsrt�ddg�}t�gd��}tjddgddtfgd�}tjd	d
gdtfdd
tfdtfgfgd�}||||f|_dSrr2r8r>r>r?r@1s�
�zTestStackArrays.setup_methodcCsP|j\}}}}t|f�}t||�t||u�t|�}t||�t||u�dSr�)r7r
rr)r9r�r:rDr>r>r?r�:s


zTestStackArrays.test_solocCs�|j\}}}}t||fdd�}t�gd��}t||�t||fdd�}t�gd��}t||�t||fdd�}t�gd��}t||�dS)NFr�)rrrr)rrrrr)rrrrr)r7r
r3r4rr�r>r>r?�test_unnamed_fieldsEs

z#TestStackArrays.test_unnamed_fieldscCs�|j\}}}}t||f�}tjgd�gd�dtfddtfgd�}t||�t|j|j�t||f�}tjgd�gd�ddtfd	tfgd�}t||�t|j|j�t|||f�}tjgd
�gd�ddtfd	tfgd�}t||�dS)N))rrfrf)rrfrf)rfrr)rfr!r)�rrrr�r�r�r�r#r!rb)�rrrf�r!rrf�rfrfr�rfrfr)�rrrr�r�r�r�)r�r�r�r�r�r�)r�r�r�r�r�r�)r7r
rir4r6r5rrcr�r>r>r?�test_unnamed_and_named_fieldsUs*
�

�

�z-TestStackArrays.test_unnamed_and_named_fieldscCs�|j\}}}}tjgd�ddtfdtfgd�}t||f�}tjgd�ddtfdtfggd�d�}t||�t|j|j�t|||f�}ddtfdtfd	tfg}tjgd
�|gd�d�}t||�t|j|j�dS)N��r.r��Y@�r/r��i@�ryrK��r@r#r!r^r$)r�r�r�r�r��r�r�r�r�r��r%rcZf3))rrrfrf)r!rrfrf)r.r�r�rf)r/r�r�rf)ryrKr�rf)rfrfrfr)rfrfrfr)�rrrrr��rrrrr�r��rrrrr�)	r7r3r4r5r
rirrcr6)r9r�r:r<�zzrDrIrRr>r>r?�test_matching_named_fieldsus&
�
�

�
z*TestStackArrays.test_matching_named_fieldscCs�|j\}}}}tjgd�ddtfdtfgd�}dddd	d
�}t||f|d�}tjgd�ddtfdtfggd
�d�}t||�t|j|j�t|j|j�dS)Nr�r#r!r^r$z???g8������g�i��)rr!r^�D)�defaults))rrr�)r!rr�r�r�r�r�r�)r7r3r4r5r
rirrc)r9r�r<r�r�rDrIr>r>r?�
test_defaults�s
�
�
zTestStackArrays.test_defaultscCs�dtfdtfdtfg}tjdgdg|d�}dtfdtfdtfg}tjdg|d�}tjddgdd	g|d�}t||fd
d�}t||�t|j|j�tt	�� t||fdd�Wd�n1s�0YdS)
Nrr!r^r��rrrrb�r*r,rmr$r�T)ZautoconvertF)
r6�boolr5rir4r
rrcr�	TypeError)r9�adtyper.�bdtyper/rIrDr>r>r?�test_autoconversion�s�

z#TestStackArrays.test_autoconversioncCs�dtfdtfdtfg}tjdgdg|d�}dtfdtfdtfg}tjdg|d�}t||f�}tjddgdd	g|d�}t||�t|j|j�dS)
N)r.r)r/r!)ryr^r�rrbrr$r�)r6rr5rir4r
rrc)r9rr.rr/rDrIr>r>r?�test_checktitles�s�
z TestStackArrays.test_checktitlesc	Cstjddgddtdfgd�}tjddgd	fd
dgdfd
dgdfgddtdfdtfgd�}t||f�}tjddgdfddgdfddgd	fddgdfddgdfgddgdfddgdfddgdfddgdfddgdfg|jd�}t|j|j�t||�t|j|j�dS)Nr�)r!rr#r!rFr$r.r�r�r/r�r�ryrKr�r^�Arr�Br"�a�b�cFT)r7rcr%)r3r4r5r
rir%rrc)r9r<r�r��expectedr>r>r?�
test_subdtype�s:����




�




��
zTestStackArrays.test_subdtypeN)r�r�r�r@r�r�r�r�rrrrr>r>r>r?r�/s	 r�c@sleZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�
TestJoinByc	Cs�tjttt�d�t�dd�t�dd���dtfdtfdtfgd	�|_tjttt�d
d�t�dd
�t�dd���dtfdtfdtfgd	�|_dS)Nr�2�<r��nr.r/ryr$r,r��A�Kr��r3r4�list�zipr�r6r.r/�r9r>r>r?r@�s
��
��zTestJoinBy.setup_methodcCs\|j|j}}td||dd�}tjgd�dtfdtfdtfdtfdtfgd	�}t||�dS)
Nr.�inner)�jointype))r,�7r�ir�)rm�8�B�j�e)r|�9�C�k�f)r}�:�D�l�g)r��;�E�m�h�b1�b2ryr�r$�r.r/rr3r4r6rr�r>r>r?�test_inner_join�s
��zTestJoinBy.test_inner_joincCsH|j|j}}td||�tjgd�dtfdtfdtfdtfgd�dS)NrT))r,rrr�)rmrr r!)r|r"r$r%)r}r&r(r))r�r*r,r-r.r/ryr�r$)r.r/rr3r4r6�r9r.r/r>r>r?�	test_join�s
��zTestJoinBy.test_joincCs^tjdgdtfgd�}tjdt�gd��fgdtfdgd�}td||�}t||�tj��dS)NrFrgr$rr�)�valueZuint16rh)r3r4r6rrrMriZMaskedArray)r9ZfooZbarr�r>r>r?�test_join_subdtypes�
�zTestJoinBy.test_join_subdtypecCsZ|j|j}}td||d�}tjgd�gd�dtfdtfdtfdtfgd	�}t||�dS)
NrTZouter)�rrr�rf�r�3r!rf�r�4r%rf�rh�5r)rf�r*�6r-rf�r,rrrf)r,rrfr��rmrr rf)rmrrfr!�r|r"r$rf)r|r#rfr%�r}r&r(rf)r}r'rfr)�r�r*r,rf)r�r+rfr-)r�Frfr)r~�Grfr )r�Hrfr$)rp�Irfr()r��Jrfr,)r�r�r�r�r�r��rrrrr�rIr�rIr�rIr�rIrIrIrIrIrIr.r/ryr�rb�r.r/rrir4r6rr�r>r>r?�test_outer_joins


��zTestJoinBy.test_outer_joincCsZ|j|j}}td||d�}tjgd�gd�dtfdtfdtfdtfgd	�}t||�dS)
NrTZ	leftouter)
r6r7r9r;r=r?r@rArBrC)
r�r�r�r�r�r�r�r�r�r�r.r/ryr�rbrJr�r>r>r?�test_leftouter_join(s
�zTestJoinBy.test_leftouter_joincCsPtjdgd�d�}tjdgd�d�}tddg||ddd	�}t|jjgd
��dS)Nrh�rwr�r�r$�r�r�rwryr/rF)rr�)r/ryZa1Za2)r3rqr�rrr%�names)r9r.r/�jr>r>r?�test_different_field_order9sz%TestJoinBy.test_different_field_ordercCs<tjdgd�d�}tjdgd�d�}tttgd�||�dS)NrhrMr$rN)r.r/r/)r3rqr�rr�rr2r>r>r?�test_duplicate_keysAszTestJoinBy.test_duplicate_keyscCsjt�ddg�}t�ddg�}t�gd��}tjddg|d�}tjdd	g|d�}td
||�}t|j|�dS)N)rgZS5�r4�<f4�rgZS10)rU�Zvalue1rT)�value2rT��Sarahr���Johnr-r$�rYr��r[r�rg�r3r%r4rr�r9�a_dtype�b_dtype�expected_dtyper.r/r�r>r>r?�#test_same_name_different_dtypes_keyFsz.TestJoinBy.test_same_name_different_dtypes_keycCsjt�ddg�}t�ddg�}t�gd��}tjddg|d�}tjdd	g|d�}td
||�}t|j|�dS)NrUrS)r4�<f8))rgz|S10rV)rWrdrXrZr$r\r]rgr^r_r>r>r?�test_same_name_different_dtypesRsz*TestJoinBy.test_same_name_different_dtypescCs�t�dtdfdg�}tjgd�tjfgd�dfg|d�}t�dtdfdg�}tjgd�dfgd	�dfg|d�}t�dtdfddg�}tjgd�tjdfg|d�}td||�}t|j|�t||�dS)
N�posrh)�frT)rrrr�r�r$)�grT)rhrr)r3r%r6r4Zpirr)r9r`r.rar/rbrr�r>r>r?�test_subarray_key_s$"zTestJoinBy.test_subarray_keycCsntjddd�}d|_tt|j�d�t�ddg|�}t�dd	g|�}td
||�}t�gd��}t|j|�dS)Nzi1,f4Tro)�k�vrhr�)rhrr�r�rj))rjZi1)Zv1rz)Zv2rz)	r3r%rOr�lenZdescrr4rr)r9rur.r/r�rbr>r>r?�test_padded_dtypemszTestJoinBy.test_padded_dtypeN)r�r�r�r@r1r3r5rKrLrQrRrcrerirmr>r>r>r?r�s	
rc@s8eZdZedd��Zdd�Zdd�Zdd�Zd	d
�ZdS)�TestJoinBy2c	Cs�tjttt�d�t�dd�t�dd���dtfdtfdtfgd	�|_tjttt�d�t�d
d�t�dd���dtfdtfdtfgd	�|_dS)
Nrrrr�rr.r/ryr$rrr�r)�clsr>r>r?r@s
��
��zTestJoinBy2.setup_methodcCs`|j|j}}td||dddd�}tjgd�dtfdtfdtfd	tfd
tfgd�}t||�dS)Nr.rB�2r��	r1postfix�	r2postfixr�
)rrrr�r�)rr8rr!r!)rr:r#r%r%)rhr<r'r)r))r*r>r+r-r-)r,rrDrr)rmrrEr r )r|r"rFr$r$)r}r&rGr(r()r�r*rHr,r,r/r/ryr�r$r0r�r>r>r?�test_no_r1postfix�s�
��zTestJoinBy2.test_no_r1postfixc	Cstttd|j|jddd�dS)Nr.rB)rrrs)rr�rr.r/rr>r>r?�test_no_postfix�s�zTestJoinBy2.test_no_postfixcCs`|j|j}}td||dddd�}tjgd�dtfdtfdtfd	tfd
tfgd�}t||�dS)Nr.�1rBrrqrtr.r/ryr�r$r0r�r>r>r?�test_no_r2postfix�s�
��zTestJoinBy2.test_no_r2postfixc
Cs&tjttt�ddgd�t�t�d�d�t�dd�t�dd���dtfd	tfd
tfdtfgd�}tjttt�ddgd�t�t�d�d�t�d
d�t�dd���dtfd	tfd
tfdtfgd�}tjgd�dtfd	tfdtfdtfdtfdtfgd�}td	dg||dddd�}t	|j
|j
�t	||�dS)Nrr~r,rrrrrjr.r/ryr$rrr)
)rrrrrr)r~rr8rr~r)rrr:r#rr)r~rr<r'rprh)rrr>r+r�r*)r~rrrDr�r,)rrhrrE�rm)r~rhr"rFr�r|)rr*r&rG�r})r~r*r*rH�r�r.r/Zc1Zc2rwrprrq)r3r4rrZtile�repeatr�r6rrr%)r9r.r/rIrDr>r>r?�test_two_keys_two_vars�s(&��&��
���z"TestJoinBy2.test_two_keys_two_varsN)	r�r�r��classmethodr@rurvrxr}r>r>r>r?rn~s
rnc@s eZdZdZdd�Zdd�ZdS)�TestAppendFieldsObjz;
    Test append_fields with arrays containing objects
    cCs$ddlm}t|ddd�d�|_dS)Nr)�datei�r)�obj)Zdatetimer��dictr7)r9r�r>r>r?r@�sz TestAppendFieldsObj.setup_methodcCs�|jd}tj|df|dfgdtfdtfgd�}tjddgtd�}t|d	|d
d�}tj|ddf|ddfgdtfdtfd	tfgd�}t||�dS)
z7Test append_fields when the base array contains objectsr�rr"rr!r$rrr^F)r7r�N)r7r3r4�objectr5r6rr)r9r�r:r;rDrIr>r>r?�test_append_to_objects�s
��z*TestAppendFieldsObj.test_append_to_objectsN)r�r�r��__doc__r@r�r>r>r>r?r�sr).ZpytestZnumpyr3Znumpy.mariZnumpy.ma.mrecordsrZnumpy.ma.testutilsrZ
numpy.testingrrZnumpy.lib.recfunctionsrrrr	r
rrr
rrrrrrr�libZrecfunctionsZ_get_fieldspecZ
get_fieldspecrPrUZ
_zip_descrrCZ
_zip_dtypeZ	zip_dtyperr�r�r�r�rrnrr>r>r>r?�<module>s0D




K6,%A

Zerion Mini Shell 1.0