
    bMh                       U d dl mZ d dlmZ d dlZd dlZd dlZd dl	m
Z d ej        D             Zdg ee          z  Zded<   ed ej        D             z  Zed	d	gz  Ze ej        g d
d          gz  Zedgz  Z ej         eee          d eD                       d             Zd Zd Zd Zd Zd Zd Zd Zd Zd Zej                             dg d          d             Z!dS )    )annotations)AnyNc                >    g | ]}t          j        g d |          S ))         Ndtypepdarray.0r
   s     j/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pandas/tests/arrays/masked/test_arithmetic.py
<listcomp>r      s+    	S	S	SU"(???%
0
0
0	S	S	S    r   z	list[Any]scalarsc                >    g | ]}t          j        g d |          S ))g?皙?g333333?Nr	   r   r   s     r   r   r      s.    
X
X
XE28)))777
X
X
Xr   r   )TFTNbooleanr	   Fc                &    g | ]}|j         j        S  )r
   name)r   as     r   r   r      s    1O1O1O1!',1O1O1Or   )paramsidsc                    | j         S )zFixture returning parametrized (array, scalar) tuple.

    Used to test equivalence of scalars, numpy arrays with array ops, and the
    equivalence of DataFrame and Series ops.
    )param)requests    r   datar       s     =r   c                |    t          | j        t          j                  rd|v rt	          j        d           d S d S d S )Nsubz$subtract not implemented for boolean)
isinstancer
   r   BooleanDtypepytestskipr    op_names     r   
check_skipr)       sI    $*bo.. <5G3C3C:;;;;;< <3C3Cr   c                v    | j         j        dk    o)|                    d                              d          dv S )Nb_r)powtruedivfloordiv)r
   kindstriplstripr'   s     r   is_bool_not_implementedr4   %   s?    :?c! gmmC&8&8&?&?&D&D I ' r   c                j   | \  } }t          j        |          }t          | |           t          j        |gt          |           z  | j                  }|| j                            |          fD ]}t          | |          rd}t          j
        t          |          5   || |           d d d            n# 1 swxY w Y   t          j
        t          |          5   || |           d d d            n# 1 swxY w Y    || |          } || |          }t          j        ||           d S Nr	   -operator '.*' not implemented for bool dtypesmatch)tmget_op_from_namer)   r   r   lenr
   typer4   r%   raisesNotImplementedErrorassert_extension_array_equal)r    all_arithmetic_operatorsscalaropscalar_arraymsgresultexpecteds           r   "test_array_scalar_like_equivalencerH   2   s   LD&		5	6	6Bt-...8VHs4yy0
CCCL 4:??6223 
> 
>"4)ABB 		>AC2#>>> ! !4   ! ! ! ! ! ! ! ! ! ! ! ! ! ! !2#>>> ' '4&&&' ' ' ' ' ' ' ' ' ' ' ' ' ' ' Rf%%Fr$--H+FH====
> 
>s$   !B::B>	B>	 C99C=	 C=	c                   | \  } }t          j        |          }t          | |           t          j        }t          j        t          j        gt          |           z  | j                  }| j        	                                }t          | |          r]d}t          j        t          |          5   || |           d d d            n# 1 swxY w Y   t          j        || j                   d S  || |          }t          j        || j                    || |          }	t          j        || j                   t          j        ||	           d S r6   )r:   r;   r)   r   NAr   r<   r
   _maskcopyr4   r%   r>   r?   assert_numpy_array_equalr@   )
r    rA   r,   rC   rB   rD   maskrE   rF   rG   s
             r   test_array_NArO   G   s   GD!		5	6	6Bt-...UF8RUGc$ii/tzBBBL:??Dt%=>> =].c::: 	 	BtV	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	#D$*555RfFdj111r$%%Hdj111#FH55555s   2CCCc                n   | \  } }t          j        |          }t          | |           t          j        |gt          |           z  | j        j                  }t          j        || j                  }t          | |          rd}t          j        t          |          5   || |           d d d            n# 1 swxY w Y   t          j        t          |          5   || |           d d d            n# 1 swxY w Y   d S  || |          } || |          }t          j        ||           d S r6   )r:   r;   r)   npr   r<   r
   numpy_dtyper   r4   r%   r>   r?   r@   )	r    rA   rB   rC   numpy_arraypd_arrayrE   rF   rG   s	            r   test_numpy_array_equivalencerU   c   s   LD&		5	6	6Bt-...(F8c$ii/tz7MNNNKx4:666Ht%=>> =].c::: 	" 	"Bt[!!!	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	"].c::: 	 	BtX	 	 	 	 	 	 	 	 	 	 	 	 	 	 	Rk""Fr$!!H#FH55555s$   #B<<C C "C;;C?C?c                *   | \  } }t          j        |          }t          | |           t          j        d| i          }t          | |          rd}t          j        t          |          5   |||           d d d            n# 1 swxY w Y   t          j        t          |          5   || |           d d d            n# 1 swxY w Y   d S  |||          }t          j        d || |          i          }t          j	        ||           d S )NAr7   r8   )
r:   r;   r)   r   	DataFramer4   r%   r>   r?   assert_frame_equal)r    rA   rB   rC   dfrE   rF   rG   s           r   
test_framer[   |   s   LD&		5	6	6Bt-... 
sDk	"	"Bt%=>> =].c::: 	 	Br6NNN	 	 	 	 	 	 	 	 	 	 	 	 	 	 	].c::: 	 	BtV	 	 	 	 	 	 	 	 	 	 	 	 	 	 	RF^^F|S""T6"2"2344H&(+++++s$   -BB
B
,CC	C	c           	        | \  } }t          j        |          }t          | |           t          j        |           }|t          j        |gt          |           z  | j        j	                  t          j        |gt          |           z  | j                  t          j        |gt          |           z  | j                  g}|D ]}t          | |          rBd}t          j        t          |          5   |||           d d d            n# 1 swxY w Y   T |||          }t          j         || |                    }	t          j        ||	           d S r6   )r:   r;   r)   r   SeriesrQ   r   r<   r
   rR   r4   r%   r>   r?   assert_series_equal)
r    rA   rB   rC   serothersotherrE   rF   rG   s
             r   test_seriesrb      s   LD&		5	6	6Bt-...
)D//C 	
&CII%TZ-CDDD
&CII%TZ888
	6(SYY&dj999	F  	5 	5"4)ABB 	5AC2#>>>  3               RU^^FyD%11H"684444	5 	5s   8DD	D	c           	        | \  } }|}t          | |          } |t          j        d| i                    }|t          u sJ d}t	          j        t          |          5   |t          j        t          |                     
                    dt          |                                d d d            d S # 1 swxY w Y   d S )NrW   z(can only perform ops with 1-d structuresr8   )getattrr   rX   NotImplementedr%   r>   r?   rQ   aranger<   reshape)r    rA   r,   rC   oparF   rE   s          r   test_error_invalid_objectrj      s   GD!	!B
$

C SsDk**++F^####
5C	*#	6	6	6 9 9BIc$ii  ((SYY778889 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9s   AB88B<?B<c                v   | \  } }t          j        |          }|gt          |           dz
  z  }t          }d                    ddg          }| j        j        dk    r!|                    d          dv r
t          }d}nt          | |          r	d	}t          }|t          j        |          fD ]}t          j        ||
          5   || |           d d d            n# 1 swxY w Y   t          j        |           }t          j        ||
          5   |||           d d d            n# 1 swxY w Y   d S )Nr   |zBoperands could not be broadcast together with shapes \(3,\) \(4,\)zBoperands could not be broadcast together with shapes \(4,\) \(3,\)r+   r,   )r"   rsubznumpy boolean subtract, the `\-` operator, is not supported, use the bitwise_xor, the `\^` operator, or the logical_xor function insteadr7   r8   )r:   r;   r<   
ValueErrorjoinr
   r1   r2   	TypeErrorr4   r?   rQ   r   r%   r>   r   r]   )r    rA   rB   rC   ra   errrE   ss           r   test_error_len_mismatchrs      s   LD&		5	6	6BHD		A&E
C
((QQ	
 C z#":"@"@"E"E J # # W 	 
!'?	@	@ "=!%)  ]3c*** 	 	BtUOOO	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 IdOO]3c*** 	 	Bq%LLL	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 s$   CC#	&C#	D--D1	4D1	rC   )__neg____abs__
__invert__c                   | \  } }t          j        |           }|dk    r| j        j        dk    rd}t	          j        t          |          5   t          ||                       d d d            n# 1 swxY w Y   t	          j        t          |          5   t          | |                       d d d            n# 1 swxY w Y   t	          j        t          |          5   t          | j        |                       d d d            n# 1 swxY w Y   d S  t          ||                      }|	                    d          }d |d<   t          j        ||           d S )Nrv   fz0ufunc 'invert' not supported for the input typesr8   T)deepr   )r   r]   r
   r1   r%   r>   rp   re   _datarL   r:   r^   )r    rC   r,   r_   rE   rF   rG   s          r   %test_unary_op_does_not_propagate_maskr{      s    GD!
)D//C	\djo44@]9C000 	 	GC	 	 	 	 	 	 	 	 	 	 	 	 	 	 	]9C000 	  	 GD"	  	  	  	  	  	  	  	  	  	  	  	  	  	  	 ]9C000 	& 	&#GDJ##%%%	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	WS"F{{{%%HCF68,,,,,s6   A22A69A6B==CC#DDD)"
__future__r   typingr   numpyrQ   r%   pandasr   pandas._testing_testingr:   ALL_INT_EA_DTYPESarraysr<   r   __annotations__FLOAT_EA_DTYPESr   fixturezipr    r)   r4   rH   rO   rU   r[   rb   rj   rs   markparametrizer{   r   r   r   <module>r      s   " " " " " " "                      
T	Sb>R	S	S	SS33v;;& & & & & 
X
XREW
X
X
X X C:  828---Y???
@ @ E7  ss67++1O1O1O1O1OPPP  QP< < <
  > > >*6 6 686 6 62, , ,*5 5 5<9 9 9! ! !H CCCDD- - ED- - -r   