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

Method test_groupby_first_last

xarray/tests/test_dask.py:597–612  ·  view source on GitHub ↗
(self, func)

Source from the content-addressed store, hash-verified

595
596 @pytest.mark.parametrize("func", ["first", "last"])
597 def test_groupby_first_last(self, func):
598 method = operator.methodcaller(func)
599 u = self.eager_array
600 v = self.lazy_array
601
602 for coords in [u.coords, v.coords]:
603 coords["ab"] = ("x", ["a", "a", "b", "b"])
604 expected = method(u.groupby("ab"))
605
606 with raise_if_dask_computes():
607 actual = method(v.groupby("ab"))
608 self.assertLazyAndAllClose(expected, actual)
609
610 with raise_if_dask_computes():
611 actual = method(v.groupby("ab"))
612 self.assertLazyAndAllClose(expected, actual)
613
614 def test_reindex(self):
615 u = self.eager_array.assign_coords(y=range(6))

Callers

nothing calls this directly

Calls 4

assertLazyAndAllCloseMethod · 0.95
raise_if_dask_computesFunction · 0.90
methodClass · 0.85
groupbyMethod · 0.45

Tested by

no test coverage detected