Skip to content

Commit dff870a

Browse files
Raise ValueError when user specifies invalid collection
1 parent a4f2ba5 commit dff870a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/worldcereal/openeo/preprocessing.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,13 @@ def worldcereal_preprocessed_inputs_gfmap(
283283
fetch_type: Optional[FetchType] = FetchType.TILE,
284284
collections: Optional[List[str]] = None,
285285
) -> DataCube:
286+
if not all(
287+
coll in {"sentinel1", "sentinel2", "copernicus", "meteo"}
288+
for coll in collections
289+
):
290+
raise ValueError(
291+
f"Invalid collection name. Choose from {['sentinel1', 'sentinel2', 'copernicus', 'meteo']}"
292+
)
286293
cube_list = []
287294
# Extraction of S2 from GFMAP
288295
s2_data = raw_datacube_S2(

0 commit comments

Comments
 (0)