You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The "type specifiers" (class xcube.core.store.TypeSpecifier) concept introduced in xcube 0.6 is no longer required in the light of the data cube convention, see #488. It complicates the data store API, where simple data type names are sufficient and less confusing.
Describe the solution you'd like
We can now simply use a parameter data_type: DataTypeLike where type_specifier: str was expected, wIth
DataType = Union[xr.Dataset, xcube.core.multilevel.MultiLevelDataset, gpd.GeoDataFrame, Any] and
DataTypeLike = Union[str, DataType].
Function implementation can use a new utility function normalize_data_type(data_type: DataTypeLike) -> DataType to get the actual type.
When users really need a cube in terms of (time, ..., y, x) dimensions, they use the new dataset’s cube subset function xcube.core.normalize.get_dataset_cube_subset() -> Tuple[xr.Dataset, GridMapping] or simply xr.Dataset.xcube.xcube.to_cube() (the xcube property is an xarray dataset extension), therefore there is no more need to use type specifiers with flags, e.g. "dataset[cube]":
Is your feature request related to a problem? Please describe.
The "type specifiers" (class
xcube.core.store.TypeSpecifier
) concept introduced in xcube 0.6 is no longer required in the light of the data cube convention, see #488. It complicates the data store API, where simple data type names are sufficient and less confusing.Describe the solution you'd like
We can now simply use a parameter
data_type: DataTypeLike
wheretype_specifier: str
was expected, wIthDataType = Union[xr.Dataset, xcube.core.multilevel.MultiLevelDataset, gpd.GeoDataFrame, Any]
andDataTypeLike = Union[str, DataType]
.Function implementation can use a new utility function
normalize_data_type(data_type: DataTypeLike) -> DataType
to get the actual type.When users really need a cube in terms of (time, ..., y, x) dimensions, they use the new dataset’s cube subset function
xcube.core.normalize.get_dataset_cube_subset() -> Tuple[xr.Dataset, GridMapping]
or simplyxr.Dataset.xcube.xcube.to_cube()
(thexcube
property is an xarray dataset extension), therefore there is no more need to use type specifiers with flags, e.g."dataset[cube]"
:Same for multi-level datasets:
Original type specifier names with flags now become simple data type names:
"dataset[cube]"
to"dataset"
or"xarray.Dataset"
"dataset[multilevel]"
and"dataset[multilevel, cube]"
to"ml_dataset"
or"xcube.core.multilevel.MultiLevelDataset"
"geodataframe"
and also"geopandas.GeoDataFrame"
The text was updated successfully, but these errors were encountered: