MCPcopy Create free account
hub / github.com/pydata/xarray / onOffset

Method onOffset

xarray/coding/cftime_offsets.py:443–447  ·  view source on GitHub ↗

Check if the given date is in the set of possible dates created using a length-one version of this offset class.

(self, date)

Source from the content-addressed store, hash-verified

441 return _shift_month(other, months, self._day_option)
442
443 def onOffset(self, date) -> bool:
444 """Check if the given date is in the set of possible dates created
445 using a length-one version of this offset class."""
446 mod_month = (date.month - self.month) % 3
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:

Callers

nothing calls this directly

Calls 1

_get_offset_dayMethod · 0.80

Tested by

no test coverage detected