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