U
    -e                     @   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|dddd	gg d S )
Nr                     mask   )npmamasked_arrayr   Znonzero)selfx r   _/var/www/html/Darija-Ai-Train/env/lib/python3.8/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d}t|j|}|||}||  d S )Nr   )masked_whereMaskType)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d}t jj|d< t d}||  ||  d S )N)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d d S )Nr   Fr   
   )r   r   r   repeatr   r   r   r   test_masked_array_repeat"   s    z'TestRegression.test_masked_array_repeatc                 C   s   t t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 |}t|jjdk t|jjdk d S )	Ng        g333333?g      @FTr   r   r   )r   r   r   Z
atleast_2dr   r   ndimr#   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 ddd}t jjdtd}|j|d t|jdk d S )Nr   Tr   Z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dddddgd}t dddddg}t D}|td t jj||d	d
}t jj||dd
}t|j	|j	 W 5 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r0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 |d}t|jjdk t|jdk t|jjdk d S )N      ?       @Fr   )r   )r   r   r   r   )r   r   MaskedArrayr   r   r   Ztiler#   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 )N)r   r=   )r   r>   )r	   g      @zi4,f4r/   r   )r   r   r@   r   r   r   r   r   r   test_empty_list_on_structuredT   s    z,TestRegression.test_empty_list_on_structuredc                 C   s.   t jdd}t|jdd|j  d S )Nr
   r?   F)order)r   r   r1   Zreshaper   tobytesTrB   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-   r5   r<   rA   rC   rH   r   r   r   r   r      s   
r   )numpyr   Znumpy.testingr   r   r   r   r   r   r   r   r   <module>   s   