Skip to content

Commit

Permalink
Merge pull request #295 from openclimatefix/fix-non-hrv-filename
Browse files Browse the repository at this point in the history
dont remove hrv from file name
  • Loading branch information
peterdudfield authored Sep 24, 2024
2 parents 93f3dd1 + 7e7de3e commit 9c47860
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 @@ -14,7 +14,6 @@ def get_datetime_from_filename(filename: str) -> pd.Timestamp:

filename = filename.replace("iodc_", "")
filename = filename.replace("15_", "")
filename = filename.replace("hrv_", "")
filename = filename.split(".zarr.zip")[0]
date = filename.split("/")[-1]

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 @@ -11,7 +11,7 @@ def test_get_time_from_filename():
assert datetime == pd.Timestamp("2020-06-01 12:05", tz="UTC")

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

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

0 comments on commit 9c47860

Please sign in to comment.