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

Method test_quantile_method

xarray/tests/test_variable.py:1937–1950  ·  view source on GitHub ↗
(self, method, use_dask)

Source from the content-addressed store, hash-verified

1935 "use_dask", [pytest.param(True, marks=requires_dask), False]
1936 )
1937 def test_quantile_method(self, method, use_dask) -> None:
1938 v = Variable(["x", "y"], self.d)
1939 if use_dask:
1940 v = v.chunk({"x": 2})
1941
1942 q = np.array([0.25, 0.5, 0.75])
1943 actual = v.quantile(q, dim="y", method=method)
1944
1945 expected = np.nanquantile(self.d, q, axis=1, method=method)
1946
1947 if use_dask:
1948 assert isinstance(actual.data, dask_array_type)
1949
1950 np.testing.assert_allclose(actual.values, expected)
1951
1952 @pytest.mark.filterwarnings(
1953 "default:The `interpolation` argument to quantile was renamed to `method`:FutureWarning"

Callers

nothing calls this directly

Calls 3

chunkMethod · 0.95
quantileMethod · 0.95
VariableClass · 0.90

Tested by

no test coverage detected