Skip to content

Commit

Permalink
fix: filter precisely id and jump unknown dimensions (#239)
Browse files Browse the repository at this point in the history
fix a bug where we would select too many datasets with `--dataset-id` option
fix a bug where download calculation would fail for unknown dimensions
  • Loading branch information
renaudjester authored Dec 3, 2024
1 parent 1c44b37 commit 76b14ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions copernicusmarine/catalogue_parser/catalogue_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def get_dataset_metadata(
dataset_json
)
)
and get_version_and_part_from_full_dataset_id(dataset_item.id)[0]
== dataset_id
]
return _parse_and_sort_dataset_items(dataset_items)

Expand Down
7 changes: 5 additions & 2 deletions copernicusmarine/download_functions/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,14 @@ def get_approximation_size_data_downloaded(
if coordinate_name == "elevation":
coordinate_name = "depth"
temp_dataset["elevation"] = temp_dataset.elevation * (-1)
possible_coordinate_id = [
possible_coordinate_ids = [
coordinate_names
for coordinate_names in COORDINATES_LABEL.values()
if coordinate_name in coordinate_names
][0]
]
if not possible_coordinate_ids:
continue
possible_coordinate_id = possible_coordinate_ids[0]
coordinates = [
coord
for coord in variable.coordinates
Expand Down

0 comments on commit 76b14ab

Please sign in to comment.