(
da: list[float], q: float | tuple[float, ...], skipna: bool, factor: float
)
| 282 | @pytest.mark.parametrize("skipna", (True, False)) |
| 283 | @pytest.mark.parametrize("factor", [1, 3.14]) |
| 284 | def test_weighted_quantile_equal_weights( |
| 285 | da: list[float], q: float | tuple[float, ...], skipna: bool, factor: float |
| 286 | ) -> None: |
| 287 | # if all weights are equal (!= 0), should yield the same result as quantile |
| 288 | |
| 289 | data = DataArray(da) |
| 290 | weights = xr.full_like(data, factor) |
| 291 | |
| 292 | expected = data.quantile(q, skipna=skipna) |
| 293 | result = data.weighted(weights).quantile(q, skipna=skipna) |
| 294 | |
| 295 | assert_allclose(expected, result) |
| 296 | |
| 297 | |
| 298 | @pytest.mark.skip(reason="`method` argument is not currently exposed") |
nothing calls this directly
no test coverage detected
searching dependent graphs…