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

Function test_weighted_non_DataArray_weights

xarray/tests/test_weighted.py:21–27  ·  view source on GitHub ↗
(as_dataset: bool)

Source from the content-addressed store, hash-verified

19
20@pytest.mark.parametrize("as_dataset", (True, False))
21def test_weighted_non_DataArray_weights(as_dataset: bool) -> None:
22 data: DataArray | Dataset = DataArray([1, 2])
23 if as_dataset:
24 data = data.to_dataset(name="data")
25
26 with pytest.raises(ValueError, match=r"`weights` must be a DataArray"):
27 data.weighted([1, 2]) # type: ignore[arg-type]
28
29
30@pytest.mark.parametrize("as_dataset", (True, False))

Callers

nothing calls this directly

Calls 3

to_datasetMethod · 0.95
weightedMethod · 0.95
DataArrayClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…