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

Function test_groupby_input_mutation

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

Source from the content-addressed store, hash-verified

209
210
211def 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])

Callers

nothing calls this directly

Calls 4

copyMethod · 0.95
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…