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

Function _adjust_n_months

xarray/coding/cftime_offsets.py:265–273  ·  view source on GitHub ↗

Adjust the number of times a monthly offset is applied based on the day of a given date, and the reference day provided.

(other_day, n, reference_day)

Source from the content-addressed store, hash-verified

263
264
265def _adjust_n_months(other_day, n, reference_day):
266 """Adjust the number of times a monthly offset is applied based
267 on the day of a given date, and the reference day provided.
268 """
269 if n > 0 and other_day < reference_day:
270 n = n - 1
271 elif n <= 0 and other_day > reference_day:
272 n = n + 1
273 return n
274
275
276def _adjust_n_years(other, n, month, reference_day):

Callers 2

__apply__Method · 0.85
__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…