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

Function test_groupby_indexvariable

xarray/tests/test_groupby.py:222–230  ·  view source on GitHub ↗
(use_flox: bool)

Source from the content-addressed store, hash-verified

220
221@pytest.mark.parametrize("use_flox", [True, False])
222def test_groupby_indexvariable(use_flox: bool) -> None:
223 # regression test for GH7919
224 array = xr.DataArray([1, 2, 3], [("x", [2, 2, 1])])
225 iv = xr.IndexVariable(dims="x", data=pd.Index(array.x.values))
226 with xr.set_options(use_flox=use_flox):
227 actual = array.groupby(iv).sum()
228 actual = array.groupby(iv).sum()
229 expected = xr.DataArray([3, 3], [("x", [1, 2])])
230 assert_identical(expected, actual)
231
232
233@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

groupbyMethod · 0.95
assert_identicalFunction · 0.90
sumMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…