Skip to content

Commit

Permalink
Merge pull request #314 from openclimatefix/issue/fix-15-mins-download
Browse files Browse the repository at this point in the history
dont remove 15 minutes timestamp
  • Loading branch information
peterdudfield authored Dec 3, 2024
2 parents 5772930 + 4915d59 commit 3f7405b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion satip/filenames.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ def get_datetime_from_filename(filename: str, strip_hrv: bool = False) -> pd.Tim
"""

filename = filename.replace("iodc_", "")
filename = filename.replace("15_", "")

if strip_hrv:
filename = filename.replace("hrv_", "")
Expand Down
4 changes: 2 additions & 2 deletions tests/unit_test/test_filenames.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ def test_get_time_from_filename():
assert datetime == "hrv_202408261815"

datetime = get_datetime_from_filename("folder/15_hrv_202408261815.zarr.zip")
assert datetime == "hrv_202408261815"
assert datetime == "15_hrv_202408261815"

datetime = get_datetime_from_filename("folder/hrv_202408261815.zarr.zip", strip_hrv=True)
assert datetime == pd.Timestamp("2024-08-26 18:15", tz="UTC")

datetime = get_datetime_from_filename("folder/15_hrv_202408261815.zarr.zip", strip_hrv=True)
assert datetime == pd.Timestamp("2024-08-26 18:15", tz="UTC")
assert datetime == "15_202408261815"

0 comments on commit 3f7405b

Please sign in to comment.