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

Method test_groupby_bins_ellipsis

xarray/tests/test_groupby.py:1750–1757  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1748 assert len(array.dim_0) == 4
1749
1750 def test_groupby_bins_ellipsis(self) -> None:
1751 da = xr.DataArray(np.ones((2, 3, 4)))
1752 bins = [-1, 0, 1, 2]
1753 with xr.set_options(use_flox=False):
1754 actual = da.groupby_bins("dim_0", bins).mean(...)
1755 with xr.set_options(use_flox=True):
1756 expected = da.groupby_bins("dim_0", bins).mean(...)
1757 assert_allclose(actual, expected)
1758
1759 @pytest.mark.parametrize("use_flox", [True, False])
1760 def test_groupby_bins_gives_correct_subset(self, use_flox: bool) -> None:

Callers

nothing calls this directly

Calls 3

groupby_binsMethod · 0.95
assert_allcloseFunction · 0.90
meanMethod · 0.45

Tested by

no test coverage detected