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

Function test_cftimeindex_sub_cftimeindex

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

Source from the content-addressed store, hash-verified

929@requires_cftime
930@pytest.mark.parametrize("calendar", _CFTIME_CALENDARS)
931def test_cftimeindex_sub_cftimeindex(calendar) -> None:
932 a = xr.date_range("2000", periods=5, calendar=calendar, use_cftime=True)
933 b = a.shift(2, "D")
934 result = b - a
935 expected = pd.TimedeltaIndex([timedelta(days=2) for _ in range(5)])
936 assert result.equals(expected)
937 assert isinstance(result, pd.TimedeltaIndex)
938
939
940@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…