MCPcopy
hub / github.com/pydata/xarray / test_groupby_math_auto_chunk

Function test_groupby_math_auto_chunk

xarray/tests/test_groupby.py:2814–2826  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2812
2813@requires_dask
2814def test_groupby_math_auto_chunk() -> None:
2815 da = xr.DataArray(
2816 [[1, 2, 3], [1, 2, 3], [1, 2, 3]],
2817 dims=("y", "x"),
2818 coords={"label": ("x", [2, 2, 1])},
2819 )
2820 sub = xr.DataArray(
2821 InaccessibleArray(np.array([1, 2])), dims="label", coords={"label": [1, 2]}
2822 )
2823 chunked = da.chunk(x=1, y=2)
2824 chunked.label.load()
2825 actual = chunked.groupby("label") - sub
2826 assert actual.chunksizes == {"x": (1, 1, 1), "y": (2, 1)}
2827
2828
2829@pytest.mark.parametrize("use_flox", [True, False])

Callers

nothing calls this directly

Calls 4

chunkMethod · 0.95
InaccessibleArrayClass · 0.90
loadMethod · 0.45
groupbyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…