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

Function test_weighted_quantile_bool

xarray/tests/test_weighted.py:332–341  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

330
331
332def test_weighted_quantile_bool():
333 # https://github.com/pydata/xarray/issues/4074
334 da = DataArray([1, 1])
335 weights = DataArray([True, True])
336 q = 0.5
337
338 expected = DataArray([1], coords={"quantile": [q]}).squeeze()
339 result = da.weighted(weights).quantile(q)
340
341 assert_equal(expected, result)
342
343
344@pytest.mark.parametrize("q", (-1, 1.1, (0.5, 1.1), ((0.2, 0.4), (0.6, 0.8))))

Callers

nothing calls this directly

Calls 5

weightedMethod · 0.95
DataArrayClass · 0.90
assert_equalFunction · 0.90
squeezeMethod · 0.45
quantileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…