@@ -44,7 +44,12 @@ class TimedeltaDelegateMixin(DatetimelikeDelegateMixin):
44
44
# which we we dont' want to expose in the .dt accessor.
45
45
_delegate_class = TimedeltaArray
46
46
_delegated_properties = TimedeltaArray ._datetimelike_ops + ["components" ]
47
- _delegated_methods = TimedeltaArray ._datetimelike_methods + ["_box_values" ]
47
+ _delegated_methods = TimedeltaArray ._datetimelike_methods + [
48
+ "_box_values" ,
49
+ "__neg__" ,
50
+ "__pos__" ,
51
+ "__abs__" ,
52
+ ]
48
53
_raw_properties = {"components" }
49
54
_raw_methods = {"to_pytimedelta" }
50
55
@@ -56,7 +61,7 @@ class TimedeltaDelegateMixin(DatetimelikeDelegateMixin):
56
61
TimedeltaArray ,
57
62
TimedeltaDelegateMixin ._delegated_methods ,
58
63
typ = "method" ,
59
- overwrite = False ,
64
+ overwrite = True ,
60
65
)
61
66
class TimedeltaIndex (
62
67
DatetimeIndexOpsMixin , dtl .TimelikeOps , Int64Index , TimedeltaDelegateMixin
@@ -279,14 +284,6 @@ def __setstate__(self, state):
279
284
280
285
_unpickle_compat = __setstate__
281
286
282
- def _maybe_update_attributes (self , attrs ):
283
- """ Update Index attributes (e.g. freq) depending on op """
284
- freq = attrs .get ("freq" , None )
285
- if freq is not None :
286
- # no need to infer if freq is None
287
- attrs ["freq" ] = "infer"
288
- return attrs
289
-
290
287
# -------------------------------------------------------------------
291
288
# Rendering Methods
292
289
@@ -689,7 +686,6 @@ def delete(self, loc):
689
686
690
687
691
688
TimedeltaIndex ._add_comparison_ops ()
692
- TimedeltaIndex ._add_numeric_methods_unary ()
693
689
TimedeltaIndex ._add_logical_methods_disabled ()
694
690
TimedeltaIndex ._add_datetimelike_methods ()
695
691
0 commit comments