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

Method test_lazy_load

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

Source from the content-addressed store, hash-verified

5731 assert data.sizes == roundtripped.sizes
5732
5733 def test_lazy_load(self) -> None:
5734 store = InaccessibleVariableDataStore()
5735 create_test_data().dump_to_store(store)
5736
5737 for decode_cf in [True, False]:
5738 ds = open_dataset(store, decode_cf=decode_cf)
5739 with pytest.raises(UnexpectedDataAccess):
5740 ds.load()
5741 with pytest.raises(UnexpectedDataAccess):
5742 _ = ds["var1"].values
5743
5744 # these should not raise UnexpectedDataAccess:
5745 ds.isel(time=10)
5746 ds.isel(time=slice(10), dim1=[0]).isel(dim1=0, dim2=-1)
5747
5748 def test_lazy_load_duck_array(self) -> None:
5749 store = AccessibleAsDuckArrayDataStore()

Callers

nothing calls this directly

Calls 6

create_test_dataFunction · 0.90
open_datasetFunction · 0.90
dump_to_storeMethod · 0.80
loadMethod · 0.45
iselMethod · 0.45

Tested by

no test coverage detected