HOME


sh-3ll 1.0
DIR:/usr/local/lib64/python3.6/site-packages/numpy/ma/tests/__pycache__/
Upload File :
Current File : //usr/local/lib64/python3.6/site-packages/numpy/ma/tests/__pycache__/test_extras.cpython-36.pyc
3

���h~�@s�dZddlZddlZddlZddlZddlmZmZddl	m
Z
mZmZm
Z
ddlmZmZmZmZmZmZmZmZmZmZmZddlmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;Gdd�d�Z<Gd	d
�d
�Z=Gdd�d�Z>Gd
d�d�Z?Gdd�d�Z@Gdd�d�ZAGdd�d�ZBGdd�d�ZCGdd�d�ZDGdd�d�ZEGdd�d�ZFGdd�d�ZGGdd �d �ZHGd!d"�d"�ZIdS)#z�Tests suite for MaskedArray.
Adapted from the original test_ma by Pierre Gerard-Marchant

:author: Pierre Gerard-Marchant
:contact: pierregm_at_uga_dot_edu
:version: $Id: test_extras.py 3473 2007-10-29 15:18:13Z jarrod.millman $

�N)�assert_warns�suppress_warnings)�assert_�assert_array_equal�assert_equal�assert_almost_equal)�array�arange�masked�MaskedArray�masked_array�getmaskarray�shape�nomask�ones�zeros�count)!�
atleast_1d�
atleast_2d�
atleast_3d�mr_�dot�polyfit�cov�corrcoef�median�average�unique�setxor1d�	setdiff1d�union1d�intersect1d�in1d�ediff1d�apply_over_axes�apply_along_axis�compress_nd�compress_rowcols�mask_rowcols�clump_masked�clump_unmasked�flatnotmasked_contiguous�notmasked_contiguous�notmasked_edges�
masked_all�masked_all_like�isin�diagflat�stack�vstackc@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�TestGenericcCsJtdtd�}tddgddgtd�}t||�tjddgddgd��}td
|d�}tddgddg|d�}t||�td|d�}tddgddggddgddgg|d�}t||�tjddddgfg�}td|d�}td d"gd$d&g|d�}t||�td'|d�}td)d+gd-d/g|d�}t||�td0|d�}td2ggd4gg|d�}t||�dS)5N�)�dtype�)�maskr6�a�b�f)�names�formatsr�ba�bb)r5)r5)rr)rr)r7r7)r7r7)r5r5)rr)rr)rr)rr)r7r7)r7r7)r7r7)r7r7)r9r;)r>r;)r?r;)r5�r7r7)r7r@�r7r7)r7rA�r7r7)r7rB�r7r7)r7rC)r5�r7r7)r7rD�r7r7)r7rE�r7r7)r7rF�r7r7)r7rG)r7r7�r7r7)r7rH�r7r7)r7rI)r.�floatrr�npr6)�self�test�control�dt�rP�;/tmp/pip-build-5_djhm0z/numpy/numpy/ma/tests/test_extras.py�test_masked_all%s0




zTestGeneric.test_masked_allcCs�tjddtfgdffg�}tjjd|�}tt|d�tjjj�tt|dd�tjjj�tt	|dd�d�t|ddj
d�t|ddjj
f�dS)Nr:�cr7)r7)r7)r7r7)rKr6�object�mar.r�type�corer�lenr�_fill_value)rL�my_dtype�
masked_arrrPrPrQ�"test_masked_all_with_object_nestedCsz.TestGeneric.test_masked_all_with_object_nestedcCsrtjdtdffg�}tjjd|�}tt|d�tjjj�tt	|d�d�t|dj
d�t|djj
f�dS)Nr:r7)r7)r7)r7r7)rKr6rTrUr.rrVrWrrXrrY)rLrZr[rPrPrQ�test_masked_all_with_objectOsz'TestGeneric.test_masked_all_with_objectcCs�tddgtd�}t|�}tddgddgtd�}t||�tjddgddgd��}td
dgddg|d�}t|�}tddgddg|d�}t||�tjddddgfg�}tddgddg|d�}t|�}t||�dS) Nr7r5)r6)r8r6r9r:r;)r<r=r�
r>r?)rr)rr)r7r7)r7r7)r^r^)r^r^)r7r7)r7r7)r9r;)r>r;)r?r;�r7r7)r7r_�r7r7)r7r`�r7r7)r7ra�r7r7)r7rb)rrJr/rrKr6)rL�baserMrNrOrPrPrQ�test_masked_all_likeYs

z TestGeneric.test_masked_all_likec	Cs�x�tdd�D]�}x�td|�D]�}tj|td�}tj||td�}td|�}|d|@dk|_d}x"||�D]}||j|j�7}qlW|t	kr�t
|j�j�|�q|j|_t
|j�j�|�qWqWdS)Nr7�r5)r6r)�rangerKr	�int�fullrr8�data�sumr*r�
compressed)	rLr;�i�j�k�jar9�s�slrPrPrQ�check_clumpms
zTestGeneric.check_clumpcCs^ttjd��}t|ddddddg<t|�}tdd�tdd	�tdd�g}t||�|jt�dS)
Nr^rr7r5���	�re)rrKr	r
r)�slicerrr)rLr9rMrNrPrPrQ�test_clump_masked}s
zTestGeneric.test_clump_maskedcCsVttjd��}t|ddddddg<t|�}tdd�td	d�g}t||�|jt�dS)
Nr^rr7r5rsrtrurvre)rrKr	r
r*rwrrr)rLr9rMrNrPrPrQ�test_clump_unmasked�s
zTestGeneric.test_clump_unmaskedcCs�td�}t|�}t|td|j�g�tjdtd�|_t|td|j�g�t	||dk|dkB|dkB<t|�}t|tdd�tdd�g�t	|dd�<t|�}t|g�dS)	Nr^r)r6rvrt�rsru)
r	r+rrw�sizerKr�boolr8r
)rLr9rMrPrPrQ�test_flatnotmasked_contiguous�sz)TestGeneric.test_flatnotmasked_contiguousN)�__name__�
__module__�__qualname__rRr\r]rdrrrxryr}rPrPrPrQr4#s

r4c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�TestAveragecCs<tddddgddddgd�}tdt|dd	��tdt|ddddgd
��t|ddddgdd�\}}td|�t|dk�t|dd�<tt|dd	�jdg�tddddgddddgd�}|jd
d
�}t|dd�df<tt|dd	�ddg�tt|dd	�jddg�tddgt|dd	��t|ddd�\}}t|ddg�dS)Ngg�?g@g@TF)r8r)�axis)�weights)r��returnedg@r5r7)r�r�)rrrrr
r8�reshape)rLZott�result�wtsrPrPrQ�test_testAverage1�s 
zTestAverage.test_testAverage1cCs�ddddddg}ddddddgddddddgg}tdtjd�}tt|dd�d�tt|d|d�d�ttdtjd�dtd�g�}tt|d�tjjtjd��d	d
�tt|dd�tjd�d	d�tt|dd�t|dd�t|dd�dg�tt|d|d�d�tt|d|d�dddd	ddg�tt|dd�t|dd�t|dd�dg�td�}ddddddg}ddddddgddddddgg}t	d�}ddddddg}	ttt
||�dd�d�ttt
||�dd�d�ttt
||�dd�jdg�ttt
||	�dd�d�tttt
||�dd��d�t
||�}
tt|
d�d�tt|
dd�ddddddg�tt|
dd�ddg�tt|
d|d�ddddddg�dS)Nrr7rs)r6)r�g@)r�r�g@g@g(@)r�g4@g@gg�?g@g$@Tg�X@g@g@g������
@g������
@)
r	rKZfloat_rrr�add�reducerrrr8r)rL�w1�w2�x�y�m1�m2Zm3Zm4Zm5�zrPrPrQ�test_testAverage2�s> &  
zTestAverage.test_testAverage2cCsftd�}td�d}t||g||ggddd�\}}tt|�t|��t|j|j�ttd�dddgdd�\}}tt|�t|��ttd�dd	�\}}tt|�t|��ttd�td�dd
�\}}tt|�t|��tddgddggt�}t|ddgddgg�}t|dd
�}	t|	ddg�t|dd
�}
t|
ddg�t|dd
�}
t|
d�t|dd
�}
t|
ddg�dS)Nrsrvr7T)r�r�r5r)r�r�r�)r�)r�r��F)r�g�?g@g�?g@g�?g@)r5r5rv)r5r5rv)r5r5rv)r5r5rvg������@)r	rrrrrrJr)rLr9r:Zr1r�Zr2r�Za2dZa2dmZa2daZa2dmarPrPrQ�test_testAverage3�s*
zTestAverage.test_testAverage3cCsHttddg��}t|d�ttddddgddddgd��}t|d�dS)	Nr7r5g�?rvr�FT)r8)rrr)rLr9rPrPrQ�test_onintegers_with_mask�s
 z%TestAverage.test_onintegers_with_maskc
Cstjdddddgdddddggtd�}tdddddgddddd gg|d�}t|�}tj|j��}t|j|j�t|j|j�t|dd�}t|jdd�t|jdd�d}t|j|j�t|j|j�t|dd�}t|jdd�t|jdd�d}t|j|j�t|j|j�tjdddddgdddddgg�}	t||	d�}
tj|j�|	|d�}t|
j|j�t|
j|j�t||	dd�}t|j|	dd�t|j|	dd�d}t|j|j�t|j|j�t||	dd�}t|j|	dd�t|j|	dd�d}t|j|j�t|j|j�dS)!Nrr7)r6y@rvy@rzy@rey @y"@y�?r5y@r�y@y@)r8)r�g�?g�?g@)r�)r�r�y�?@y@@y@@y@ @y�?y@@y@@y@@)	rKrr|rrrkr�real�imag)
rLr8r9�av�expectedZav0Z	expected0Zav1Z	expected1r�ZwavZwav0Zwav1rPrPrQ�test_complex�sB  zTestAverage.test_complexN)r~rr�r�r�r�r�r�rPrPrPrQr��s
"r�c@s$eZdZdd�Zdd�Zdd�ZdS)�TestConcatenatorcCs�ttd	tddddddg��td�}dddddg}t||d�}t|dd|f}tt|t��t|ddddddddddddg�t|jt|dd|f�dS)
Nr7r5rvr�rzrsr)r8)r7r5rvr�rzrs)	rrrrrr�
isinstancerr8)rLr:�m�drSrPrPrQ�test_1d+s"zTestConcatenator.test_1dcCs0tjjdd�}tjjdd�}tjtjjdd�d�}tjtjjdd�d�}t||d�}t||d�}td||f}t|jdk�t|dd�dd�f|�t|dd�dd�f|�t|j	tj
d||f�t||f}t|jdk�t|dd�dd�f|�t|dd�dd�f|�t|j	tj
||f�dS)Nrzr)r8�1r^)rzr^)r^rz)rK�random�randZround_rrrrrr8Zr_)rLZa_1Za_2Zm_1Zm_2Zb_1Zb_2r�rPrPrQ�test_2d6s zTestConcatenator.test_2dcCsrttjjdf}t|jddg�t|jdd�tddgtjjf}t|jdddg�t|jdd�ddg�dS)Nr7TFr5)rrKrUr
rr8ri)rL�actualrPrPrQ�test_masked_constantJsz%TestConcatenator.test_masked_constantN)r~rr�r�r�r�rPrPrPrQr�(sr�c@seZdZdd�Zdd�ZdS)�
TestNotMaskedcCs�ttjd�jdd�dddddgdddddgdddddgdddddgdddddggd�}t|d�}t|ddg�t|d�}t|dd
dg�t|ddd
g�t|d�}t|dddg�t|dddg�t|jd�}t|ddg�t|jd�}t|dddg�t|dddg�t|jd�}t|dddg�t|dddg�t|d<t|d�}t|dddg�t|dddg�t|d �}t|dd!d"g�t|dd#d$g�dS)%N�rzrr7)r8�r5rvr�)rrr7rr)rr7r5rvr�)rvrvrvr�r�)rr7r5rvr�)rr7r5rvr�)rrr5rrv)rr7r5rvr�)r�r5r�r�r�)rrrrr)rr7r5rvr�)r�r�r�r�r�)rr7r5rvr����)rr7r5rvr�)rrrrr)rr7r5rvr�)r�r�r�r�r����)rrr7rr)rr7r5rvr�)r7r7r5r�r�)rr7r5rvr�r�)rr7r5r�)rrr5rv)rr7r5r�)r�r5r�r�)rrKr	r�r-rrir
)rLrirMrPrPrQ�
test_edgesWs:




zTestNotMasked.test_edgesc
CsPttjd�jdd�ddddddddgddddddddgddddddddggd�}t|d�}t|tddd�tdd	d�td
dd�g�t|d�}t|tddd�tddd�gtddd�tddd�gtddd�tddd�gtddd�tddd�gtddd�gtddd�ggtddd�gg�t|d�}t|tddd�ggtddd�td
dd�gg�dS)Nr�rvrtrr7)r8r����r5rsre)rrKr	r�r,rrw)rLr9�tmprPrPrQ�test_contiguousys0




zTestNotMasked.test_contiguousN)r~rr�r�r�rPrPrPrQr�Ts"r�c@s~eZdZdd�Zdd�Zdd�Zejjddd	d
g�ejjddge	j
jd	fe	j
jd
fg�d
d���Z
dd�Zdd�Zdd�ZdS)�TestCompressFunctionscCs>tjttd?���jddd�}tjd@�jt�}d|dA<t||d�}t|�}t	|ddddgd	d
ddgd
dddggddddgddddgddddggg�t|d�}t	|dddddgddddd gd	d!d
ddgd
d"dddggdd#dddgd$d%d&d'd(gdd)dddgdd*dddggg�t|d�}t	|dddddgd	d!d
ddgd
d"dddggd+d,d-d.d/gd0d1d2d3d4gd5d6d7d8d9ggdd#dddgdd)dddgdd*dddggg�t|dB�}t|dC�}t|dE�}t	||�t	||�t	||�t|d�}t	|ddddgdddd gd	d
ddgd
dddggd+d-d.d/gd:d;d<d=gd0d2d3d4gd5d7d8d9ggddddgd$d&d'd(gddddgddddggg�t|dF�}t|dG�}t|dI�}t	||�t	||�t	||�t|dJ�}t	|dddddgd	d!d
ddgd
d"dddggdd#dddgdd)dddgdd*dddggg�t|dL�}t	||�t|dM�}t	|ddddgd	d
ddgd
dddggd+d-d.d/gd0d2d3d4gd5d7d8d9ggddddgddddgddddggg�t|dO�}t|dQ�}t|dT�}t	||�t	||�t	||�t|dU�}t	|ddddgdddd gd	d
ddgd
dddggddddgd$d&d'd(gddddgddddggg�t|dW�}t	||�dS)XNrvr�rzTr7)r8rr5r^��
������(�*�+�,�2�4�5�6�7�9�:�;rsrertru�r��)�-�.�/�0�1�3�8��r�r�r���� �!�"�#�$�%�&�'r����r��<)rvr�rz)r7r7r7)r7r�r�)r�)r5r�r�)r�)rr7r�)rr�)r7r5r�)r�r5r�)r7r�r�r�)r�r�)rr5r�)rr�)
rKr�listrfr�r�astyper|r&r)rLr�r�r9�a2�a3Za4rPrPrQ�test_compress_nd�s�















































z&TestCompressFunctions.test_compress_ndcCs�ttjd�jdd�dddgdddgdddggd�}tt|�ddgdd	gg�tt|d�dddgd
dd	gg�tt|d�ddgddgdd	gg�t|jdddgdddgdddggd�}tt|�ddgd
d	gg�tt|d�dddgd
dd	gg�tt|d�ddgddgd
d	gg�t|jdddgdddgdddggd�}tt|�d	gg�tt|d�d
dd	gg�tt|d�dgdgd	gg�t|jdddgdddgdddggd�}tt|�jd�tt|d�jd�tt|d�jd�dS)Nrurvr7r)r8r�rzrertrsr5)rrKr	r�rr'�_datar{)rLr�rPrPrQ�test_compress_rowcolss"  "& "&&z+TestCompressFunctions.test_compress_rowcolscCs�ttjd�jdd�dddgdddgdddggd�}tt|�jdddgdddgdddgg�tt|d�jdddgdddgdddgg�tt|d�jdddgdddgdddgg�t|jdddgdddgdddggd�}tt|�jdddgdddgdddgg�tt|d�jdddgdddgdddgg�tt|d�jdddgdddgdddgg�t|jdddgdddgdddggd�}tt|�jdddgdddgdddgg�tt|d�jdddgdddgdddgg�tt|d�jdddgdddgdddgg�t|jdddgdddgdddggd�}tt|�j	�t
k�tt|d�j	�t
k�tt|d�j	�t
k�tt|�jj	��tt|d�jj	��tt|d�jj	��dS)Nrurvr7r)r8)rrKr	r�rr(r8r�r�allr
)rLr�rPrPrQ�test_mask_rowcols s: 
&
&
&z'TestCompressFunctions.test_mask_rowcolsr�Nrr7�func�rowcols_axiscCsfttjd�jdd�dddgdddgdddggd�}tt��"|||d�}t|t||��WdQRXdS)Nrurvr7r)r8)r�)rrKr	r�r�DeprecationWarningrr()rLr�r�r�r��resrPrPrQ�#test_mask_row_cols_axis_deprecation@s
 
z9TestCompressFunctions.test_mask_row_cols_axis_deprecationcCs tjdd�}ddddddg}t||d�jdd�}t||d�jdd�}t||dd�}t|jddgddgg�t||dd�}t|jdddgdddgdddgg�t||d	d�}t|tj|jd�|jd���t||d	d�}t|tj|jd�|jd���ddddddg}t||d�jdd�}t||d�jdd�}t||dd�}t|jddgddgg�t||dd�}t|jdddgdddgdddgg�t||d	d�}t|tj|jd�|jd���t|t||��t||d	d�}t|tj|jd�|jd���ddddddg}t||d�jdd�}t||d�jdd�}t||�}t|jt�t||�}t|jt�t|ddddddgd�jdd�}t|ddddddgd�jdd�}t||dd�}t|jddgddgg�t||d	d�}t|tj|jd�|jd���t||dd�}t|jdddgdddgdddgg�t||d	d�}t|tj|jd�|jd���t|ddddddgd�jdd�}t|ddddddgd�jdd�}t||dd�}t|jddgddgg�t||�}t|tj|jd�|jd���t||dd�}t|jdddgdddgdddgg�t||d	d�}t|tj|jd�|jd���t|ddddddgd�jdd�}t|ddddddgd�jdd�}t||dd�}t|jddgddgg�t||d	d�}t|tj|jd�|jd���t||dd�}t|jdddgdddgdddgg�t||d	d�}t|tj|jd�|jd���dS)
Nr7rer)r8r5rvT)�strictF)	rKr	rr�rrr8�filledr)rL�nr�r9r:rSrPrPrQ�test_dotLsz$$

  $  
$  $zTestCompressFunctions.test_dotcCsntjd�}t|�}ttt||��tk�ttt||��tk�ttt||��tk�ttt||��tk�dS)Nrv)rK�eyerrrVrr)rLr9r:rPrPrQ�test_dot_returns_maskedarray�s
z2TestCompressFunctions.test_dot_returns_maskedarraycCsDttjd��}ttjd��}t|||d�}t||k�t||�dS)Nrv)�out)rvrv)rrKr�rrrr)rLr9r�r�rPrPrQ�test_dot_out�s
z"TestCompressFunctions.test_dot_out)r~rr�r�r�r��pytest�markZparametrizerKrUZ	mask_rowsZ	mask_colsr�r�r�r�rPrPrPrQr��sp $
F	r�c@seZdZdd�Zdd�ZdS)�TestApplyAlongAxiscCs@td�jddd�}dd�}t|d|�}t|ddgdd	gg�dS)
Ng(@r5rvcSs|dS)Nr7rP)r:rPrPrQ�myfunc�sz*TestApplyAlongAxis.test_3d.<locals>.myfuncr7r�rer^)r	r�r%r)rLr9r��xarPrPrQ�test_3d�szTestApplyAlongAxis.test_3dcCsFtd�jddd�}ddd�}t|d|dd�}t|dd	gd
dgg�dS)
Nr�r5rvrcSs|d|S)Nr7rP)r:�offsetrPrPrQr��sz1TestApplyAlongAxis.test_3d_kwargs.<locals>.myfuncr7)r�rzrtr�)r)r	r�r%r)rLr9r�r�rPrPrQ�test_3d_kwargs�s
z!TestApplyAlongAxis.test_3d_kwargsN)r~rr�r�r�rPrPrPrQr��s
r�c@seZdZdd�ZdS)�TestApplyOverAxescCs�td�jddd�}ttj|ddg�}tjdgdgdggg�}t||�t||djt	�<ttj|ddg�}tjd	gd
gdggg�}t||�dS)Nr�r5rvr�rr��\�|r�r�)
r	r�r$rKrjrrr
r�r|)rLr9rMZctrlrPrPrQ�
test_basic�s
zTestApplyOverAxes.test_basicN)r~rr�r�rPrPrPrQr��sr�c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-S).�
TestMediancCs4tjjtjtjgtjtjggdd�}t|tj�dS)Nr7)r�r�)rKrUr�infr)rL�rrPrPrQ�test_pytype�s$zTestMedian.test_pytypecCs�tjjtjjtjtjgtjtjgg�dd�}t|tj�tjjtjjtjtjgtjtjgg�dd�}t|tj�tjjtjjtjtjgtjtjggdd�dd�}t|jd�tjjtjjtjtjgtjtjggdd�dd�}t|jd�dS)Nr7)r�T)r8r�r�)rKrUrrrrr8)rLrrPrPrQ�test_inf�szTestMedian.test_infcCsltjd�}ttjj|�d�tttjj|��tk	�td�}ttjj|�d�tttjj|��tk	�d}ttjj|�d�tttjj|��tk	�tjd�j	dd�}ttjj|dd�tj|dd��ttjj|d	d�tj|d	d��ttjj|d	d�tk	�tjd�j	dd�}ttjj|dd�tj|dd��ttjj|d	d�tj|d	d��ttjj|d	d�tk	�dS)
Nrug@rtg@rzg@r)r�r7g @�HgR@)
rKr	rrUrrrVrrfr�)rLr�rPrPrQ�test_non_masked�s"
    zTestMedian.test_non_maskedcCsttjd�dgddgdd�}ttjj|�d�ttjj|�jfd�tttjj|��t	k	�ttjd�j
d	d
�dgddgdd�}ttjj|�d�ttjj|�jfd�tttjj|��t	k	�tjj|dd
d�}t|ddg�t|jdd�tt|�t	k�dS)z5test the examples given in the docstring of ma.medianrtrr�r7)r8g�?zshape mismatchr^r5rzrsg@T)r��overwrite_inputg@g@Nr�)r5)rrKr	rrUrrrrVrr�)rLr�Zma_xrPrPrQ�test_docstring_examples�s"*z"TestMedian.test_docstring_examplescCsd}�xtd�D]�}x�dD]�}td||d�}tjt||�ddg�}xP|D]H\}}ytjj|||d�WqJtk
r�t|||||f��YqJXqJWtj|d|gddg�}xR|D]J\}}ytjj|||d�Wntj	k
r�Yq�Xt|||||f��q�WqWqWdS)	Nz5mask = %s, ndim = %s, axis = %s, overwrite_input = %srzFTr7)�ndminr8)r�r)FT)
rfr�	itertools�productrKrUr�	Exception�AssertionErrorZ	AxisError)rL�msgr	r8r��argsr�ZoverrPrPrQ�test_axis_argument_errorss"
z$TestMedian.test_axis_argument_errorscCsDtddd�}ttjj|�d�tddd�}ttjj|�tjj�dS)Nr7F)r8T)rrrKrUrr
)rLr�rPrPrQ�test_masked_0dszTestMedian.test_masked_0dcCs�ttjd�dd�}ttjj|�tjj�ttjj|�jfd�tt	tjj|��tjj
jk�ttjd�dd�}ttjj|�d�ttjj|�jfd�tt	tjj|��tk	�ttjd�dddddgd�}ttjj|�d	�ttjj|�jfd�tt	tjj|��tk	�ttjd�dddddgd�}ttjj|�d
�ttjj|�jfd�tt	tjj|��tk	�ttjd�dddddgd�}ttjj|�d�ttjj|�jfd�tt	tjj|��tk	�ttjd�dddddgd�}ttjj|�d�ttjj|�jfd�tt	tjj|��tk	�ttjd
�ddddddgd�}ttjj|�d	�ttjj|�jfd�tt	tjj|��tk	�ttjd�ddddddgd�}ttjj|�d	�ttjj|�jfd�tt	tjj|��tk	�dS)NrzT)r8zshape mismatchFg@rr7g@gg@g@rsg@)
rrKr	rrUrr
rrrVrWZMaskedConstantr)rLr�rPrPrQ�test_masked_1d s@zTestMedian.test_masked_1dcCsJttjjtdddgdddgd��jtjjtdddgdddgd��j�dS)Nr7r5rvr)r8)rrKrUrrr)rLrPrPrQ�test_1d_shape_consistencyFs"z$TestMedian.test_1d_shape_consistencycCsd	\}}ttjd
d|��}t|dd�<|dd�<ttj||ftd��}|dd�|dd�df<tjt|��}x2td|�D]$}tj	j
|�|||dd�|f<qzWtt|dd�df�d�tt|�d�tt|dd�tj
|��tt|jdd�tj
|��dS)N�er�g�?r^)r6rr7)r�)rr�g�i����)rrKZlinspacer
�emptyrJr	rXrfr��shufflerrr�T)rLr��pr�r��idxrlrPrPrQr�JszTestMedian.test_2dcCs�ttjd�jdd��}t|dd�<|d
d�<tt|�d�tttj	j|��t
k	�tt|dd�dddg�tttj	j|dd��t
k�tt|d	d�ddddd
dddddg
�tttj	j|d	d��t
k�tt|d	d�jd	d	d	ddddd	d	d	g
�dS)Nr�r^rvg-@r)r�g+@g/@r7r�r�r����)rrKr	r�r
rrrrVrUrr8)rLr�rPrPrQ�
test_2d_waxisZs&zTestMedian.test_2d_waxiscCs�tjjd�jddd�}t||ddk<tt|d�ddgdd	gddgd
d	gg�d|_tt|d�ddgd
dgddgg�tjjd�jddd�}t||ddk<tt|d�ddgddgddgg�dS)Nr�rvr�r5rr�rursr�r��cr^r�r�r�rzrtr�r�)r�rvr5)rKrUr	r�r
rrr)rLr�rPrPrQr�fs("zTestMedian.test_3dcCsLttjd�jdd��}t|dd�<|dd�<tt|dd�t|dd��dS)Nr�r^rvr7)r�rr�)rrKr	r�r
rr)rLr�rPrPrQ�
test_neg_axisqszTestMedian.test_neg_axiscCs�x�d	D]~}ttj|��}t|dd�<|d
d�<ttjf��}t||d�}|dkr^t|d�n
t|d�t||k�tt|�t	k�qWdS)Nr��>@r��?@rv)r�g-@g.@)r�rr�rr)
rrKr	r
rrrrrVr)rL�vr�r�rrPrPrQ�test_out_1dvs

zTestMedian.test_out_1dcCs�xdD�]}ttj|�jdd��}t|dd�<|dd�<ttjd��}t|d|d�}|dkr�td	gddd
ddgd	gdd
gddgdd
gdd�}nBtd	gdddddgd	gdd
gddgdd
gdd�}t||�t||k�tt	|�t
k�qWdS)Nr��D@r��>@r^r7rv)r�r�gr�r�r�TFr�)r8g+@g�1@g�5@g�9@)r�r"r�r#r�r)rrKr	r�r
rrrrrVr)rLr r�r�r�erPrPrQ�test_out�s $ "
zTestMedian.test_outcCsFddgddgddgg}tjj|d�}ddg}ttjj|dd�|�dS)Ng�?gg@r)r�)rKrUZmasked_equalrr)rLrir[r�rPrPrQ�$test_single_non_masked_value_on_axis�s
z/TestMedian.test_single_non_masked_value_on_axiscCs��x$dtjdtd�fD�]}tjjdtjdgdddgg�}||_tjj|dd�}ttj	|��t
|tj�tjj|j�dd�}ttj	|��t
|tj�tjj|dd�}tt
|�t�t
|dtjdg�tjj|dd�}tt
|�t�t
|tjdg�tjj|d
d�}tt
|�t�t
|tjdg�qWtjjdtjdgdddgg�}tjj|dd�df<t
tjj|dd�tj�t
tjj|dd�dtjdg�t
tjj|dd�tjd	g�dS)NFrs)r6r7rvr5)r�rg�?r�)rKrr|rUr�nanr8rr�isscalarrZravelrrVrr
)rLr8�dmrrPrPrQ�test_nan�s.zTestMedian.test_nancCs�tjjtjd��}tjjtjd��}tj|d	<tjj|d
<ttjj|d|d�|�tjjtjd��}ttjj|d|d�|�tjjtjf��}ttjj||d�|�dS)Nr�rvr5r7r)r�)r�)rvr�)r5r7)r5r5)rv)	rKrUrrrr'r
rr)rL�or�rPrPrQ�test_out_nan�s
zTestMedian.test_out_nancCs�tjjtjdtd��}tjj|ddd�<tj|d<ttjj|�tj�ttjj|dd�tj�tjjtjdtd�j	ddd��}tj|j
�ddk|_|j�}tj|d	<tj|d
<ttjj|�tj�t
tjtjj|���tjj|dd�}tj|d<tj|d<ttjj|d�|�tjj|dd�}tj|d
<tj|d<ttjj|d�|�tjj|dd�}tj|d<tj|d<ttjj|d�|�dS)Nr�)r6rvr5r)r�r�r7)r7r5rv)r7r7r5)r5rv)r7r5)r7rv)r7r5)rr5)rr5)rKrUrr	rJr
r'rrr�r{r8�copyrr(r)rLr9Zaorigr:rPrPrQ�test_nan_behavior�s0
 







zTestMedian.test_nan_behaviorcCs�tjdddgdddggtjd�}tjj||dkd�}ttjj|dd�d�ttjj|dd�jd�ttjj|dd�|d�ttjj|�d�dS)	Nrv�)r6)r8r7)r�Fr)rKrZuint8rUrrrr8)rLr9rPrPrQ�test_ambigous_fill�s zTestMedian.test_ambigous_fillcCs�xtjtjgD�]�}tj|tjgtjtjgg�}tjj|tj|�d�}ttjj|dd�|tjg�ttjj|dd�|tjg�ttjj|�|�tjtjtj|gtjtj|gg�}tjj|tj|�d�}t	tjj|dd�|�t	tjj|dd�j
d�t	tjj|dd�|d�t	tjj|�|�tj||g||gg�}ttjj|�|�ttjj|dd�|�ttjj|dd�|�tj|d|dgdtjtjd	gd
tjtj|ggtjd�}tjj|tj|�d�}|dk�rttjj|dd�dd
|dg�ttjj|�d�n2ttjj|dd�dd
|dg�ttjj|�d�ttjj|dd�dd|g�x�tdd�D]�}x�tdd�D]�}tjtjg||g|gd�}tjj|tj|�d�}ttjj|�|�ttjj|dd�|�ttjj|dd�tjg||g|��qpW�q`WqWdS)N)r8r)r�r7Frerur^rzr�)r6g@g@g@g@g$@g"@g@g�?r5i����i����g$�g"�g�g�g�)
rKrrr'rUr�isnanrrrr8Zfloat32rf)rLrr9rlrmrPrPrQ�test_special�sF"

  "zTestMedian.test_specialcCsttjjtjgtd��}t��8}|jt�ttjj	|�tj
�t|jdj
tk�WdQRXtjjtjgtdd��}t��F}|jt�tjddt�ttjj	|�tj
�t|jdj
tk�WdQRXtjjtjgtdd��}ttjj	|dd�|�ttjj	|d	d�|�tjjtjtj
tdd��}tjd
d��<}tjddt�ttjj	|dd�|�t|dj
tk�WdQRXdS)N)r6rrv)r6r	�always�r5)r�r7T)�record)rKrUrrrJrr5�RuntimeWarningrrr'r�log�category�warnings�filterwarningsr�catch_warnings)rLr9�wr:rPrPrQ�
test_emptys&

zTestMedian.test_emptycCsXtjjtjd��}tttjj|jt���t	�tj
|d<tttjj|jt���t	�dS)Ng@r5)rKrUrr	rrVrr�rTrJr')rLr+rPrPrQ�test_object:s
zTestMedian.test_objectN)r~rr�rrrrrrrrr�rr�rr!r%r&r*r,r.r0r2r=r>rPrPrPrQr�s,&	#	+rc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�TestCovcCsttjjd��|_dS)Nr�)rrKr�r�ri)rLrPrPrQ�setupCsz
TestCov.setupcCsZ|j}ttj|�t|��ttj|dd�t|dd��ttj|ddd�t|ddd��dS)NF)�rowvarT)rA�bias)rirrKr)rLr�rPrPrQ�test_1d_without_missingFs
zTestCov.test_1d_without_missingcCsb|jjdd�}ttj|�t|��ttj|dd�t|dd��ttj|ddd�t|ddd��dS)Nrvr�F)rAT)rArB)rir�rrKr)rLr�rPrPrQ�test_2d_without_missingNs
zTestCov.test_2d_without_missingcCs@|j}t|d<||j�8}|j�}ttj|�t|��ttj|dd�t|dd��ttj|ddd�t|ddd��yt|dd�Wntk
r�YnX|dd�}ttj||ddd	��t||ddd
���ttj||ddd�dd�t||ddd�dd��ttj||ddd
�ddd�t||ddd�ddd��dS)Nr7F)rAT)rArB)�allow_maskedr�r�r�r�r�r�r�r�)rir
�meanrkrrKr�
ValueError)rLr��nxrPrPrQ�test_1d_with_missingVs$,zTestCov.test_1d_with_missingcCs6|j}t|d<|jdd�}tjt|��jt�}tj||j	�}||j
d�dd�dfjd�}tt
|�tj
|�|jdd|d�tt
|dd�tj
|dd�|jd|�tj|j	|�}||j
d�jd�}tt
|dd	�tj
|dd	�|jdd|d�tt
|ddd
�tj
|ddd
�|jd|�dS)Nr7rvr�rg�?T)rBF)rA)rArBr�)rir
r�rKZlogical_notr
r�rgrrrFr�rrr)rLr�Zvalid�fracZxfrPrPrQ�test_2d_with_missingns  "&zTestCov.test_2d_with_missingN)r~rr�r@rCrDrIrKrPrPrPrQr?As
r?c@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�TestCorrcoefcCs(ttjjd��|_ttjjd��|_dS)Nr�)rrKr�r�ri�data2)rLrPrPrQr@�szTestCorrcoef.setupc
Cs�|j|j}}tj|�}tj||�}t���}tjd�ttt|dd�|j	td�t
tj|dd�t|dd��t
t|dd�|�t
t||d	d�|�t
t|dd�|�t
t||dd�|�WdQRXdS)
Nr3r7)�ddofzbias and ddof have no effectrrvr�r�r�)rirMrKrrr9�simplefilterrr��filterr)rLr�r�r�Z	expected2�suprPrPrQ�	test_ddof�s

zTestCorrcoef.test_ddofcCs�|j|j}}tj|�}t��b}tjd�ttt||dd�ttt||dd�ttt|dd�|j	td�t
t|dd�|�WdQRXdS)Nr3TF)rBzbias and ddof have no effectr7)rirMrKrrr9rOrr�rPr)rLr�r�r�rQrPrPrQ�	test_bias�s

zTestCorrcoef.test_biascCsx|j}ttj|�t|��ttj|dd�t|dd��t��2}|jtd�ttj|ddd�t|ddd��WdQRXdS)NF)rAzbias and ddof have no effectT)rArB)rirrKrrrPr�)rLr�rQrPrPrQrC�sz$TestCorrcoef.test_1d_without_missingcCs�|jjdd�}ttj|�t|��ttj|dd�t|dd��t��2}|jtd�ttj|ddd�t|ddd��WdQRXdS)Nrvr�F)rAzbias and ddof have no effectT)rArB)rir�rrKrrrPr�)rLr�rQrPrPrQrD�sz$TestCorrcoef.test_2d_without_missingcCs�|j}t|d<||j�8}|j�}ttj|�t|��ttj|dd�t|dd��t��2}|jt	d�ttj|ddd�t|ddd��WdQRXyt|dd�Wnt
k
r�YnX|dd�}ttj||ddd
��t||ddd���ttj||ddd�dd�t||ddd�dd��t��r}|jt	d�ttj||ddd��t||ddd�dd��ttj||ddd��t||ddd�d	d
��WdQRXdS)Nr7F)rAzbias and ddof have no effectT)rArB)rE)rBr5)rNr�r�r�r�r�r�r�r�r�r�)rir
rFrkrrKrrrPr�rG)rLr�rHrQrPrPrQrI�s2,z!TestCorrcoef.test_1d_with_missingc
Cs|j}t|d<|jdd�}t|�}tj|�}t|dd	�dd
�f|dd�dd�f�t���}|jtd�tt|d
d�dd�dd�f|dd�dd�f�tt|dd�dd�dd�f|dd�dd�f�tt|dd�dd�dd�f|dd�dd�f�WdQRXdS)Nr7rvr�zbias and ddof have no effectr5)rN)rBr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�)	rir
r�rrKrrrPr�)rLr�rMrNrQrPrPrQrK�s
*z!TestCorrcoef.test_2d_with_missingN)
r~rr�r@rRrSrCrDrIrKrPrPrPrQrL�s
rLc@seZdZdd�Zdd�ZdS)�TestPolynomialcCs�tjjd�}tjjd�jd
d�}tt||d�tj||d��|jt�}t|d<|jt�}t|d<|d<t||dd�dfddd�\}}}}}tj|dd�|dd�dfj	�ddd�\}}	}
}}x4t
|||||f||	|
||f�D]\}
}t|
|�q�Wt||dd�dfddd�\}}}}}tj|dd�|dd�dfddd�\}}	}
}}x6t
|||||f||	|
||f�D]\}
}t|
|��qnWt||ddd�\}}}}}tj|dd�|dd�dd�fddd�\}}	}
}}x6t
|||||f||	|
||f�D]\}
}t|
|��q�Wtjjd�d}|j�}|dd�}|dd�}|dd�}t||dd|d	�\}}}}}tj||dd|d	�\}}	}
}}t||�x6t
|||||f||	|
||f�D]\}
}t|
|��q�WdS)Nr^r�r7r5rvrT)rh)rhr<r�)rrr�r�)r�r�r�r�r�r�r�r�r�r�r�)
rKr�r�r�rr�viewrr
rk�zipr-r)rLr�r��C�R�K�S�DrSrrnrpr�r9�a_r<Zwo�xsZys�wsrPrPrQ�test_polyfit�s<

&"(&0(4(
(zTestPolynomial.test_polyfitcCs�tjjd�}tjjd�jd	d�}tj|d<tj|d<|jt�}|jt�}t|d<t|d<t||ddd�\}}}}}tj|dd�|dd�dd�fddd�\}}	}
}}x4t	|||||f||	|
||f�D]\}
}t
|
|�q�WdS)Nr^r�r7r5rrvT)rhr�r�r�)r�r�r�r�)r�r�r�r�)rKr�r�r�r'rUrr
rrVr)rLr�r�rWrXrYrZr[rSrrnrpr�r9r\rPrPrQ�test_polyfit_with_masked_NaNss



4(z,TestPolynomial.test_polyfit_with_masked_NaNsN)r~rr�r_r`rPrPrPrQrT�s'rTc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!S)"�TestArraySetOpscCs�ddddddg}t|ddd�}tt|dt��t|dtdddgdddgd��t|ddddg�t|dddddddg�dS)	Nr7r5rvT)�return_index�return_inverser)r8rz)rrr�rrr)rLrirMrPrPrQ�test_unique_onlist+s"z"TestArraySetOps.test_unique_onlistcCstddddddgddddddgd�}t|ddd�}t|dtdddd
gddddgd��t|dddddg�t|dddddddg�d|_tddddddgddddddgdd	�}t|ddd�}t|dtddddgddddgd��t|dddddg�t|dddddddg�dS)Nr7r5rvr)r8T)rbrcrz)rir8�
fill_valuer�r�)rrrre)rLrirMrPrPrQ�test_unique_onmaskedarray4s$&&z)TestArraySetOps.test_unique_onmaskedarraycCs�tdddgdd�}t|ddd�}t|dtdgdgd��t|ddg�t|ddddg�t}t|ddd�}t|dtt��t|ddg�t|ddg�dS)Nr7T)r8)rbrcrr5)rrrr
)rLrirMrPrPrQ�test_unique_allmaskedDsz%TestArraySetOps.test_unique_allmaskedcCsrttjd�dddddgd�}tddddgddddgd�}t|�}t||�t|jd�|jd��t|j|j�dS)Nrzr7r)r8r�)rrKr	rr#rr�r8)rLr�rNrMrPrPrQ�test_ediff1dSs
zTestArraySetOps.test_ediff1dc	Cs�ttjd�dddddgd�}t|td�}tdddddgdddddgd�}t||�t|jd�|jd��t|j|j�t|dddgd�}tdddddddgdddddddgd�}t||�t|jd�|jd��t|j|j�dS)	Nrzr7r)r8)�to_beginr�r5rv)	rrKr	r#r
rrr�r8)rLr�rMrNrPrPrQ�test_ediff1d_tobegin\s 
(
z$TestArraySetOps.test_ediff1d_tobeginc	Cs�ttjd�dddddgd�}t|td�}tdddddgdddddgd�}t||�t|jd�|jd��t|j|j�t|dddgd�}tdddddddgdddddddgd�}t||�t|jd�|jd��t|j|j�dS)	Nrzr7r)r8)�to_endr�r5rv)	rrKr	r#r
rrr�r8)rLr�rMrNrPrPrQ�test_ediff1d_toendks 
(
z"TestArraySetOps.test_ediff1d_toendc
Cs�ttjd�dddddgd�}t|ttd�}tddddddgddddddgd�}t||�t|jd�|jd��t|j|j�t|dddgtd�}tddddddddgddddddddgd�}t||�t|jd�|jd��t|j|j�dS)	Nrzr7r)r8)rkrir�r5rv)	rrKr	r#r
rrr�r8)rLr�rMrNrPrPrQ�test_ediff1d_tobegin_toendzs$

z*TestArraySetOps.test_ediff1d_tobegin_toendcCs�tjd�}t|�}tddddgddddgd�}t||�tt|t��t|jd�|jd��t|j	|j	�t|t
t
d�}tddddddgddddddgd�}tt|t��t|jd�|jd��t|j	|j	�dS)Nrzr7r)r8)rkri)rKr	r#rrrr�rr�r8r
)rLr�rMrNrPrPrQ�test_ediff1d_ndarray�s

$z$TestArraySetOps.test_ediff1d_ndarraycCshtddddgddddgd�}tddddgddddgd�}t||�}tdddgdddgd�}t||�dS)Nr7rvr)r8r�)rr!r)rLr�r�rMrNrPrPrQ�test_intersect1d�s

z TestArraySetOps.test_intersect1dcCs�tdddddgdddddgd�}tddddddgddddddgd�}t||�}t|tdddg��tddddd
gdddddgd�}dddddg}t||�}t|tddddgddddgd��tdddg�}td	ddg�}t||�}tt|t��t|dddddd	g�tdd
ddgddddgd�}td	ddd
gddddgd�}t||�}tt|t��t|dddddd	g�tgtgg��dS)Nr7r5rzrer)r8rvr�rsrtr�r�r�r�)rrrrr�rr)rLr9r:rMrPrPrQ�
test_setxor1d�s& $
 
"

zTestArraySetOps.test_setxor1dcCs�tjd�jdddg�}tjdddg�}d|d<t||d�}tddd	d
ddddd
g	dddddddddg	d�}tdtd�}d|d<d|d<d|d<t||�}tt|t	��t
||�tj|||j�|j@}t
||�dS)Nr�r5rvr�r7r)r8r^r�r�r�r�r�)rir8)r6T)r7r5r)r5rvr�)rrr)rrr7)rr5rv)rKr	r�rrr|r0rr�rrr8)rLr9r8r:ZecrSr�rPrPrQ�	test_isin�s

zTestArraySetOps.test_isincCs�tdddddgdddddgd�}tddddddgddddddgd�}t||�}t|d	d	d	d
d	g�tddddd
gdddddgd�}tdddgdddgd�}t||�}t|d	d	d
d	d	g�tgtgg��dS)Nr7r5rzrer)r8rvr�TFr�r�r�r�)rr"rr)rLr9r:rMrPrPrQ�	test_in1d�s $
 
zTestArraySetOps.test_in1dcCs�tdddddgdddddgd�}tddddddgddddddgd�}ttjt||��t||d	d
��tddddd
gdddddgd�}tdddgdddgd�}ttjt||��t||d	d
��tgtggd	d
��dS)Nr7r5rzrer)r8rvr�T)�invertr�r�r�r�)rrrKrsr"r)rLr9r:rPrPrQ�test_in1d_invert�s $   z TestArraySetOps.test_in1d_invertc		Cstdddddd	gddddddgd�}tdddddd
gddddddgd�}t||�}tdddddddgdddddddgd�}t||�tdddgdddggdddgdddggd�}tdddddgdddddgd�}tddddddgddddddgd�}t||�}t||�tgtgg��dS)Nr7r5rzrer)r8rvr�r�r�r�)rr rr)	rLr9r:rMrNr�r�Zezr�rPrPrQ�test_union1d�s$$
(
, $

zTestArraySetOps.test_union1dc
Cs�tddddddddgddddddddgd�}tddd	d	dddg�}t||�}t|tddd
gdddgd��td
�}td�}tt||�tddg��tgtjgd�}tt|g�jtj�dS)Nrsrzr�rer7r5r)r8rvr^rtrur�)rrrr	rKZuint32r6)rLr9r:rMrPrPrQ�test_setdiff1d�s,
zTestArraySetOps.test_setdiff1dcCs<tjdddg�}tjdddg�}tt||�tjdg��dS)Nr9r:rSrp)rKrrr)rLr9r:rPrPrQ�test_setdiff1d_char_array
sz)TestArraySetOps.test_setdiff1d_char_arrayN)r~rr�rdrfrgrhrjrlrmrnrorprqrrrtrurvrwrPrPrPrQra)s 		
rac@seZdZdd�Zdd�ZdS)�
TestShapeBasecCsrtdddgdddgd�}t|�}t|jd�t|jj|jj�t|jd�t|jj|jj�t|jj|jj�dS)Nrr7r5)r8rv)r7rv)rv)rrrrr8ri)rLr9r:rPrPrQ�test_atleast_2dszTestShapeBase.test_atleast_2dcCs�td�}t|jd�t|jj|j�t|jj|j�tdd�}x8|D]0}t|jd�t|jj|j�t|jj|j�qDWtd�}t|jd�t|jj|j�t|jj|j�tdd�}x8|D]0}t|jd�t|jj|j�t|jj|j�q�Wtd�}t|jd�t|jj|j�t|jj|j�tdd�}x:|D]2}t|jd	�t|jj|j�t|jj|j��q4Wtd�}t|jd
�t|jj|jj�dS)Ng�?r7g@)r7)r7)r7r7)r7r7)r7r7r7)r7r7r7)r7r7)rrrr8rirrr1)rLr:r9rPrPrQ�test_shape_scalars<





zTestShapeBase.test_shape_scalarN)r~rr�ryrzrPrPrPrQrxs
rxc@s$eZdZdd�Zdd�Zdd�ZdS)�	TestStackcCs�tdddgdddgd�}tdddgdddgd�}t||gdd�}t|jd
�t|j|dj�t|j|dj�t||g�}t|j|j�t|j|j�t||gdd�}t|jd�t|j|dd�dfj�t|j|dd�dfj�dS)Nrr7r5)r8rurtre)r�rv)r5rv)rvr5)rr2rrrr8r3ri)rLr9r:rSr�rPrPrQ�
test_stack_1dKszTestStack.test_stack_1dcCs�tdddgdd�}tdddgd	d�}t||gdd
�}t|jd�t|j|dj�t|j|dj�t||g�}t|j|j�t|j|j�t||gdd
�}t|jd
�t|j|dd�dfj�t|j|dd�dfj�dS)Nrr7r5T)r8rurtreF)r�rv)r5rv)rvr5)rr2rrrr8r3ri)rLr9r:rSr�rPrPrQ�test_stack_masks]szTestStack.test_stack_masksc
Cs�d}tjjdd|�}tjjdd|�}tjjdd|�jt�}tjjdd|�jt�}t||d�}t||d�}t||gdd�}d|}	t|j|	�t	|j
|dj
�t	|j
|dj
�t||gd
d�}|d}	t|j|	�t	|j
|dj
�t	|j
|dj
�d}tjjdd|�}tjjdd|�}tjjdd|�jt�}tjjdd|�jt�}t||d�}t||d�}t||gdd�}d|}	t|j|	�t	|j
|dj
�t	|j
|dj
�t||gdd�}|d}	t|j|	�t	|j
|dj
�t	|j
|dj
�dS)Nrvr5rr^)r8)r�r7.r�rz)rvr5)r5r�)r5).r).r7)rvr5r�rz)r5r�)r5).r).r7)rKr��randintr�r|rr2rrrr8)
rLZshpZd1Zd2r�r�Za1r�rSZc_shprPrPrQ�
test_stack_ndosDzTestStack.test_stack_ndN)r~rr�r|r}rrPrPrPrQr{Isr{)J�__doc__r9r
r�ZnumpyrKZ
numpy.testingrrZnumpy.ma.testutilsrrrrZ
numpy.ma.corerr	r
rrr
rrrrrZnumpy.ma.extrasrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r�r�r�r�r�r�rr?rLrTrarxr{rPrPrPrQ�<module>	s:4�
,F
}Ck:i8