+
    xȇi0                         R t ^ RIt^ RIt^ RIHt ^ RIHtHt ^ RI	t
^ RIHt ^ RIHt  ! R R4      t ! R R]4      tR# )	z
Tests for 2D compatibility.
N)is_matching_na)is_bool_dtypeis_integer_dtype)NUMPY_INT_TO_DTYPEc                     a  ] tR t^t o ]P
                  ! RR7      R 4       tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR t]P&                  P)                  RRR.4      R 4       t]P&                  P)                  R. RO4      R 4       t]P&                  P)                  R. RO4      ]P&                  P)                  R^ ^.4      R 4       4       t]P&                  P)                  R. RO4      R 4       tRtV tR# )Dim2CompatTestsT)autousec                    VP                   '       gW   VP                  pVP                  pVP                  P	                  R 4      '       d   \
        P                  ! V R24       R# R# R# )r   z does not support 2D.N)_supports_2dnode_obj__qualname__
startswithpytestskip)selfdtyperequestr   	test_funcs   &&&  p/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/tests/extension/base/dim2.pyskip_if_doesnt_support_2d)Dim2CompatTests.skip_if_doesnt_support_2d   sY    !!!<<D 		I%%001BCCug%:;< D "    c                >   VP                  ^4      P                  R^4      pR Fu  pRV^ ,          3 Fc  pVP                  W4R7      pVP                  W4R7      p\        P                  ! VR,          V4       \        P                  ! VR,          V4       Ke  	  Kw  	  R# )   N)
fill_value)   NNN    r    r   )repeatreshapeshifttmassert_extension_array_equal)r   dataarr2dnr   resultexpected_cols   &&     r   test_shift_2dDim2CompatTests.test_shift_2d#   s    A&&r1-A#T!Wo
Q>#zz!zC//tlK//tlK	 . r   c                    VP                  ^4      P                  R^4      pVP                  pV^ ,          VR,          8w  g   Q hVP                  P                  VRRR1,          8X  g   Q hR# r   Nr   )r#   r$   shapeT)r   r(   r)   r1   s   &&  r   test_transposeDim2CompatTests.test_transpose-   sY    A&&r1-Qx59$$$ww}}dd+++r   c                    VP                  ^4      P                  R^4      p\        P                  ! V4      p\        P                  ! ^ VR,          ^VR,          /4      p\        P
                  ! W44       R# )r   Nr   r   r"   )r#   r$   pd	DataFramer&   assert_frame_equal)r   r(   r)   dfexpecteds   &&   r   test_frame_from_2d_array(Dim2CompatTests.test_frame_from_2d_array4   sW    A&&r1-\\% <<E$KE$K @A
b+r   c                    VP                  ^4      P                  R^4      pVP                  ^ ^4      pVP                  p\        P
                  ! W44       R# r0   )r#   r$   swapaxesr2   r&   r'   r   r(   r)   r+   r:   s   &&   r   test_swapaxesDim2CompatTests.test_swapaxes;   sC    A&&r1-1%77
''9r   c                   VP                  ^4      P                  R^4      pVP                  ^^ R7      pVP                  ^4      P                  ^4      P                  R^4      p\        P                  ! W44       VP                  ^^R7      pVP                  ^4      P                  R^4      p\        P                  ! W44       R# )   axisNr   )r#   r$   deleter&   r'   r?   s   &&   r   test_delete_2dDim2CompatTests.test_delete_2dB   s    A&&r1- aa(;;q>((+33B:
''9 aa(;;q>))"a0
''9r   c                    VP                  R^4      pVP                  . RO^ R7      pVP                  . RO4      P                  R^4      p\        P                  ! W44       R# )r   rD   Nr   )r!   r!   r   )r$   taker&   r'   r?   s   &&   r   test_take_2dDim2CompatTests.test_take_2dO   sM    R#JQ/99Z(00Q7
''9r   c                *   \        VP                  ^R4      4      pVP                  R\        V4      P                   24      ^8X  g   Q h\        VP                  R^4      4      pVP                  R\        V4      P                   24      ^8X  g   Q hR# )r   <Nr   )reprr$   counttype__name__)r   r(   ress   && r   test_repr_2dDim2CompatTests.test_repr_2dW   s~    4<<2&'yy1T$Z00123q8884<<A&'yy1T$Z00123q888r   c                   VP                  R^4      pVP                  VP                  ^38X  g   Q h\        V4      \        V4      8X  g   Q hVP                  R4      pVP                  VP                  ^38X  g   Q h\        V4      \        V4      8X  g   Q h\        P
                  ! \        4      ;_uu_ 4        VP                  VP                  ^34       RRR4       \        P
                  ! \        4      ;_uu_ 4        VP                  VP                  ^4       RRR4       R#   + '       g   i     LY; i  + '       g   i     R# ; i)r   Nr   )r   r   )r$   r1   sizelenr&   external_error_raised
ValueError)r   r(   r)   s   && r   test_reshapeDim2CompatTests.test_reshape_   s    R#{{tyy!n,,,5zSY&&&W%{{tyy!n,,,5zSY&&&%%j11LL$))Q( 2%%j11LLA& 21 21111s   :D)D<)D9	<E	c                   VP                  ^R4      pV^ ,          p\        P                  ! W14       \        P                  ! \
        4      ;_uu_ 4        V^,           RRR4       \        P                  ! \
        4      ;_uu_ 4        VR,           RRR4       VR,          p\        P                  ! W24       VR,          p\        P                  ! W24       VR,          pV^ .,          p\        P                  ! W44       VR\        P                  3,          p\        P                  ! W2P                  4       R#   + '       g   i     L; i  + '       g   i     L; i)r   Nr    r   r   )r    r    r   )	r$   r&   r'   r   raises
IndexErrornpnewaxisr2   r?   s   &&   r   test_getitem_2dDim2CompatTests.test_getitem_2dm   s    Q#q
''5]]:&&!H ' ]]:&&"I ' q
''6t
''6t9
''9 am$
''8% '& '&s   
D<
E<E	E	c                   VP                  ^R4      p\        \        V4      4      p\        V4      VP                  ^ ,          8X  g   Q hV Fs  p\        V\        V4      4      '       g   Q hVP                  VP                  8X  g   Q hVP                  ^8X  g   Q h\        V4      VP                  ^,          8X  d   Ks  Q h	  R# )r   Nr   )	r$   listiterrX   r1   
isinstancerQ   r   ndim)r   r(   r)   objsobjs   &&   r   test_iter_2dDim2CompatTests.test_iter_2d   s    Q#DK 4yEKKN***Cc4:....99

***88q= =s8u{{1~---	 r   c                $   VP                  ^R4      pVP                  4       pVP                  4       .p\        V\        4      '       g   Q h\        ;QJ d    R V 4       F  '       d   K   RM	  RM! R V 4       4      '       g   Q hW48X  g   Q hR# )r   c              3   B   "   T F  p\        V\        4      x  K  	  R # 5i)N)rg   re   ).0xs   & r   	<genexpr>1Dim2CompatTests.test_tolist_2d.<locals>.<genexpr>   s     71:a&&s   FTNr   )r$   tolistrg   re   allr?   s   &&   r   test_tolist_2dDim2CompatTests.test_tolist_2d   sp    Q#KKM?&$''''s77sss777777!!!r   c                   \        V4      P                  W.4      P                  R^4      pVP                  4       pVP                  W#.^ R7      pVP                  V.^,          4      P                  R^4      p\        P
                  ! WE4       VP                  W#.^R7      pVP                  \        V4      ^38X  g   Q h\        P
                  ! VR,          V4       \        P
                  ! VR,          V4       Rp\        P                  ! \        VR7      ;_uu_ 4        VP                  W#.^R7       RRR4       R#   + '       g   i     R# ; i)r   rD   z0axis 2 is out of bounds for array of dimension 2matchNr   )r    :Nr   N)r    :r   NN)rQ   _concat_same_typer$   copyr&   r'   r1   rX   r   r^   rZ   )r   r(   leftrightr+   r:   msgs   &&     r   test_concat_2dDim2CompatTests.test_concat_2d   s   Dz++TL9AA"aH		 ''A'>))4&1*5==b!D
''9 ''A'>||D	1~---
''ut<
''uu= A]]:S11""D=q"9 2111s   #EE	methodbackfillpadc                D   VP                  ^4      P                  ^^4      pV^ ,          P                  4       P                  4       '       g   Q hV^,          P                  4       P	                  4       '       d   Q hVP                  VRR7      pVP                  VR7      P                  ^4      P                  ^^4      p\        P                  ! WE4       VRRR1,          pV^ ,          P                  4       P	                  4       '       d   Q hV^,          P                  4       P                  4       '       g   Q hVP                  VRR7      pVRRR1,          P                  VR7      P                  ^4      P                  ^^4      p\        P                  ! Wx4       R# )r   N)r   limit)r   r   )r#   r$   isnart   any_pad_or_backfillr&   r'   )	r   data_missingr   arrr+   r:   arr2result2	expected2s	   &&&      r   test_fillna_2d_method%Dim2CompatTests.test_fillna_2d_method   s\    !!!$,,Q21v{{}  """"q6;;=$$&&&&%%V4%@000?FFqIQQRSUVW
''9 4R4y7<<>%%''''Aw||~!!####''vT'B 2//v/>EEaHPPQRTUV 	 	'';r   c                   VP                  ^R4      pRpRp \        W4      ! 4       p\        W24      ! RR7      pTf   Te   \        T4      \        T4      8X  g   Q hR# \	        XX4      '       g   Yv8X  g   Q hR# R#   \         d>   pTp \        Y24      ! RR7      p Rp?Lh  \         d   p	T	p Rp	?	 Rp?L~Rp	?	ii ; iRp?ii ; i)r   NrD   r   )r$   getattr	ExceptionrQ   r   )
r   r(   r   r)   err_expected
err_resultr:   r+   errerr2s
   &&&       r   test_reductions_2d_axis_none,Dim2CompatTests.test_reductions_2d_axis_none   s    Q#
	7t,.H U+6F!\%=
#tL'9999fh//63EEE3E/  	"L" /T: "!

"	"s;   A= =CC B""B=-B8/C 8B==C  C	min_countc                   V^8X  d!   VR9  d   \         P                  ! RV 24       VP                  ^R4      p/ pVR9   d   ^ VR&   MVR9   d   W5R&    \        WB4      ! RR^ /VB pR p	TR9   d   Tp
TP                  P                  R	9   d6   T	! TP                  4      pTP                  T4      p
YP                  8X  g   Q hT^ 8X  d   TR8X  d   ^M^ pT
P                  T4      p
\        P                  ! Yj4       R# TR
8X  d   Tp
\        P                  ! Yj4       R# TR9   dr   \        T4      '       g   \        T4      '       d   TP                  R4      pTR8X  d   \        P                  ! Ya4       R# \        P                  ! YaT,
          4       R# R#   \         dZ   p \        Y4      ! 4        \        R4      h  \         d+   p\        T4      \        T4      8X  g   Q h Rp? Rp?R# Rp?ii ; iRp?ii ; i)r   prodzmin_count not relevant for ddofr   rE   'Both reductions should raise or neitherNc                     V P                   ^8X  d   V # V P                  R9   d&   \        \        P                  ! \
        4      ,          # \        \        P                  ! R4      ,          # )   ibuint)itemsizekindr   r`   r   int)r   s   &r   get_reduction_result_dtypeLDim2CompatTests.test_reductions_2d_axis0.<locals>.get_reduction_result_dtype   sJ     ~~"t#)"((3-88 *"((6*:;;r   iubmedianmeanFloat64)sumr   r   )stdvar)r   r    )r   r   r   )r   r   r$   r   r   AssertionErrorrQ   r   r   astypefillnar&   r'   r   r   )r   r(   r   r   r)   kwargsr+   r   r   r   r:   r   r   s   &&&&         r   test_reductions_2d_axis0(Dim2CompatTests.test_reductions_2d_axis0   s    >fO;KK5fX>?Q#^#F6N&"+;		PU+==f=F		< _$Hzz%'24::>;;u-...A~"(F"2Q
#??:6++F=xH++F=--%%t)<)<{{9-//=//tD .K  	PP%'
 %%NOO	  CyDJ...	Ps<   F G>&G6G9G6G1'G91G66G99G>c                   VP                  ^R4      p \        W24      ! ^R7      pTP
                  R8X  g   Q h\        Y4      ! 4       pT^ ,          p\        Y4      '       g   Y8X  g   Q hR# R#   \         dZ   p \        Y4      ! 4        \        R4      h  \         d+   p\	        T4      \	        T4      8X  g   Q h Rp? Rp?R# Rp?ii ; iRp?ii ; i)r   rD   r   Nr   )r   )r$   r   r   r   rQ   r1   r   )	r   r(   r   r)   r+   r   r   expected_scalarrS   s	   &&&      r   test_reductions_2d_axis1(Dim2CompatTests.test_reductions_2d_axis1!  s    Q#		PU+3F ||t###!$/1Qic33s7MMM7M3  	PP%'
 %%NOO	  CyDJ...	Ps;   A/ /C;BCC!C<CCCCr   N)r   r   r   r   r   r   )rR   
__module__r   __firstlineno__r   fixturer   r-   r3   r;   r@   rG   rK   rT   r[   rb   rk   ru   r   markparametrizer   r   r   r   __static_attributes____classdictcell____classdict__s   @r   r   r      s"     ^^D!= "=L,,:::9'94
.	":( [[X
E':;< <<. [[X'VWF XF0 [[X'VW[[[1a&1:E 2 X:Ex [[X'VWN XNr   r   c                   &   a  ] tR tRt o R tRtV tR# )NDArrayBacked2DTestsi7  c                   VP                  ^4      P                  R^4      pVP                  P                  R,          '       g   Q hVP	                  4       pVP                  P                  R,          '       g   Q hVR,          P	                  4       pVP                  P                  R,          '       g   Q hVP	                  R4      pVP                  P                  R,          '       d   Q hVP                  P                  R,          '       g   Q hVP	                  R4      pVP                  P                  R,          '       g   Q hVP
                  P	                  R4      pVP                  P                  R,          '       d   Q hVP                  P                  R,          '       g   Q hRp\        P                  ! \        VR7      ;_uu_ 4        VP	                  R4       R	R	R	4       VR,          pVP                  P                  R,          '       d   Q hVP                  P                  R,          '       d   Q hVP	                  4       P                  P                  R,          '       g   Q hVP	                  4       P                  P                  R,          '       d   Q hVP	                  R
4      P                  P                  R,          '       g   Q hVP	                  R
4      P                  P                  R,          '       d   Q hVP	                  R4      P                  P                  R,          '       d   Q hVP	                  R4      P                  P                  R,          '       g   Q hVP	                  R4      P                  P                  R,          '       g   Q hVP	                  R4      P                  P                  R,          '       d   Q hR	#   + '       g   i     EL; i)r   C_CONTIGUOUSNNr   FF_CONTIGUOUSKz6order must be one of 'C', 'F', 'A', or 'K' \(got 'Q'\)rx   QNCr   )r   r   )	r#   r$   _ndarrayflagsr{   r2   r   r^   rZ   )r   r(   r)   rS   r~   arr_ncs   &&    r   test_copy_order$NDArrayBacked2DTests.test_copy_order:  s   A&&r1-~~##N3333jjl||!!.1111Ho""$||!!.1111jjo<<%%n5555||!!.1111jjo||!!.1111ggll3<<%%n5555||!!.1111 H]]:S11JJsO 2 s??((8888??((8888{{}%%++N;;;;;;=))//????{{3((..~>>>>;;s#,,22>BBBB;;s#,,22>BBBB{{3((..~>>>>{{3((..~>>>>;;s#,,22>BBBBB% 211s   O!!O2	r   N)rR   r   r   r   r   r   r   r   s   @r   r   r   7  s     *C *Cr   r   )__doc__numpyr`   r   pandas._libs.missingr   pandas.core.dtypes.commonr   r   pandasr6   pandas._testing_testingr&   pandas.core.arrays.integerr   r   r   r   r   r   <module>r      sB      /
   9`N `NF	-C? -Cr   