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

Function test_invalid_offset_error

xarray/tests/test_cftimeindex_resample.py:281–285  ·  view source on GitHub ↗
(offset: str | int)

Source from the content-addressed store, hash-verified

279
280@pytest.mark.parametrize("offset", ["foo", "5MS", 10])
281def test_invalid_offset_error(offset: str | int) -> None:
282 cftime_index = xr.date_range("2000", periods=5, use_cftime=True)
283 da_cftime = da(cftime_index)
284 with pytest.raises(ValueError, match="offset must be"):
285 da_cftime.resample(time="2h", offset=offset) # type: ignore[arg-type]
286
287
288def test_timedelta_offset() -> None:

Callers

nothing calls this directly

Calls 2

daFunction · 0.70
resampleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…