import dascore as dc
from dascore.core.source import ArraySource
from dascore.lazy.recipe import Recipe
recipe = Recipe.from_source(ArraySource.full((3, 2), 1.0))
lazy = dc.Patch(data=recipe, coords={"x": range(3), "y": range(2)},
dims=("x", "y"))
loaded = lazy.load()
assert loaded.attrs.data_id == lazy.attrs.data_id
assert loaded.backend == "numpy" and loaded.load() is loadedload
load(
self ,
)-> ‘Self’
Return the patch with its data read into memory, keeping its id.
A patch whose data are already in memory is handed back as it is. Otherwise its array is read, and every operation pending on it is run, and the result holds that array under the same attrs and data_id: the array read is the one the patch described.