MCPcopy Index your code
hub / github.com/pydata/xarray / __sub__

Method __sub__

xarray/coding/cftime_offsets.py:449–459  ·  view source on GitHub ↗
(self, other: Self)

Source from the content-addressed store, hash-verified

447 return mod_month == 0 and date.day == self._get_offset_day(date)
448
449 def __sub__(self, other: Self) -> Self:
450 if TYPE_CHECKING:
451 import cftime
452 else:
453 cftime = attempt_import("cftime")
454
455 if isinstance(other, cftime.datetime):
456 raise TypeError("Cannot subtract cftime.datetime from offset.")
457 if type(other) is type(self) and other.month == self.month:
458 return type(self)(self.n - other.n, month=self.month)
459 return NotImplemented
460
461 def __mul__(self, other):
462 if isinstance(other, float):

Callers

nothing calls this directly

Calls 2

attempt_importFunction · 0.90
typeFunction · 0.85

Tested by

no test coverage detected