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

Function test_indexing_dask_array_scalar

xarray/tests/test_indexing.py:1121–1132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1119
1120@requires_dask
1121def test_indexing_dask_array_scalar() -> None:
1122 # GH4276
1123 import dask.array
1124
1125 a = dask.array.from_array(np.linspace(0.0, 1.0))
1126 da = DataArray(a, dims="x")
1127 x_selector = da.argmax(dim=...)
1128 assert not isinstance(x_selector, DataArray)
1129 with raise_if_dask_computes():
1130 actual = da.isel(x_selector)
1131 expected = da.isel(x=-1)
1132 assert_identical(actual, expected)
1133
1134
1135@requires_dask

Callers

nothing calls this directly

Calls 7

argmaxMethod · 0.95
iselMethod · 0.95
DataArrayClass · 0.90
raise_if_dask_computesFunction · 0.90
assert_identicalFunction · 0.90
linspaceMethod · 0.80
from_arrayMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…