(da, skipna, factor)
| 169 | @pytest.mark.parametrize("skipna", (True, False)) |
| 170 | @pytest.mark.parametrize("factor", [1, 2, 3.14]) |
| 171 | def test_weighted_mean_equal_weights(da, skipna, factor): |
| 172 | # if all weights are equal (!= 0), should yield the same result as mean |
| 173 | |
| 174 | da = DataArray(da) |
| 175 | |
| 176 | # all weights as 1. |
| 177 | weights = xr.full_like(da, factor) |
| 178 | |
| 179 | expected = da.mean(skipna=skipna) |
| 180 | result = da.weighted(weights).mean(skipna=skipna) |
| 181 | |
| 182 | assert_equal(expected, result) |
| 183 | |
| 184 | |
| 185 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected
searching dependent graphs…