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

Function _adjust_n_years

xarray/coding/cftime_offsets.py:276–284  ·  view source on GitHub ↗

Adjust the number of times an annual offset is applied based on another date, and the reference day provided

(other, n, month, reference_day)

Source from the content-addressed store, hash-verified

274
275
276def _adjust_n_years(other, n, month, reference_day):
277 """Adjust the number of times an annual offset is applied based on
278 another date, and the reference day provided"""
279 if n > 0:
280 if other.month < month or (other.month == month and other.day < reference_day):
281 n -= 1
282 elif other.month > month or (other.month == month and other.day > reference_day):
283 n += 1
284 return n
285
286
287def _shift_month(date, months, day_option: DayOption = "start"):

Callers 1

__apply__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…