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

Method __sub__

xarray/coding/cftime_offsets.py:537–548  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

535 return _shift_month(other, months, self._day_option)
536
537 def __sub__(self, other):
538 if TYPE_CHECKING:
539 import cftime
540 else:
541 cftime = attempt_import("cftime")
542
543 if isinstance(other, cftime.datetime):
544 raise TypeError("Cannot subtract cftime.datetime from offset.")
545 elif type(other) is type(self) and other.month == self.month:
546 return type(self)(self.n - other.n, month=self.month)
547 else:
548 return NotImplemented
549
550 def __mul__(self, other):
551 if isinstance(other, float):

Callers

nothing calls this directly

Calls 2

attempt_importFunction · 0.90
typeFunction · 0.85

Tested by

no test coverage detected