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

Function test_min_count_vs_flox

xarray/tests/test_groupby.py:2783–2796  ·  view source on GitHub ↗
(func: str, min_count: int | None, skipna: bool)

Source from the content-addressed store, hash-verified

2781@pytest.mark.parametrize("skipna", [True, False])
2782@pytest.mark.parametrize("min_count", [None, 1])
2783def test_min_count_vs_flox(func: str, min_count: int | None, skipna: bool) -> None:
2784 da = DataArray(
2785 data=np.array([np.nan, 1, 1, np.nan, 1, 1]),
2786 dims="x",
2787 coords={"labels": ("x", np.array([1, 2, 3, 1, 2, 3]))},
2788 )
2789
2790 gb = da.groupby("labels")
2791 method = operator.methodcaller(func, min_count=min_count, skipna=skipna)
2792 with xr.set_options(use_flox=True):
2793 actual = method(gb)
2794 with xr.set_options(use_flox=False):
2795 expected = method(gb)
2796 assert_identical(actual, expected)
2797
2798
2799@pytest.mark.parametrize("use_flox", [True, False])

Callers

nothing calls this directly

Calls 4

groupbyMethod · 0.95
DataArrayClass · 0.90
assert_identicalFunction · 0.90
methodClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…