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

Function test_weighted_sum_no_nan

xarray/tests/test_weighted.py:139–146  ·  view source on GitHub ↗
(weights, expected)

Source from the content-addressed store, hash-verified

137 ("weights", "expected"), (([1, 2], 5), ([0, 2], 4), ([0, 0], 0))
138)
139def test_weighted_sum_no_nan(weights, expected):
140 da = DataArray([1, 2])
141
142 weights = DataArray(weights)
143 result = da.weighted(weights).sum()
144 expected = DataArray(expected)
145
146 assert_equal(expected, result)
147
148
149@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 4

weightedMethod · 0.95
DataArrayClass · 0.90
assert_equalFunction · 0.90
sumMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…