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

Function test_cftimeindex_shift

xarray/tests/test_cftimeindex.py:1015–1026  ·  view source on GitHub ↗
(index, freq)

Source from the content-addressed store, hash-verified

1013@requires_cftime
1014@pytest.mark.parametrize("freq", ["D", timedelta(days=1)])
1015def test_cftimeindex_shift(index, freq) -> None:
1016 date_type = index.date_type
1017 expected_dates = [
1018 date_type(1, 1, 3),
1019 date_type(1, 2, 3),
1020 date_type(2, 1, 3),
1021 date_type(2, 2, 3),
1022 ]
1023 expected = CFTimeIndex(expected_dates)
1024 result = index.shift(2, freq)
1025 assert result.equals(expected)
1026 assert isinstance(result, CFTimeIndex)
1027
1028
1029@requires_cftime

Callers

nothing calls this directly

Calls 4

CFTimeIndexClass · 0.90
date_typeFunction · 0.85
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…