Skip to content

Commit

Permalink
fix: minor changes to be consistent with current data (#790)
Browse files Browse the repository at this point in the history
  • Loading branch information
MDavidson17 authored Dec 21, 2023
1 parent 5c18471 commit 4892b6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions scripts/stac/imagery/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def _title(self) -> str:
if self.title_metadata["start_datetime"].year == self.title_metadata["end_datetime"].year:
date = str(self.title_metadata["start_datetime"].year)
else:
date = f"{self.title_metadata['start_datetime'].year} - {self.title_metadata['end_datetime'].year}"
date = f"{self.title_metadata['start_datetime'].year}-{self.title_metadata['end_datetime'].year}"

# determine dataset name
if location:
Expand All @@ -223,7 +223,7 @@ def _title(self) -> str:

# determine if dataset is preview
if self.title_metadata.get("lifecycle") == "preview":
preview = "- preview"
preview = "- Preview"
else:
preview = None

Expand Down Expand Up @@ -268,7 +268,7 @@ def _description(self) -> str:
if self.title_metadata["start_datetime"].year == self.title_metadata["end_datetime"].year:
date = str(self.title_metadata["start_datetime"].year)
else:
date = f"{self.title_metadata['start_datetime'].year} - {self.title_metadata['end_datetime'].year}"
date = f"{self.title_metadata['start_datetime'].year}-{self.title_metadata['end_datetime'].year}"

# format location for metadata description
if location:
Expand Down
4 changes: 2 additions & 2 deletions scripts/stac/tests/generate_title_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_generate_title_long_date(metadata: Tuple[CollectionTitleMetadata, Colle
metadata_auck, _ = metadata
metadata_auck["end_datetime"] = datetime(2024, 1, 1)
collection = ImageryCollection(metadata_auck)
title = "Auckland 0.3m Rural Aerial Photos (2023 - 2024)"
title = "Auckland 0.3m Rural Aerial Photos (2023-2024)"
assert collection.stac["title"] == title


Expand Down Expand Up @@ -121,7 +121,7 @@ def test_generate_dsm_title_preview(metadata: Tuple[CollectionTitleMetadata, Col
metadata_auck["category"] = "DSM"
metadata_auck["lifecycle"] = "preview"
collection = ImageryCollection(metadata_auck)
title = "Auckland LiDAR 0.3m DSM (2023) - preview"
title = "Auckland LiDAR 0.3m DSM (2023) - Preview"
assert collection.stac["title"] == title


Expand Down

0 comments on commit 4892b6b

Please sign in to comment.