+
    yȇi1                         ^ RI HtHt ^ RIt^ RIt^ RIHt ^ RI	H
t
HtHtHtHtHt ^ RIHt ^ RIHt ^ RIHt  ! R R4      tR# )	    )given
strategiesN)lib)NaTOutOfBoundsDatetime	Timedelta	TimestampiNaT	to_offset)NpyDatetimeUnit)INVALID_FREQ_ERR_MSGc                     a  ] tR t^t o R t]P                  P                  R. RO4      R 4       tR t	R t
R tR tR t]P                  P                  R	. RO4      R
 4       t]P                  P                  R. RO4      ]P                  P                  R. RO4      R 4       4       tR tR t]P                  P                  R. R O4      R 4       t]P                  P                  R. R!O. R"O. R#O.4      R 4       t]P                  P                  R. R$O4      ]P                  P                  R. R%O4      R 4       4       tR t]P                  P,                  ]! ]P2                  ! ]^,           ]P8                  4      R7      ]P                  P                  R]P<                  ]P>                  ]P@                  .4      R 4       4       4       t!Rt"V t#R# )&TestTimestampRoundc                    \        R 4      pRp\        P                  ! \        VR7      ;_uu_ 4        VP	                  R4       RRR4       R#   + '       g   i     R# ; i)z
2016-01-01zDivision by zero in roundingmatch0nsN)r	   pytestraises
ValueErrorround)selftsmsgs   &  ڀ/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/tests/scalar/timestamp/methods/test_round.py"test_round_division_by_zero_raises5TestTimestampRound.test_round_division_by_zero_raises   s<    |$,]]:S11HHUO 2111s   AA	ztimestamp, freq, expectedc                d    \        V4      pVP                  V4      p\        V4      pWS8X  g   Q hR # Nr	   r   )r   	timestampfreqexpecteddtresults   &&&&  r   test_round_frequencies)TestTimestampRound.test_round_frequencies   s1     y!$X&!!!    c                    \        R RR7      pVP                  R4      p\        RRR7      pW#8X  g   Q h\        R RR7      pVP                  R4      pW!8X  g   Q hR# )20130101 09:10:11z
US/EasterntzD20130101sNr    r   r$   r%   r#   s   &   r   test_round_tzaware%TestTimestampRound.test_round_tzaware1   sX    *|<#ZL9!!!*|<#||r(   c                d    \        R 4      pVP                  R4      p\        R4      pW#8X  g   Q hR# )z20130104 12:32:0030Minz20130104 12:30:00Nr    r0   s   &   r   test_round_30min#TestTimestampRound.test_round_30min;   s2    *+'"01!!!r(   c                j   \        R 4      P                  R4      p\        R4      pW8X  g   Q h\        R4      P                  R4      p\        R4      pW8X  g   Q h\        R 4      pR	 F  pW3P                  V4      8X  d   K  Q h	  \        R4      P                  R4      p\        R4      pW8X  g   Q hR# )
z2016-10-17 12:00:00.0015msz2016-10-17 12:00:00.002000z2016-10-17 12:00:00.00149z2016-10-17 12:00:00.0010002016-10-17 12:00:00.00150103110nsz2016-10-17 12:00:00.001501030N)usnsr    )r   r%   r#   r   r"   s   &    r   test_round_subsecond'TestTimestampRound.test_round_subsecondB   s    56<<TB9:!!!67==dC9:!!!12 D$''' ! :;AA&I<=!!!r(   c                    \         P                  ! R 4      ;_uu_ 4        \        R4      P                  R4       RRR4       R#   + '       g   i     R# ; i)Fr9   1010nsN)tmassert_produces_warningr	   r   )r   s   &r   test_round_nonstandard_freq.TestTimestampRound.test_round_nonstandard_freqT   s6    ''..56<<XF /...s   AA	c                    \        R 4      p\        P                  ! \        \        R7      ;_uu_ 4        VP                  R4       RRR4       R#   + '       g   i     R# ; i)2000-01-05 05:09:15.13r   fooN)r	   r   r   r   r   r   )r   stamps   & r   test_round_invalid_arg)TestTimestampRound.test_round_invalid_argX   s;    23]]:-ABBKK CBBBs   AA!	z#test_input, rounder, freq, expectedc                    \        V4      p\        WR4      pV! V4      pV\        J d   V\        J g   Q hR # \        V4      pWt8X  g   Q hR # r   )r	   getattrr   )r   
test_inputrounderr"   r#   r$   funcr%   s   &&&&&   r   test_ceil_floor_edge'TestTimestampRound.test_ceil_floor_edge]   sJ    0 z"r#d9S= = *H%%%r(   ztest_input, freq, expectedrN   c                h    \        V4      p\        V4      p\        WT4      pV! V4      pWs8X  g   Q hR # r   )r	   rL   )r   rM   r"   r#   rN   r$   rO   r%   s   &&&&&   r   test_round_minute_freq)TestTimestampRound.test_round_minute_freq   s7      z"X&r#d!!!r(   c                    \        R 4      P                  V4      pVP                  R4      p\        R4      pW48X  g   Q hVP                  VP                  8X  g   Q hR# )r*   r-   20130102N)r	   as_unitceil_cresor   unitr$   r%   r#   s   &&   r   	test_ceilTestTimestampRound.test_ceil   sQ    *+33D9Z(!!!}}		)))r(   c                    \        R 4      P                  V4      pVP                  R4      p\        R4      pW48X  g   Q hVP                  VP                  8X  g   Q hR# )r*   r-   r.   N)r	   rW   floorrY   rZ   s   &&   r   
test_floorTestTimestampRound.test_floor   sQ    *+33D9#Z(!!!}}		)))r(   methodc                   \        R RR7      P                  R4      pVP                  V4      p\        W14      ! RRR7      pWC8X  g   Q hVP                  \        \
        RV 24      P                  8X  g   Q h\        W14      ! RRR7      p\        R	RR7      P                  R4      pWE8X  g   Q hVP                  \        \
        RV 24      P                  8X  g   Q h\        W14      ! RR
R7      pV\        J g   Q hRp\        P                  ! \        VR7      ;_uu_ 4        \        W14      ! RRR7       RRR4       R#   + '       g   i     R# ; i)z2017-10-29 00:00:00UTCr+   zEurope/MadridhT)	ambiguousNPY_FR_Fz2017-10-29 01:00:00r   zCannot infer dst timer   raiseN)r	   
tz_convertrW   rL   rY   r   valuer   r   r   r   )r   rb   r[   r   r%   r#   r   s   &&&    r   test_round_dst_border_ambiguous2TestTimestampRound.test_round_dst_border_ambiguous   s    ,7BB?SZZ$SD9||}}74&9I J P PPPP$SE:2u=HH
 !!!}}74&9I J P PPPP$SE:}}%]]:S11Bw7 2111s   !D??E	zmethod, ts_str, freqc                   \        VR R7      P                  V4      p\        WQ4      ! VRR7      p\        RR R7      pWg8X  g   Q hVP                  \        \        RV 24      P
                  8X  g   Q h\        WQ4      ! VRR7      pV\        J g   Q hRp\        P                  ! \        VR7      ;_uu_ 4        \        WQ4      ! VR	R7       R
R
R
4       R
#   + '       g   i     R
# ; i)zAmerica/Chicagor+   shift_forward)nonexistentz2018-03-11 03:00:00rg   r   z2018-03-11 02:00:00r   rh   N)
r	   rW   rL   rY   r   rj   r   r   r   r   )	r   rb   ts_strr"   r[   r   r%   r#   r   s	   &&&&&    r   !test_round_dst_border_nonexistent4TestTimestampRound.test_round_dst_border_nonexistent   s     v"34<<TB$TG27HI!!!}}74&9I J P PPPP$Tu=}}#]]:S11B': 2111s   8CC'	r!   r"   c                   \        V4      P                  R 4      p\        V4      P                  pVP	                  V4      pVP
                  V,          ^ 8X  g   Q RV R24       h^ VP
                  VP
                  ,
          u;8:  d   V8  g   Q R4       h Q R4       hVP                  V4      pVP
                  V,          ^ 8X  g   Q RV R24       h^ VP
                  VP
                  ,
          u;8:  d   V8  g   Q R4       h Q R4       hVP                  V4      pVP
                  V,          ^ 8X  g   Q RV R24       h\        VP
                  VP
                  ,
          4      V^,          8:  g   Q R4       hV^,          ^ 8X  d]   \        VP
                  VP
                  ,
          4      V^,          8X  d)   VP
                  V,          ^,          ^ 8X  g   Q R4       hR	# R	# R	# )
r<   zfloor not a z	 multiplezfloor errorzceil not a z
ceil errorzround not a zround errorzround half to even errorN)	r	   rW   r   nanosr_   _valuerX   r   abs)r   r!   r"   r$   r[   r%   s   &&&   r   test_round_int64#TestTimestampRound.test_round_int64   s   J y!))$/$$ $}}t#q(HLi*HH(BII-44CmC4CmC4 }}t#q(GKvY*GG(FMMBII-44BlB4BlB4 $}}t#q(HLi*HH(6==299,-:IMI:!8q=S!:;tqyH==D(1,1M3MM1 I=r(   c                   \         P                  P                  R 4      p\        R^	^^ ^^,4      pW8X  g   Q h\         P                  P	                  R 4      p\         P                  \        R4      ,
          pW8X  g   Q hRp\        P                  ! \        VR7      ;_uu_ 4        \         P                  P	                  R 4       RRR4       \        P                  ! \        VR7      ;_uu_ 4        \         P                  P                  R 4       RRR4       Rp\        P                  ! \        VR7      ;_uu_ 4        \         P                  P                  R 4       RRR4       \        P                  ! \        VR7      ;_uu_ 4        \         P                  P                  R 4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)r/   i  i2z;Cannot round 1677-09-21 00:12:43.145224193 to freq=<Second>r   Nz;Cannot round 2262-04-11 23:47:16.854775807 to freq=<Second>)
r	   minrX   maxr_   r   r   r   r   r   )r   r%   r#   r   s   &   r    test_round_implementation_bounds3TestTimestampRound.test_round_implementation_bounds  sH   ##C(T1b!R4!!!$$S)==9Y#77!!!K]].c::MM$ ; ]].c::MM$ ; L]].c::MMs# ; ]].c::MM$ ;: ;: ;: ;: ;::s0   % F51 G? G G.5G	G	G+	.G?	)valc                
  aaa \         o\        o\        P                  ! V4      pS! V4      pVVV3R  lp^pV! W5R4       RpV! W5R4       RpV! W5R4       RpV! W5R4       RpV! W5R4       RpV! W5R	4       RpV! W5R
4       R# )c                   < V^8X  d   EM\        V P                  V4      w  r4\        W,
          4      pV P                  V,
          pW`P                  8:  g   Q hV P                  V,           pWpP                  8  g   Q hRpV^ 8X  d   EMbSSP                  J dQ   VSP                  P                  8  d4   \
        P                  ! SVR7      ;_uu_ 4        S! W4       RRR4       R# EMSSP                  J dP   VSP                  P                  8  d4   \
        P                  ! SVR7      ;_uu_ 4        S! W4       RRR4       R# MWE8  dP   VSP                  P                  8  d4   \
        P                  ! SVR7      ;_uu_ 4        S! W4       RRR4       R# MNVSP                  P                  8  d4   \
        P                  ! SVR7      ;_uu_ 4        S! W4       RRR4       R# S! W4      p	W,
          p
\        V
P                  4      pWQ8  g   Q hV	P                  V,          ^ 8X  g   Q hSSP                  J d   WQ^,          8:  g   Q hR# SSP                  J d   W8:  g   Q hR# SSP                  J d   W8  g   Q hR# R#   + '       g   i     R# ; i  + '       g   i     R# ; i  + '       g   i     R# ; i  + '       g   i     R# ; i)   zwithout overflowr   N)divmodru   intrX   r{   r   r   r_   rz   rv   r   )r   rt   r[   divmoddifflbubr   restdclserr_clsrb   s   &&&        r   checker5TestTimestampRound.test_round_sanity.<locals>.checker/  s!   z!"))U35;'YY_YY&YY%II~%~(!8sxx'CGGNN*#]]7#>>"2, ? + syy(CGGNN*#]]7#>>"2, ? + [CGGNN*#]]7#>>"2, ? + #''..(wc::r( ;"CBryy>D<<::%***"qy(((399$y y388#y y $; ?> ?> ?>::s0   	J	4	J		J1	K	J	J.	1K	K	r<   i  r;   i@B r8   i ʚ;r/   rz   re   r-   Nl    Xp7 l     qal     "R: )r	   r   npint64)r   r~   rb   r   r   rt   r   r   s   &&f   @@r   test_round_sanity$TestTimestampRound.test_round_sanity#  s     %hhsmX0	!d 4 4 4 3"5!'3,3r(    N))r*   r-   r.   )z20130101 19:10:11r-   rV   )z20130201 12:00:00r-   20130202)z20130104 12:00:00r-   20130105)rF   r-   z2000-01-05 00:00:00)rF   re   z2000-01-05 05:00:00)rF   r/   z2000-01-05 05:09:15))2117-01-01 00:00:45r_   15sr   )r   rX   r   r   )z2117-01-01 00:00:45.000000012r_   r:   z2117-01-01 00:00:45.000000010)z1823-01-01 00:00:01.000000012rX   r:   z1823-01-01 00:00:01.000000020)1823-01-01 00:00:01r_   1sr   )r   rX   r   r   )r   r_   r   r   )r   rX   r   r   ))2018-01-01 00:02:062sr   )2018-01-01 00:02:002minr   )2018-01-01 00:04:004minr   )2018-01-01 00:15:0015minr   )2018-01-01 00:20:0020minr   )2018-01-01 03:00:003hr   )rX   r_   r   )rX   r   r_   )rX   2018-03-11 01:59:00-06005min)r   r   r   )r_   z2018-03-11 03:01:00-05002h)z2018-01-01 0:0:0.124999360z2018-01-01 0:0:0.125000367z2018-01-01 0:0:0.125500z2018-01-01 0:0:0.126500z2018-01-01 12:00:00z2019-01-01 12:00:00)2ns3ns4ns5ns6ns7ns250ns500ns750ns1us19us250us500us750usr   r   3s1D)$__name__
__module____qualname____firstlineno__r   r   markparametrizer&   r1   r5   r=   rC   rI   rP   rS   r\   r`   rk   rq   rw   r|   slowr   stintegersr
   r   i8maxr	   r   r_   rX   r   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s     [[#	
""""$G
 [[-	
.	&/.	& [[$	

 [[Y(BC" D
"** [[X'AB8 C8, [[897	
;; [[	

 [[	
.N/
DN0%0 [[
r{{4!8SYY/0[[9??IOOY^^DL  1 
L r(   r   )
hypothesisr   r   r   numpyr   r   pandas._libsr   pandas._libs.tslibsr   r   r   r	   r
   r   pandas._libs.tslibs.dtypesr   pandas._libs.tslibs.periodr   pandas._testing_testingrA   r   r   r(   r   <module>r      s6        7 ; ]  ] r(   