o
    Ô­j×  ã                   @   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   ú[/var/www/html/CropPilot/venv/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    