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

Method test_quantile_skipna

xarray/tests/test_dataset.py:6443–6453  ·  view source on GitHub ↗
(self, skipna, compute_backend)

Source from the content-addressed store, hash-verified

6441 @pytest.mark.parametrize("compute_backend", ["numbagg", None], indirect=True)
6442 @pytest.mark.parametrize("skipna", [True, False])
6443 def test_quantile_skipna(self, skipna, compute_backend) -> None:
6444 q = 0.1
6445 dim = "time"
6446 ds = Dataset({"a": ([dim], np.arange(0, 11))})
6447 ds = ds.where(ds >= 1)
6448
6449 result = ds.quantile(q=q, dim=dim, skipna=skipna)
6450
6451 value = 1.9 if skipna else np.nan
6452 expected = Dataset({"a": value}, coords={"quantile": q})
6453 assert_identical(result, expected)
6454
6455 @pytest.mark.parametrize("method", ["midpoint", "lower"])
6456 def test_quantile_method(self, method) -> None:

Callers

nothing calls this directly

Calls 5

quantileMethod · 0.95
DatasetClass · 0.90
assert_identicalFunction · 0.90
arangeMethod · 0.80
whereMethod · 0.45

Tested by

no test coverage detected