3
Kd                 @   s2   d dl Zd dlmZmZmZmZ G dd dZdS )    N)assert_assert_array_equalassert_allclosesuppress_warningsc               @   st   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd Zdd Z	dd Z
dd Zdd Zdd Zdd Zdd ZdS )TestRegressionc          
   C   sP   t jjddddddddgddddddddgd}tt jj|dddd	gg d S )
Nr                     )mask   )npmamasked_arrayr   Znonzero)selfx r   R/var/www/html/virt/lib64/python3.6/site-packages/numpy/ma/tests/test_regression.pytest_masked_array_create   s    z'TestRegression.test_masked_array_createc             C   s   t jjddgd d S )Nr   )r   )r   r   array)r   r   r   r   test_masked_array   s    z TestRegression.test_masked_arrayc             C   s>   ddl m}m} tjd}tj|j|}|||}||  d S )Nr   )masked_whereMaskTyper   )r   r   )Znumpy.mar   r   r   zerosshape)r   r   r   abcr   r   r   test_mem_masked_where   s
    

z$TestRegression.test_mem_masked_wherec             C   s6   t jjd}t jj|d< t jd}||  ||  d S )Nr
   r   r   r   )r
   r   )r   r   )r
   r   )r   r   r   Zmasked)r   r   r   r   r   r   test_masked_array_multiply   s
    
z)TestRegression.test_masked_array_multiplyc             C   s   t jjdgddjd d S )Nr   F)r   
   )r   r   r   repeat)r   r   r   r   test_masked_array_repeat"   s    z'TestRegression.test_masked_array_repeatc             C   s   t tjjd d S )NZUnicode)reprr   r   r   )r   r   r   r   test_masked_array_repr_unicode&   s    z-TestRegression.test_masked_array_repr_unicodec             C   sJ   t jjdddgdddgd}t j|}t|jjdk t|jjdk d S )	Ng        g333333?g      @FT)r   r   r   )r   r   r   Z
atleast_2dr   r   ndim)r   r   r   r   r   r   test_atleast_2d*   s    
zTestRegression.test_atleast_2dc             C   s4   t jjdddgdddgd}d|_t|jdk d S )Nr   r   r   r   r   )r   X)r   r   r   Z
fill_valuer   )r   r   r   r   r   test_set_fill_value_unicode_py31   s    z.TestRegression.test_set_fill_value_unicode_py3c             C   sD   t jjt jddd}t jjdtd}|j|d t|jdk d S )	Nr   T)r   r   )dtype)outr   )r   r   r   arangefloatvarr   _data)r   r   Zmoutr   r   r    test_var_sets_maskedarray_scalar7   s    z/TestRegression.test_var_sets_maskedarray_scalarc             C   s   t jjdddddgd}t jdddddg}t D}|jtd t jj||d	d
}t jj||dd
}t|j	|j	 W d Q R X d S )Nr   r   r	   r
   r   g      @g@zbias and ddof have no effectr   )Zddof)
r   r   Zmasked_equalr   r   filterDeprecationWarningZcorrcoefr   data)r   r   ysupZr0Zr1r   r   r   test_ddof_corrcoef>   s    z!TestRegression.test_ddof_corrcoefc             C   sf   t jjddgddgd}t|jjdk t j|d}t|jjd	k t|jd
k t|jjdk d S )Ng      ?g       @F)r   r   r   )r   )r   r   )r   )r   r   )r   r   )r   r   MaskedArrayr   r   r   Ztile)r   r   r   r   r   r   test_mask_not_backmangledJ   s    z(TestRegression.test_mask_not_backmangledc             C   s0   t jjd
ddgdd}t|g  |d d	  d S )Nr         ?r          @r	         @zi4,f4)r+   r   )r   r;   )r   r<   )r	   r=   )r   r   r9   r   )r   r   r   r   r   test_empty_list_on_structuredT   s    z,TestRegression.test_empty_list_on_structuredc             C   s.   t jjdjd}t|jdd|jj  d S )Nr
   r   F)order)r   r   )r   r   r.   Zreshaper   tobytesT)r   r   r   r   r   !test_masked_array_tobytes_fortranY   s    z0TestRegression.test_masked_array_tobytes_fortranN)__name__
__module____qualname__r   r   r    r!   r$   r&   r(   r*   r2   r8   r:   r>   rC   r   r   r   r   r      s   
r   )Znumpyr   Znumpy.testingr   r   r   r   r   r   r   r   r   <module>   s   