(da, factor, skipna)
| 122 | @pytest.mark.parametrize("factor", [0, 1, 3.14]) |
| 123 | @pytest.mark.parametrize("skipna", (True, False)) |
| 124 | def test_weighted_sum_equal_weights(da, factor, skipna): |
| 125 | # if all weights are 'f'; weighted sum is f times the ordinary sum |
| 126 | |
| 127 | da = DataArray(da) |
| 128 | weights = xr.full_like(da, factor) |
| 129 | |
| 130 | expected = da.sum(skipna=skipna) * factor |
| 131 | result = da.weighted(weights).sum(skipna=skipna) |
| 132 | |
| 133 | assert_equal(expected, result) |
| 134 | |
| 135 | |
| 136 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected
searching dependent graphs…