()
| 209 | |
| 210 | |
| 211 | def test_groupby_input_mutation() -> None: |
| 212 | # regression test for GH2153 |
| 213 | array = xr.DataArray([1, 2, 3], [("x", [2, 2, 1])]) |
| 214 | array_copy = array.copy() |
| 215 | expected = xr.DataArray([3, 3], [("x", [1, 2])]) |
| 216 | actual = array.groupby("x").sum() |
| 217 | assert_identical(expected, actual) |
| 218 | assert_identical(array, array_copy) # should not modify inputs |
| 219 | |
| 220 | |
| 221 | @pytest.mark.parametrize("use_flox", [True, False]) |
nothing calls this directly
no test coverage detected
searching dependent graphs…