(reduction)
| 3168 | @requires_flox_0_9_12 |
| 3169 | @pytest.mark.parametrize("reduction", ["any", "all", "count"]) |
| 3170 | def test_gappy_resample_reductions(reduction): |
| 3171 | # GH8090 |
| 3172 | dates = (("1988-12-01", "1990-11-30"), ("2000-12-01", "2001-11-30")) |
| 3173 | times = [xr.date_range(*d, freq="D") for d in dates] |
| 3174 | |
| 3175 | da = xr.concat( |
| 3176 | [ |
| 3177 | xr.DataArray(np.random.rand(len(t)), coords={"time": t}, dims="time") |
| 3178 | for t in times |
| 3179 | ], |
| 3180 | dim="time", |
| 3181 | ).chunk(time=100) |
| 3182 | |
| 3183 | rs = (da > 0.5).resample(time="YS-DEC") |
| 3184 | method = getattr(rs, reduction) |
| 3185 | with xr.set_options(use_flox=True): |
| 3186 | actual = method(dim="time") |
| 3187 | with xr.set_options(use_flox=False): |
| 3188 | expected = method(dim="time") |
| 3189 | assert_identical(expected, actual) |
| 3190 | |
| 3191 | |
| 3192 | def test_groupby_transpose() -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…