+
    yȇi$                     z    ^ RI Ht ^ RIt^ RIt^ RIHt ^ RIt^ RIH	t	H
t
HtHt ^ RIHt ^ RIHt  ! R R4      tR# )    	timedeltaN)Pandas4Warning)	TimedeltaTimedeltaIndextimedelta_rangeto_timedelta)TimedeltaArrayc                      a  ] tR t^t o R 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R tR tR tR t]P,                  P/                  R. RO4      R 4       tRtV tR# )TestTimedeltaIndexc                P   \         P                  ! R R4      p\         P                  ! V.\        R7      pRp\        P
                  ! \        VR7      ;_uu_ 4        \        V4       RRR4       \        P
                  ! \        VR7      ;_uu_ 4        \        P                  ! VRR7       RRR4       \        P
                  ! \        VR7      ;_uu_ 4        \        V4       RRR4       R#   + '       g   i     L; i  + '       g   i     L]; i  + '       g   i     R# ; i)NaTnsdtypez!Invalid type for timedelta scalarmatchNm8[ns])np
datetime64arrayobjectpytestraises	TypeErrorr   r
   _from_sequencer	   )selfnatarrmsgs   &   ځ/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/tests/indexes/timedeltas/test_constructors.pytest_array_of_dt64_nat_raises0TestTimedeltaIndex.test_array_of_dt64_nat_raises   s    mmE4(hhuF+1]]9C003 1 ]]9C00))#X> 1 ]]9C00 10 10 10 100s$   C.DD.C>	D	D%	c                    \         P                  ! ^
\         P                  R7      p\        VRR7      pVP                  P
                  P                  VJ g   Q hR# )
   r   F)copyN)r   arangeint64r   _data_ndarraybase)r   r   tdis   &  r!   test_int64_nocopy$TestTimedeltaIndex.test_int64_nocopy#   sB     ii"((+Su-yy!!&&#---    c                    \        R RRR7      p\        VRR7      pVP                  VP                  8X  g   Q hR\        VR/ 4      9  g   Q hR# )	1 second1speriodsfreqinferr5   inferred_freq_cacheNi )r   r   r5   getattrr   r,   results   &  r!   test_infer_from_tdi&TestTimedeltaIndex.test_infer_from_tdi*   sM     j%dC'2{{chh&&& gfh&CCCCr/   c                p   \        R ^dRR7      pRp\        P                  ! \        VR7      ;_uu_ 4        \	        VRR7       RRR4       \        P                  ! \        VR7      ;_uu_ 4        \	        VP
                  RR7       RRR4       R#   + '       g   i     LV; i  + '       g   i     R# ; i)r1   r2   r3   zMInferred frequency .* from passed values does not conform to passed frequencyr   Dr7   N)r   r   r   
ValueErrorr   r)   )r   r,   r    s   &  r!   test_infer_from_tdi_mismatch/TestTimedeltaIndex.test_infer_from_tdi_mismatch7   s|     j#DA. 	 ]]:S113S) 2 ]]:S113993/ 21 21 211s   B/B$B!	$B5	c                D   \         P                  ! R ^R7      pRp\        P                  ! \        VR7      ;_uu_ 4        \        VP                  R4      4       RRR4       \        P                  ! \        VR7      ;_uu_ 4        \        V4       RRR4       \        P                  ! \        VR7      ;_uu_ 4        \        \        P                  ! V4      4       RRR4       R#   + '       g   i     L; i  + '       g   i     Lq; i  + '       g   i     R# ; i)z
2016-01-01r4   z"cannot be converted to timedelta64r   zEurope/BrusselsN)	pd
date_ranger   r   r   r   tz_localizer   asarray)r   dtir    s   &  r!   test_dt64_data_invalid)TestTimedeltaIndex.test_dt64_data_invalidG   s     mmL!42]]9C003??+<=> 1 ]]9C003 1 ]]9C002::c?+ 10 10 10 100s#   C(C;> D(C8	;D	D	c                r   \        R R.4      p\        ^^	.4      p\        P                  ! W4       \        RR.4      p\        ^^	.4      p\        P                  ! W4       \        R\        P                  .4      p\        \        ^R7      \        P                  .4      p\        P                  ! W4       R# )gffffff@gffffff#@g       @g      "@)nanosecondsN)r   tmassert_index_equalr   nanr   rF   r   r   r,   expecteds   &  r!   test_float64_ns_rounded*TestTimedeltaIndex.test_float64_ns_roundedW   s     c3Z(!1a&)
c, c3Z(!1a&)
c, c266]+!9#;RVV"DE
c,r/   c                    \        R R.RR7      p\        \        R R7      \        RR7      .RR7      p\        P                  ! W4       R# )g      ?g      @r@   unit)daysr   r   N)r	   r   r   rO   rP   rR   s   &  r!   test_float64_unit_conversion/TestTimedeltaIndex.test_float64_unit_conversionh   s@    C;S1!C )"67x
 	c,r/   c                   \        R 4      \        P                  \        R4      .p\        P                  ! \        P
                  ! V4      \        V4      4       \        P                  ! \        P
                  ! \        P                  ! V4      4      \        \        P                  ! V4      4      4       \        P                  \        P                  \        R 4      .p\        P                  ! \        P
                  ! V4      \        V4      4       \        P                  ! \        P
                  ! \        P                  ! V4      4      \        \        P                  ! V4      4      4       R# )1 days3 daysN)
r   rF   r   rO   rP   Indexr   r   r   rQ   )r   r   s   & r!   "test_construction_base_constructor5TestTimedeltaIndex.test_construction_base_constructorp   s    "BFFIh,?@
bhhsm^C-@A
bhhrxx}5~bhhsm7TUvvrvvy23
bhhsm^C-@A
bhhrxx}5~bhhsm7TUr/   c           
         \        . RO4      p\        R R\        P                  ! ^R4      \        ^^R7      \        P
                  P                  ^4      .4      p\        P                  ! W!4       R# )r]   z1 days, 00:00:05r@   )rY   secondsN)r]   z1 days 00:00:052 daysz2 days 00:00:02z0 days 00:00:03)	r   r   timedelta64r   rF   offsetsSecondrO   rP   )r   rS   r<   s   &  r!   test_constructor#TestTimedeltaIndex.test_constructory   sb    !
  "q#&q!,

!!!$
 	f/r/   c                    \        R ^	RR7      p\        ^^
4       Uu. uF	  pRV R2NK  	  pp\        V4      p\        P                  ! WA4       R# u upi )r2   sr3   P0DT0H0MSN)r   ranger	   rO   rP   )r   rS   i	durationsr<   s   &    r!   test_constructor_iso'TestTimedeltaIndex.test_constructor_iso   sO    "4=.3Arl;lxs!_l	;i(
f/ <s   Ac                    R p\         P                  ! \        VR7      ;_uu_ 4        \        RRR7       RRR4       R#   + '       g   i     R# ; i)zperiods must be an integerr   r]   g      %@rE   N)r   r   r   r   r   r    s   & r!   &test_timedelta_range_fractional_period9TestTimedeltaIndex.test_timedelta_range_fractional_period   s1    *]]9C00Hd3 1000s	   ?A	c                   R p\         P                  ! \        VR7      ;_uu_ 4        \        RRRR7       RRR4       Rp\         P                  ! \        VR7      ;_uu_ 4        \	        R4       RRR4       R \        ^
4       4       p\	        V4      p\	        \        ^
4       Uu. uF  p\        V4      NK  	  up4      p\        P                  ! W54       \        P                  ! . RO4      p\	        V4      p\        . RORR	7      P                  R
4      p\        P                  ! W54       \	        VP                  R4      P                  4      p\        P                  ! WuP                  R4      4       Rp\         P                  ! \        VR7      ;_uu_ 4        \	        . RORR7       RRR4       Rp\         P                  ! \        VR7      ;_uu_ 4        \        ^
RR7       RRR4       R#   + '       g   i     EL; i  + '       g   i     EL; iu upi   + '       g   i     L{; i  + '       g   i     R# ; i)z#periods must be an integer, got foor   r]   foor@   )startr4   r5   Nz[TimedeltaIndex\(\.\.\.\) must be called with a collection of some kind, '1 days' was passedc              3   8   "   T F  p\        V4      x  K  	  R # 5i)Nr   ).0ro   s   & r!   	<genexpr>?TestTimedeltaIndex.test_constructor_coverage.<locals>.<genexpr>   s     /Yy||Ys   rW   usr   zQInferred frequency None from passed values does not conform to passed frequency Dr7   zVOf the four parameters: start, end, periods, and freq, exactly three must be specifiedr3   )r]   rd   r^   )         )r]   rd   z4 days)r   r   r   r   r   rn   r   rO   rP   r   r   r	   as_unitasi8rA   )r   r    genr<   ro   rS   strings	from_intss   &       r!   test_constructor_coverage,TestTimedeltaIndex.test_constructor_coverage   s   3]]9C00(ED 1" 	 ]]9C008$ 1 0U2Y/$!r"CA9Q<"CD
f/ ((9:(	4<<TB
f/"8#3#3D#9#>#>?	
i)9)9$)?@! 	 ]]:S119D 2& 	 ]]:S11BS1 21K 100 100 #D" 21 211s5   G4$H'HH!H44H	H	!H1	4I	c                    \        R ^RRR7      pVP                  R8X  g   Q h\        VRR7      pVP                  R8X  g   Q hR# )r]   r@   TEST)ry   r4   r5   namezsomething else)r   N)r   r   r   )r   idxidx2s   &  r!   test_constructor_name(TestTimedeltaIndex.test_constructor_name   sF    HacOxx6!!! c(89yy,,,,r/   c                ^   R p\         P                  ! \        VR7      ;_uu_ 4        \        R.RR7       RRR4       Rp\         P                  ! \        VR7      ;_uu_ 4        \        P
                  ! R.RR7       RRR4       R#   + '       g   i     LZ; i  + '       g   i     R# ; i)z with no precision is not allowedr   2000re   r   Nz3The 'timedelta64' dtype has no unit. Please pass in)r   r   rA   r   rF   r_   rt   s   & r!   $test_constructor_no_precision_raises7TestTimedeltaIndex.test_constructor_no_precision_raises   sq     1]]:S11F8=9 2 D]]:S11HHfX]3 21	 21 211s   B$BB	B,	c                    R p\         P                  ! \        VR7      ;_uu_ 4        \        R.RR7       RRR4       \        R.RR7      pVP                  R8X  g   Q hR#   + '       g   i     L3; i)z;Supported timedelta64 resolutions are 's', 'ms', 'us', 'ns'r   r   ztimedelta64[D]r   Nztimedelta64[us]zm8[us])r   r   rA   r   r   )r   r    r,   s   &  r!   'test_constructor_wrong_precision_raises:TestTimedeltaIndex.test_constructor_wrong_precision_raises   sV    K]]:S11F8+;< 2 fX->?yyH$$$ 21s   A!!A1	c                    \        ^^R7      pVP                  f   Q h\        VRR7      pVP                  e   Q h\        VP                  RR7      pVP                  e   Q hR# )r   rE   Nr7   )r   r5   r   r)   r;   s   &  r!   test_explicit_none_freq*TestTimedeltaIndex.test_explicit_none_freq   sZ    a+xx###$/{{"""		5{{"""r/   c                    \        ^^R7      p\        P                  ! V4      p\        V4      p\        P
                  ! W14       \        P                  ! V4      p\        V4      p\        P
                  ! W14       R# )r   rE   N)r   rF   Categoricalr   rO   rP   CategoricalIndex)r   r,   catr<   cis   &    r!   test_from_categorical(TestTimedeltaIndex.test_from_categorical   s\    a+nnS!$
f*  %#
f*r/   zunit,unit_deprc                   R V R2p\        RV 2RV 2.4      p\        P                  ! \        VR7      ;_uu_ 4        \        RV 2RV 2.4      pRRR4       \        P                  ! XV4       \        P                  ! \        VR7      ;_uu_ 4        \        ^^.VR7      pRRR4       VR9   d   TMRp\        P                  ! XVP                  V4      4       R#   + '       g   i     L; i  + '       g   i     LV; i)	'z8' is deprecated and will be removed in a future version.12r   NrW   rk   )rk   msr~   )r   rO   assert_produces_warningr   rP   r	   r   )r   rX   	unit_deprr    rS   r<   r,   exp_units   &&&     r!   test_unit_deprecated'TestTimedeltaIndex.test_unit_deprecated   s     )TU!Qtf:4&z":;''cBB#q_)o$FGF C
fh/''cBB1vI6C C#444#
c8#3#3H#=> CB CBs   C C3 C0	3D	 N))Ww)r@   d)minMIN)rk   rm   )hH)r   MS)r~   US)__name__
__module____qualname____firstlineno__r"   r-   r=   rB   rK   rT   rZ   r`   rh   rq   ru   r   r   r   r   r   r   r   markparametrizer   __static_attributes____classdictcell__)__classdict__s   @r!   r   r      s     .D0 , -"-V0*04
(2T-	4%	#
+ [[	
??r/   r   )datetimer   numpyr   r   pandas.errorsr   pandasrF   r   r   r   r	   pandas._testing_testingrO   pandas.core.arrays.timedeltasr
   r   r   r/   r!   <module>r      s2       (    8|? |?r/   