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

Method test_dask_is_lazy

xarray/tests/test_dataset.py:1374–1393  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1372
1373 @requires_dask
1374 def test_dask_is_lazy(self) -> None:
1375 store = InaccessibleVariableDataStore()
1376 create_test_data().dump_to_store(store)
1377 ds = open_dataset(store).chunk()
1378
1379 with pytest.raises(UnexpectedDataAccess):
1380 ds.load()
1381 with pytest.raises(UnexpectedDataAccess):
1382 _ = ds["var1"].values
1383
1384 # these should not raise UnexpectedDataAccess:
1385 _ = ds.var1.data
1386 ds.isel(time=10)
1387 ds.isel(time=slice(10), dim1=[0]).isel(dim1=0, dim2=-1)
1388 ds.transpose()
1389 ds.mean()
1390 ds.fillna(0)
1391 ds.rename({"dim1": "foobar"})
1392 ds.set_coords("var1")
1393 ds.drop_vars("var1")
1394
1395 def test_isel(self) -> None:
1396 data = create_test_data()

Callers

nothing calls this directly

Calls 13

create_test_dataFunction · 0.90
open_datasetFunction · 0.90
dump_to_storeMethod · 0.80
set_coordsMethod · 0.80
chunkMethod · 0.45
loadMethod · 0.45
iselMethod · 0.45
transposeMethod · 0.45
meanMethod · 0.45
fillnaMethod · 0.45
renameMethod · 0.45

Tested by

no test coverage detected