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

Function test_weighted_sum_of_weights_no_nan

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

Source from the content-addressed store, hash-verified

83 (([1, 2], 3), ([2, 0], 2), ([0, 0], np.nan), ([-1, 1], np.nan)),
84)
85def test_weighted_sum_of_weights_no_nan(weights, expected):
86 da = DataArray([1, 2])
87 weights = DataArray(weights)
88 result = da.weighted(weights).sum_of_weights()
89
90 expected = DataArray(expected)
91
92 assert_equal(expected, result)
93
94
95@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 4

weightedMethod · 0.95
DataArrayClass · 0.90
assert_equalFunction · 0.90
sum_of_weightsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…