(weights, expected)
| 447 | ("weights", "expected"), (([4, 6], 0), ([1, 0], np.nan), ([0, 0], np.nan)) |
| 448 | ) |
| 449 | def test_weighted_var_nan(weights, expected): |
| 450 | da = DataArray([np.nan, 2]) |
| 451 | weights = DataArray(weights) |
| 452 | expected = DataArray(expected) |
| 453 | |
| 454 | result = da.weighted(weights).var() |
| 455 | |
| 456 | assert_equal(expected, result) |
| 457 | |
| 458 | |
| 459 | def test_weighted_var_bool(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…