From ed3a877415386c0d1c40ee63228153a68f77f8a7 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Tue, 3 Dec 2024 12:24:43 +0000 Subject: [PATCH 1/2] dont remove 15 minutes timestamp --- satip/filenames.py | 1 - 1 file changed, 1 deletion(-) diff --git a/satip/filenames.py b/satip/filenames.py index cf7341aa..c8b1bda1 100644 --- a/satip/filenames.py +++ b/satip/filenames.py @@ -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_", "") From 4915d590dd914b5c61a900011046cb507de74806 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Tue, 3 Dec 2024 13:17:39 +0000 Subject: [PATCH 2/2] fix tests --- tests/unit_test/test_filenames.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit_test/test_filenames.py b/tests/unit_test/test_filenames.py index 5af00fd7..b08cfc2e 100644 --- a/tests/unit_test/test_filenames.py +++ b/tests/unit_test/test_filenames.py @@ -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"