
    A>i"              	         % S SK Jr  S SKJr  S SKrS SKrS SKrS SK	J
r  \R                   V s/ s H  n \R                  / SQU S9PM     sn rS/\" \5      -  rS\S'   \\R$                   V s/ s H  n \R                  / S	QU S9PM     sn -  r\S
S
/-  r\\R                  " / SQSS9/-  r\S/-  r\R&                  " \" \\SS9\ Vs/ s H  oR*                  R,                  PM     snS9S 5       rS rS rS rS rS rS rS rS rS r \RB                  RE                  S/ SQ5      S 5       r#\RB                  RE                  S/ SQ5      S  5       r$gs  sn f s  sn f s  snf )!    )annotations)AnyN)         Ndtyper   z	list[Any]scalars)g?皙?g333333?Nr   )TFTNbooleanFT)strict)paramsidsc                    U R                   $ )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    i/var/www/html/land-tabula/venv/lib/python3.13/site-packages/pandas/tests/arrays/masked/test_arithmetic.pydatar      s     ==    c                    [        U R                  [        R                  5      (       a  SU;   a  [        R
                  " S5        g g g )Nsubz$subtract not implemented for boolean)
isinstancer	   pdBooleanDtypepytestskipr   op_names     r   
check_skipr   "   s4    $**boo..5G3C:; 4D.r   c                    U R                   R                  S:H  =(       a#    UR                  S5      R                  S5      S;   $ )Nb_r)powtruedivfloordiv)r	   kindstriplstripr   s     r   is_bool_not_implementedr*   '   s=    ::??c! gmmC&8&?&?&D I ' r   c                N   U u  p[         R                  " U5      n[        X5        [        R                  " U/[        U 5      -  U R                  S9nX R                  R                  U5      4 H  n[        X5      (       aX  Sn[        R                  " [        US9   U" X5        S S S 5        [        R                  " [        US9   U" X5        S S S 5        Mk  U" X5      nU" X5      n[         R                  " Xx5        M     g ! , (       d  f       Ne= f! , (       d  f       M  = fNr   -operator '.*' not implemented for bool dtypesmatch)tmget_op_from_namer   r   arraylenr	   typer*   r   raisesNotImplementedErrorassert_extension_array_equal)	r   all_arithmetic_operatorsscalaropscalar_arrayvalmsgresultexpecteds	            r   "test_array_scalar_like_equivalencer@   4   s    LD			5	6Bt.88VHs4y0

CL 

/0"4BBAC2#>4 ?2#>4& ?> ]F$-H++F= 1 ?>>>s   	D	D
D	
D$	c                   U u  p[         R                  " U5      n[        X5        [        R                  n[        R
                  " [        R                  /[        U 5      -  U R                  S9nU R                  R                  5       n[        X5      (       aM  Sn[        R                  " [        US9   U" X5        S S S 5        [         R                  " X`R                  5        g U" X5      n[         R                  " X`R                  5        U" X5      n	[         R                  " X`R                  5        [         R                  " X5        g ! , (       d  f       N= fr,   )r0   r1   r   r   NAr2   r3   r	   _maskcopyr*   r   r5   r6   assert_numpy_array_equalr7   )
r   r8   r"   r:   r9   r;   maskr=   r>   r?   s
             r   test_array_NArG   I   s    GD			5	6Bt.UUF88RUUGc$i/tzzBL::??Dt>>=]].c:t ; 	##D**5Fjj1$%Hjj1##F5 ;:s   5	E
Ec                T   U u  p[         R                  " U5      n[        X5        [        R                  " U/[        U 5      -  U R                  R                  S9n[        R                  " X@R                  S9n[        X5      (       aW  Sn[        R                  " [        US9   U" X5        S S S 5        [        R                  " [        US9   U" X5        S S S 5        g U" X5      nU" X5      n[         R                  " Xx5        g ! , (       d  f       N`= f! , (       d  f       g = fr,   )r0   r1   r   npr2   r3   r	   numpy_dtyper   r*   r   r5   r6   r7   )	r   r8   r9   r:   numpy_arraypd_arrayr=   r>   r?   s	            r   test_numpy_array_equivalencerM   e   s    LD			5	6Bt.((F8c$i/tzz7M7MNKxx::6Ht>>=]].c:t! ;]].c:t ;"F$!H##F5 ;:::s   %	D	D
D
D'c                   U u  p[         R                  " U5      n[        X5        [        R                  " SU 05      n[        X5      (       aW  Sn[        R                  " [        US9   U" XB5        S S S 5        [        R                  " [        US9   U" X5        S S S 5        g U" XB5      n[        R                  " SU" X5      05      n[         R                  " Xg5        g ! , (       d  f       Nv= f! , (       d  f       g = f)NAr-   r.   )
r0   r1   r   r   	DataFramer*   r   r5   r6   assert_frame_equal)r   r8   r9   r:   dfr=   r>   r?   s           r   
test_framerS   ~   s    LD			5	6Bt. 
sDk	"Bt>>=]].c:rN ;]].c:t ;^F||S"T"234H&+ ;:::s   )	C"	C3"
C03
Dc           	        U u  p[         R                  " U5      n[        X5        [        R                  " U 5      nU[
        R                  " U/[        U 5      -  U R                  R                  S9[        R                  " U/[        U 5      -  U R                  S9[        R                  " U/[        U 5      -  U R                  S9/nU H{  n[        X5      (       a.  Sn[        R                  " [        US9   U" XF5        S S S 5        MA  U" XF5      n[        R                  " U" X5      5      n	[         R                  " X5        M}     g ! , (       d  f       M  = fr,   )r0   r1   r   r   SeriesrI   r2   r3   r	   rJ   r*   r   r5   r6   assert_series_equal)
r   r8   r9   r:   serothersotherr=   r>   r?   s
             r   test_seriesrZ      s   LD			5	6Bt.
))D/C 	
&CI%TZZ-C-CD
&CI%TZZ8
		6(SY&djj9	F "4BBAC2#>3 ?> ^FyyD1H""64  ?>s   :	E
E	c           	     ^   U u  pUn[        X5      nU" [        R                  " SU 05      5      nU[        L d   eSn[        R
                  " [        US9   U" [        R                  " [        U 5      5      R                  S[        U 5      5      5        S S S 5        g ! , (       d  f       g = f)NrO   z(can only perform ops with 1-d structuresr.   )getattrr   rP   NotImplementedr   r5   r6   rI   aranger3   reshape)r   r8   r"   r:   opar>   r=   s          r   test_error_invalid_objectrb      s    GD	!B
$
C sDk*+F^###
5C	*#	6BIIc$i ((SY78 
7	6	6s   ?B
B,c                r   U u  p[         R                  " U5      nU/[        U 5      S-
  -  n[        nSR	                  SS/5      nU R
                  R                  S:X  a  UR                  S5      S;   a	  [        nSnO[        X5      (       a  S	n[        nU[        R                  " U5      4 Hc  n[        R                  " XVS
9   U" X5        S S S 5        [        R                   " U 5      n[        R                  " XVS
9   U" X5        S S S 5        Me     g ! , (       d  f       NN= f! , (       d  f       M  = f)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 insteadr-   r.   )r0   r1   r3   
ValueErrorjoinr	   r'   r(   	TypeErrorr*   r6   rI   r2   r   r5   r   rU   )	r   r8   r9   r:   rY   errr=   r<   ss	            r   test_error_len_mismatchrk      s	   LD			5	6BHD	A&E
C
((QQ	
C zz#":"@"@"E J # W 	 
!	@	@=!rxx']]3*tM + IIdO]]3*qJ +* (** +*s   	D 	D'
D$	'
D6	r:   )__neg____abs__
__invert__c                   U u  p[         R                  " U 5      nUS:X  a  U R                  R                  S:X  a  Sn[        R
                  " [        US9   [        X15      " 5         S S S 5        [        R
                  " [        US9   [        X5      " 5         S S S 5        [        R
                  " [        US9   [        U R                  U5      " 5         S S S 5        g [        X15      " 5       nUR                  SS9nS US'   [        R                  " XV5        g ! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       g = f)Nrn   fz0ufunc 'invert' not supported for the input typesr.   T)deepr   )r   rU   r	   r'   r   r5   rh   r]   _datarD   r0   rV   )r   r:   r"   rW   r=   r>   r?   s          r   %test_unary_op_does_not_propagate_maskrs      s     GD
))D/C	\djjoo4@]]9C0C 1]]9C0D 1]]9C0DJJ#% 1 	SF{{{%HCF6, 100000 	s$   DD+:D<
D(+
D9<
E
r	   )Int64Int32Float32Float64c                   [         R                  " / SQU S9n[        [         R                  U5      n[	        U[
        5      (       a  [        U5      S:X  d   e[         R                  " [         R                  [         R                  [         R                  /U S9n[        R                  " US   U5        [        R                  " US   U5        [        R                  " US   [         R                  U-  5        [        R                  " US   [         R                  U-  5        [        U[         R                  5      n[	        U[
        5      (       a  [        U5      S:X  d   e[        R                  " US   U5        [        R                  " US   U5        [        R                  " US   U[         R                  -  5        [        R                  " US   U[         R                  -  5        g )N)r   r   r   r   r   r   r   )	r   rU   divmodrB   r   tupler3   r0   rV   )r	   rW   resexps       r   test_divmod_pdnar}      sQ    ))IU
+C

Cc5!!c#h!m33
))RUUBEE255)
7C3q63'3q63'3q6255C<03q62553;/
bee
Cc5!!c#h!m333q63'3q63'3q63"%%<03q63;/r   )%
__future__r   typingr   numpyrI   r   pandasr   pandas._testing_testingr0   ALL_INT_EA_DTYPESr2   arraysr3   r
   __annotations__FLOAT_EA_DTYPESfixturezipr	   namer   r   r*   r@   rG   rM   rS   rZ   rb   rk   markparametrizers   r}   )r	   as   00r   <module>r      s   "      ?A>R>R	S>RU"((?%(
0>R	SS3v;& & REWEW
XEWE288)87EW
X X C:  288-Y?
@ @ E7  vwt,2PA77<<2P<
>*6862,*5<9!H CD- E-0 "JK0 L0e 
T Y 3Qs   E-E	E!
