(da, skipna, factor)
| 472 | @pytest.mark.parametrize("skipna", (True, False)) |
| 473 | @pytest.mark.parametrize("factor", [1, 2, 3.14]) |
| 474 | def test_weighted_std_equal_weights(da, skipna, factor): |
| 475 | # if all weights are equal (!= 0), should yield the same result as std |
| 476 | |
| 477 | da = DataArray(da) |
| 478 | |
| 479 | # all weights as 1. |
| 480 | weights = xr.full_like(da, factor) |
| 481 | |
| 482 | expected = da.std(skipna=skipna) |
| 483 | result = da.weighted(weights).std(skipna=skipna) |
| 484 | |
| 485 | assert_equal(expected, result) |
| 486 | |
| 487 | |
| 488 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected
searching dependent graphs…