Skip to content

Commit

Permalink
feat: accept only hyphen named categories TDE-985 (#830)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfouquet authored Jan 30, 2024
1 parent 78016f6 commit 26682c8
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions scripts/collection_from_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def main() -> None:
dest="category",
help="Dataset category description",
required=True,
choices=list(DATA_CATEGORIES.keys()) + list(DATA_CATEGORIES.values()),
choices=DATA_CATEGORIES.keys(),
)
parser.add_argument(
"--region",
Expand Down Expand Up @@ -91,17 +91,8 @@ def main() -> None:
for licensor_name in coalesce_multi_single(arguments.licensor_list, arguments.licensor):
providers.append({"name": licensor_name, "roles": [ProviderRole.LICENSOR]})

# category can also be passed as human readable name (e.g. "Aerial Photos")
# Get the corresponding identifier to simplify the process
category = arguments.category
if not DATA_CATEGORIES.get(category):
for key, value in DATA_CATEGORIES.items():
if value == category:
category = key
break

collection_metadata: CollectionMetadata = {
"category": category,
"category": arguments.category,
"region": arguments.region,
"gsd": arguments.gsd,
"start_datetime": arguments.start_date,
Expand Down

0 comments on commit 26682c8

Please sign in to comment.