Skip to content

Commit

Permalink
refactor: rename stac dict variable in ImageryItem.from_file()
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfouquet committed Dec 18, 2024
1 parent 0232744 commit 9ed4faf
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions scripts/stac/imagery/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ def from_file(cls, file_name: str) -> "ImageryItem":
ImageryItem: The new ImageryItem.
"""
file_content = read(file_name)
stac_dict_from_s3 = json.loads(file_content.decode("UTF-8"))
if (bbox := stac_dict_from_s3.get("bbox")) is not None:
stac_dict_from_s3["bbox"] = tuple(bbox)
stac_dict_from_file = json.loads(file_content.decode("UTF-8"))
if (bbox := stac_dict_from_file.get("bbox")) is not None:
stac_dict_from_file["bbox"] = tuple(bbox)
new_item = cls(
id_=stac_dict_from_s3["id"],
stac_asset=stac_dict_from_s3["assets"]["visual"],
stac_processing=stac_dict_from_s3["properties"],
id_=stac_dict_from_file["id"],
stac_asset=stac_dict_from_file["assets"]["visual"],
stac_processing=stac_dict_from_file["properties"],
)
new_item.stac = stac_dict_from_s3
new_item.stac = stac_dict_from_file

return new_item

Expand Down

0 comments on commit 9ed4faf

Please sign in to comment.