(use_flox: bool)
| 220 | |
| 221 | @pytest.mark.parametrize("use_flox", [True, False]) |
| 222 | def 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( |
nothing calls this directly
no test coverage detected
searching dependent graphs…