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

Function test_timedelta_offset

xarray/tests/test_cftimeindex_resample.py:288–297  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

286
287
288def test_timedelta_offset() -> None:
289 timedelta = datetime.timedelta(seconds=5)
290 string = "5s"
291
292 cftime_index = xr.date_range("2000", periods=5, use_cftime=True)
293 da_cftime = da(cftime_index)
294
295 timedelta_result = da_cftime.resample(time="2h", offset=timedelta).mean()
296 string_result = da_cftime.resample(time="2h", offset=string).mean()
297 xr.testing.assert_identical(timedelta_result, string_result)
298
299
300@pytest.mark.parametrize(("option", "value"), [("offset", "5s"), ("origin", "start")])

Callers

nothing calls this directly

Calls 3

daFunction · 0.70
meanMethod · 0.45
resampleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…