MCPcopy
hub / github.com/pydata/xarray / __sub__

Method __sub__

xarray/coding/cftimeindex.py:529–542  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

527 return type(self)(other + np.array(self))
528
529 def __sub__(self, other):
530 if _contains_datetime_timedeltas(other):
531 return type(self)(np.array(self) - other)
532 if isinstance(other, pd.TimedeltaIndex):
533 return type(self)(np.array(self) - other.to_pytimedelta())
534 if _contains_cftime_datetimes(np.array(other)):
535 try:
536 return pd.TimedeltaIndex(np.array(self) - np.array(other))
537 except OUT_OF_BOUNDS_TIMEDELTA_ERRORS as err:
538 raise ValueError(
539 "The time difference exceeds the range of values "
540 "that can be expressed at the nanosecond resolution."
541 ) from err
542 return NotImplemented
543
544 def __rsub__(self, other):
545 try:

Callers

nothing calls this directly

Calls 3

typeFunction · 0.85

Tested by

no test coverage detected