(method: str, expected_array: list[float])
| 2731 | ], |
| 2732 | ) |
| 2733 | def 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 | |
| 2754 | def test_groupby_binary_op_regression() -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…