Skip to content

Commit

Permalink
fix(deduplicates) : when no assets
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasK committed Feb 13, 2025
1 parent 211c49f commit b6c1447
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions earthdaily/earthdatastore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,7 @@ def datacube(
"eq": cross_calibration_collection
},
},
deduplicate_items=False
)
except Warning:
raise Warning(
Expand Down
9 changes: 5 additions & 4 deletions earthdaily/earthdatastore/_filter_duplicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,14 @@ def _extract_item_metadata(
Tuple of (datetime, footprint)
"""
dt = _parse_datetime(item["properties"]["datetime"])
_first_item = list(item["assets"].keys())[0]
if method == "proj:transform":
any_asset = item.get('assets',{}) != {}
if any_asset and method == 'proj:transform':
_first_item = list(item["assets"].keys())[0]
footprint = tuple(
item["assets"][_first_item].get("proj:transform", item["bbox"])
)
elif method == "bbox":
footprint = tuple(round(bbox, 6) for bbox in item.bbox)
else:
footprint = tuple(round(bbox, 6) for bbox in item['bbox'])
return dt, footprint


Expand Down

0 comments on commit b6c1447

Please sign in to comment.