(weights, expected)
| 137 | ("weights", "expected"), (([1, 2], 5), ([0, 2], 4), ([0, 0], 0)) |
| 138 | ) |
| 139 | def 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( |
nothing calls this directly
no test coverage detected
searching dependent graphs…