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

Function test_min_count_nd

xarray/tests/test_duck_array_ops.py:847–865  ·  view source on GitHub ↗
(dtype, dask, func)

Source from the content-addressed store, hash-verified

845@pytest.mark.parametrize("dask", [False, True])
846@pytest.mark.parametrize("func", ["sum", "prod"])
847def test_min_count_nd(dtype, dask, func):
848 if dask and not has_dask:
849 pytest.skip("requires dask")
850
851 min_count = 3
852 dim_num = 3
853 da = construct_dataarray(dim_num, dtype, contains_nan=True, dask=dask)
854
855 # If using Dask, the function call should be lazy.
856 with raise_if_dask_computes():
857 actual = getattr(da, func)(
858 dim=["x", "y", "z"], skipna=True, min_count=min_count
859 )
860
861 # Supplying all dims is equivalent to supplying `...` or `None`
862 expected = getattr(da, func)(dim=..., skipna=True, min_count=min_count)
863
864 assert_allclose(actual, expected)
865 assert_dask_array(actual, dask)
866
867
868@pytest.mark.parametrize("dask", [False, True])

Callers

nothing calls this directly

Calls 4

raise_if_dask_computesFunction · 0.90
assert_allcloseFunction · 0.90
construct_dataarrayFunction · 0.85
assert_dask_arrayFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…