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

Function test_cftime

xarray/tests/test_interp.py:752–762  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

750@requires_cftime
751@requires_scipy
752def test_cftime() -> None:
753 times = xr.date_range("2000", periods=24, freq="D", use_cftime=True)
754 da = xr.DataArray(np.arange(24), coords=[times], dims="time")
755
756 times_new = xr.date_range(
757 "2000-01-01T12:00:00", periods=3, freq="D", use_cftime=True
758 )
759 actual = da.interp(time=times_new)
760 expected = xr.DataArray([0.5, 1.5, 2.5], coords=[times_new], dims=["time"])
761
762 assert_allclose(actual, expected)
763
764
765@requires_cftime

Callers

nothing calls this directly

Calls 3

interpMethod · 0.95
assert_allcloseFunction · 0.90
arangeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…