MCPcopy
hub / github.com/pydata/xarray / test_weighted_std_equal_weights

Function test_weighted_std_equal_weights

xarray/tests/test_weighted.py:474–485  ·  view source on GitHub ↗
(da, skipna, factor)

Source from the content-addressed store, hash-verified

472@pytest.mark.parametrize("skipna", (True, False))
473@pytest.mark.parametrize("factor", [1, 2, 3.14])
474def 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(

Callers

nothing calls this directly

Calls 4

weightedMethod · 0.95
DataArrayClass · 0.90
assert_equalFunction · 0.90
stdMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…