smart_geocubes.core.backend
¶
Write specific backends.
Classes:
-
DownloadBackend–Base class for download backends.
DownloadBackend
¶
Bases: ABC
Base class for download backends.
Initialize the ThreadedBackend.
Parameters:
-
(repo¶Repository) –The icechunk repository.
-
(f¶callable[[PatchIndex], Dataset]) –A function that takes a PatchIndex and returns an xr.Dataset. This should be implemented by the specific source backend.
Methods:
-
assert_created–Assert that the datacube exists in the storage.
-
close–Close the backend.
-
loaded_patches–Get a list of all loaded patch ids.
-
open_xarray–Open the xarray datacube in read-only mode.
-
open_zarr–Open the zarr datacube in read-only mode.
-
submit–Submit a patch download request to the backend.
Attributes:
Source code in src/smart_geocubes/core/backend.py
created
property
¶
Check if the datacube already exists in the storage.
Returns:
-
bool(bool) –True if the datacube already exists in the storage.
assert_created
¶
Assert that the datacube exists in the storage.
Raises:
-
FileNotFoundError–If the datacube does not exist.
Source code in src/smart_geocubes/core/backend.py
close
¶
Close the backend.
Returns:
-
bool(bool) –True if the backend was closed successfully, False otherwise.
loaded_patches
¶
Get a list of all loaded patch ids.
Returns:
Source code in src/smart_geocubes/core/backend.py
open_xarray
¶
Open the xarray datacube in read-only mode.
Returns:
-
Dataset–xr.Dataset: The xarray datacube.
Source code in src/smart_geocubes/core/backend.py
open_zarr
¶
Open the zarr datacube in read-only mode.
Returns:
-
Group–zarr.Group: The zarr datacube.
Source code in src/smart_geocubes/core/backend.py
submit
abstractmethod
¶
Submit a patch download request to the backend.
Parameters:
-
(idx¶PatchIndex | list[PatchIndex]) –The index or multiple indices of the patch(es) to download.