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

Function test_resample_scans

xarray/tests/test_groupby.py:2733–2751  ·  view source on GitHub ↗
(method: str, expected_array: list[float])

Source from the content-addressed store, hash-verified

2731 ],
2732)
2733def test_resample_scans(method: str, expected_array: list[float]) -> None:
2734 ds = xr.Dataset(
2735 {"foo": ("time", [1, 2, 3, 1, 2, np.nan])},
2736 coords={
2737 "time": xr.date_range("01-01-2001", freq="ME", periods=6, use_cftime=False),
2738 },
2739 )
2740 actual = getattr(ds.resample(time="3ME"), method)(dim="time")
2741 expected = xr.Dataset(
2742 {"foo": (("time",), expected_array)},
2743 coords={
2744 "time": xr.date_range("01-01-2001", freq="ME", periods=6, use_cftime=False),
2745 },
2746 )
2747 assert_identical(expected, actual)
2748
2749 actual = getattr(ds.foo.resample(time="3ME"), method)(dim="time")
2750 expected.coords["time"] = ds.time
2751 assert_identical(expected.foo, actual)
2752
2753
2754def test_groupby_binary_op_regression() -> None:

Callers

nothing calls this directly

Calls 2

resampleMethod · 0.95
assert_identicalFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…