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

Method rollforward

xarray/coding/cftime_offsets.py:597–602  ·  view source on GitHub ↗

Roll date forward to nearest end of year

(self, date)

Source from the content-addressed store, hash-verified

595 return date.day == date.daysinmonth and date.month == self.month
596
597 def rollforward(self, date):
598 """Roll date forward to nearest end of year"""
599 if self.onOffset(date):
600 return date
601 else:
602 return date + YearEnd(month=self.month)
603
604 def rollback(self, date):
605 """Roll date backward to nearest end of year"""

Callers 2

test_rollforwardFunction · 0.45

Calls 2

onOffsetMethod · 0.95
YearEndClass · 0.85

Tested by 1

test_rollforwardFunction · 0.36