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

Function test_dask_da_groupby_quantile

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

Source from the content-addressed store, hash-verified

292
293@requires_dask
294def test_dask_da_groupby_quantile() -> None:
295 # Scalar quantile
296 expected = xr.DataArray(
297 data=[2, 5], coords={"x": [1, 2], "quantile": 0.5}, dims="x"
298 )
299 array = xr.DataArray(
300 data=[1, 2, 3, 4, 5, 6], coords={"x": [1, 1, 1, 2, 2, 2]}, dims="x"
301 )
302
303 # will work blockwise with flox
304 actual = array.chunk(x=3).groupby("x").quantile(0.5)
305 assert_identical(expected, actual)
306
307 # will work blockwise with flox
308 actual = array.chunk(x=-1).groupby("x").quantile(0.5)
309 assert_identical(expected, actual)
310
311
312@requires_dask

Callers

nothing calls this directly

Calls 4

chunkMethod · 0.95
assert_identicalFunction · 0.90
quantileMethod · 0.45
groupbyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…