@@ -102,7 +102,7 @@ def wrapper(self, other):
102
102
return compat .set_function_name (wrapper , opname , cls )
103
103
104
104
105
- class TimedeltaArrayMixin (dtl .DatetimeLikeArrayMixin , dtl .TimelikeOps ):
105
+ class TimedeltaArray (dtl .DatetimeLikeArrayMixin , dtl .TimelikeOps ):
106
106
_typ = "timedeltaarray"
107
107
_scalar_type = Timedelta
108
108
__array_priority__ = 1000
@@ -348,7 +348,7 @@ def _add_delta(self, delta):
348
348
-------
349
349
result : TimedeltaArray
350
350
"""
351
- new_values = super (TimedeltaArrayMixin , self )._add_delta (delta )
351
+ new_values = super (TimedeltaArray , self )._add_delta (delta )
352
352
return type (self )._from_sequence (new_values , freq = 'infer' )
353
353
354
354
def _add_datetime_arraylike (self , other ):
@@ -357,38 +357,38 @@ def _add_datetime_arraylike(self, other):
357
357
"""
358
358
if isinstance (other , np .ndarray ):
359
359
# At this point we have already checked that dtype is datetime64
360
- from pandas .core .arrays import DatetimeArrayMixin
361
- other = DatetimeArrayMixin (other )
360
+ from pandas .core .arrays import DatetimeArray
361
+ other = DatetimeArray (other )
362
362
363
363
# defer to implementation in DatetimeArray
364
364
return other + self
365
365
366
366
def _add_datetimelike_scalar (self , other ):
367
367
# adding a timedeltaindex to a datetimelike
368
- from pandas .core .arrays import DatetimeArrayMixin
368
+ from pandas .core .arrays import DatetimeArray
369
369
370
370
assert other is not NaT
371
371
other = Timestamp (other )
372
372
if other is NaT :
373
373
# In this case we specifically interpret NaT as a datetime, not
374
374
# the timedelta interpretation we would get by returning self + NaT
375
375
result = self .asi8 .view ('m8[ms]' ) + NaT .to_datetime64 ()
376
- return DatetimeArrayMixin (result )
376
+ return DatetimeArray (result )
377
377
378
378
i8 = self .asi8
379
379
result = checked_add_with_arr (i8 , other .value ,
380
380
arr_mask = self ._isnan )
381
381
result = self ._maybe_mask_results (result )
382
382
dtype = DatetimeTZDtype (tz = other .tz ) if other .tz else _NS_DTYPE
383
- return DatetimeArrayMixin (result , dtype = dtype , freq = self .freq )
383
+ return DatetimeArray (result , dtype = dtype , freq = self .freq )
384
384
385
385
def _addsub_offset_array (self , other , op ):
386
386
# Add or subtract Array-like of DateOffset objects
387
387
try :
388
388
# TimedeltaIndex can only operate with a subset of DateOffset
389
389
# subclasses. Incompatible classes will raise AttributeError,
390
390
# which we re-raise as TypeError
391
- return super (TimedeltaArrayMixin , self )._addsub_offset_array (
391
+ return super (TimedeltaArray , self )._addsub_offset_array (
392
392
other , op
393
393
)
394
394
except AttributeError :
@@ -813,7 +813,7 @@ def f(x):
813
813
return result
814
814
815
815
816
- TimedeltaArrayMixin ._add_comparison_ops ()
816
+ TimedeltaArray ._add_comparison_ops ()
817
817
818
818
819
819
# ---------------------------------------------------------------------
@@ -860,7 +860,7 @@ def sequence_to_td64ns(data, copy=False, unit="ns", errors="raise"):
860
860
data = np .array (data , copy = False )
861
861
elif isinstance (data , ABCSeries ):
862
862
data = data ._values
863
- elif isinstance (data , (ABCTimedeltaIndex , TimedeltaArrayMixin )):
863
+ elif isinstance (data , (ABCTimedeltaIndex , TimedeltaArray )):
864
864
inferred_freq = data .freq
865
865
data = data ._data
866
866
0 commit comments