o
    g                     @   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                   @   s|   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d ZdS )TestRegressionc                 C   s4   t jjg dg dd}tt j|g dg d S )N)r            r            )r   r   r   r   r   r   r   r   mask)r   r   r      )npmamasked_arrayr   nonzero)selfx r   X/var/www/html/api-tag/env/lib/python3.10/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   )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   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 )NUnicode)reprr   r   r   r   r   r   r   test_masked_array_repr_unicode&   s   z-TestRegression.test_masked_array_repr_unicodec                 C   sF   t jjg dg dd}t |}t|jjdk t|jjdk d S )N)g        g333333?g      @)FTFr   r   r   )r   r   r   
atleast_2dr   r   ndimr&   r   r   r   test_atleast_2d*   s   
zTestRegression.test_atleast_2dc                 C   s0   t jjg dg dd}d|_t|jdk d S )N)r!   r"   r#   )r   r   r   r   X)r   r   r   
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   dtype)outr   )r   r   r   arangefloatvarr   _data)r   r!   moutr   r   r    test_var_sets_maskedarray_scalar7   s   z/TestRegression.test_var_sets_maskedarray_scalarc                 C   s   t jg dd}t g d}t (}|td t jj||dd}t jj||dd}t|j	|j	 W d    d S 1 s>w   Y  d S )N)r   r   r	   r
   r   r
   )r   g      @g@r	   r   zbias and ddof have no effectr   )ddofr   )
r   r   masked_equalr   r   filterDeprecationWarningcorrcoefr   data)r   r   ysup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    tiler&   r   r   r   test_mask_not_backmangledJ   s   z(TestRegression.test_mask_not_backmangledc                 C   s.   t jjg ddd}t|g  |d d  d S )N))r   rI   )r   rJ   )r	   g      @zi4,f4r5   r   )r   r   rL   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
   rK   F)order)r   r   r8   reshaper   tobytesTrO   r   r   r   !test_masked_array_tobytes_fortranY   s   z0TestRegression.test_masked_array_tobytes_fortranc                 C   s2   t jjddt jfddt jfdt jfgfgd d S )N)r   )    rW   r   rD   ijr5   )r   r   r   int_voidr   r   r   r   test_structured_array]   s
   
z$TestRegression.test_structured_arrayN)__name__
__module____qualname__r   r   r$   r'   r*   r-   r0   r3   r=   rH   rN   rP   rV   r\   r   r   r   r   r      s    
r   )numpyr   numpy.testingr   r   r   r   r   r   r   r   r   <module>   s    