From d2e3f0eea14a6a4d3c4f302937200f0e844b3b7d Mon Sep 17 00:00:00 2001 From: James Frost Date: Wed, 18 Feb 2026 15:52:13 +0000 Subject: [PATCH] Revert "Adds capability to get last time in file for validity time and updates" This reverts commit d77cb8a635a866fdd7741b7dfbd286a6a3ff9956. --- src/CSET/cset_workflow/app/fetch_fcst/bin/fetch_data.py | 4 ++-- tests/workflow_utils/test_fetch_data.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/CSET/cset_workflow/app/fetch_fcst/bin/fetch_data.py b/src/CSET/cset_workflow/app/fetch_fcst/bin/fetch_data.py index aa40b2756..acf999a7c 100644 --- a/src/CSET/cset_workflow/app/fetch_fcst/bin/fetch_data.py +++ b/src/CSET/cset_workflow/app/fetch_fcst/bin/fetch_data.py @@ -217,13 +217,13 @@ def _template_file_path( match date_type: case "validity": date = data_time - while date <= data_time + forecast_length: + while date < data_time + forecast_length: placeholder_times.append(date) date += data_period case "initiation": placeholder_times.append(data_time) lead_time = forecast_offset - while lead_time <= forecast_length: + while lead_time < forecast_length: lead_times.append(lead_time) lead_time += data_period case _: diff --git a/tests/workflow_utils/test_fetch_data.py b/tests/workflow_utils/test_fetch_data.py index f30af2162..f9415bcf5 100644 --- a/tests/workflow_utils/test_fetch_data.py +++ b/tests/workflow_utils/test_fetch_data.py @@ -186,7 +186,6 @@ def test_template_file_path_validity_time(): "/path/2000-01-03.nc", "/path/2000-01-04.nc", "/path/2000-01-05.nc", - "/path/2000-01-06.nc", ] assert actual == expected