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

Function test_lazy_corrcov

xarray/tests/test_computation.py:1590–1603  ·  view source on GitHub ↗
(
    n: int, dim: str | None, ddof: int, array_tuples: tuple[xr.DataArray, xr.DataArray]
)

Source from the content-addressed store, hash-verified

1588@pytest.mark.parametrize("dim", [None, "x", "time"])
1589@requires_dask
1590def test_lazy_corrcov(
1591 n: int, dim: str | None, ddof: int, array_tuples: tuple[xr.DataArray, xr.DataArray]
1592) -> None:
1593 # GH 5284
1594 from dask import is_dask_collection
1595
1596 da_a, da_b = array_tuples[n]
1597
1598 with raise_if_dask_computes():
1599 cov = xr.cov(da_a.chunk(), da_b.chunk(), dim=dim, ddof=ddof)
1600 assert is_dask_collection(cov)
1601
1602 corr = xr.corr(da_a.chunk(), da_b.chunk(), dim=dim)
1603 assert is_dask_collection(corr)
1604
1605
1606@pytest.mark.parametrize("ddof", [0, 1])

Callers

nothing calls this directly

Calls 5

raise_if_dask_computesFunction · 0.90
is_dask_collectionFunction · 0.85
covMethod · 0.80
corrMethod · 0.80
chunkMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…