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

Function test_cftimeindex_add_timedeltaindex

xarray/tests/test_cftimeindex.py:820–826  ·  view source on GitHub ↗
(calendar)

Source from the content-addressed store, hash-verified

818@requires_cftime
819@pytest.mark.parametrize("calendar", _CFTIME_CALENDARS)
820def test_cftimeindex_add_timedeltaindex(calendar) -> None:
821 a = xr.date_range("2000", periods=5, calendar=calendar, use_cftime=True)
822 deltas = pd.TimedeltaIndex([timedelta(days=2) for _ in range(5)])
823 result = a + deltas
824 expected = a.shift(2, "D")
825 assert result.equals(expected)
826 assert isinstance(result, CFTimeIndex)
827
828
829@requires_cftime

Callers

nothing calls this directly

Calls 2

shiftMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…