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

Function test_rollforward

xarray/tests/test_cftime_offsets.py:1001–1014  ·  view source on GitHub ↗
(calendar, offset, initial_date_args, partial_expected_date_args)

Source from the content-addressed store, hash-verified

999 ids=_id_func,
1000)
1001def test_rollforward(calendar, offset, initial_date_args, partial_expected_date_args):
1002 date_type = get_date_type(calendar)
1003 initial = date_type(*initial_date_args)
1004 if isinstance(offset, MonthBegin | QuarterBegin | YearBegin):
1005 expected_date_args = partial_expected_date_args + (1,)
1006 elif isinstance(offset, MonthEnd | QuarterEnd | YearEnd):
1007 reference_args = partial_expected_date_args + (1,)
1008 reference = date_type(*reference_args)
1009 expected_date_args = partial_expected_date_args + (reference.daysinmonth,)
1010 else:
1011 expected_date_args = partial_expected_date_args
1012 expected = date_type(*expected_date_args)
1013 result = offset.rollforward(initial)
1014 assert result == expected
1015
1016
1017@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

get_date_typeFunction · 0.90
date_typeFunction · 0.85
rollforwardMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…