()
| 3361 | |
| 3362 | @requires_dask_ge_2024_08_1 |
| 3363 | def test_shuffle_simple() -> None: |
| 3364 | import dask |
| 3365 | |
| 3366 | da = xr.DataArray( |
| 3367 | dims="x", |
| 3368 | data=dask.array.from_array([1, 2, 3, 4, 5, 6], chunks=2), |
| 3369 | coords={"label": ("x", ["a", "b", "c", "a", "b", "c"])}, |
| 3370 | ) |
| 3371 | actual = da.groupby(label=UniqueGrouper()).shuffle_to_chunks() |
| 3372 | expected = da.isel(x=[0, 3, 1, 4, 2, 5]) |
| 3373 | assert_identical(actual, expected) |
| 3374 | |
| 3375 | with pytest.raises(ValueError): |
| 3376 | da.chunk(x=2, eagerly_load_group=False).groupby("label").shuffle_to_chunks() |
| 3377 | |
| 3378 | |
| 3379 | @requires_dask_ge_2024_08_1 |
nothing calls this directly
no test coverage detected
searching dependent graphs…