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

Function test_dask

xarray/tests/test_accessor_str.py:59–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57
58@requires_dask
59def test_dask() -> None:
60 import dask.array as da
61
62 arr = da.from_array(["a", "b", "c"], chunks=-1)
63 xarr = xr.DataArray(arr)
64
65 result = xarr.str.len().compute()
66 expected = xr.DataArray([1, 1, 1])
67 assert result.dtype == expected.dtype
68 assert_equal(result, expected)
69
70
71def test_count(dtype) -> None:

Callers

nothing calls this directly

Calls 4

assert_equalFunction · 0.90
lenMethod · 0.80
from_arrayMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…