MCPcopy Index your code
hub / github.com/pydata/xarray / test_weighted_quantile_equal_weights

Function test_weighted_quantile_equal_weights

xarray/tests/test_weighted.py:284–295  ·  view source on GitHub ↗
(
    da: list[float], q: float | tuple[float, ...], skipna: bool, factor: float
)

Source from the content-addressed store, hash-verified

282@pytest.mark.parametrize("skipna", (True, False))
283@pytest.mark.parametrize("factor", [1, 3.14])
284def 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")

Callers

nothing calls this directly

Calls 5

quantileMethod · 0.95
weightedMethod · 0.95
DataArrayClass · 0.90
assert_allcloseFunction · 0.90
quantileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…