From 137137365c73d266a24b5ccb876e9efec6f3368e Mon Sep 17 00:00:00 2001 From: mathleur Date: Wed, 25 Mar 2026 10:24:19 +0100 Subject: [PATCH] if we allow timespan fix, then only take first param in the pre_path to only list similar params with same timespan --- polytope_server/common/datasource/polytope.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/polytope_server/common/datasource/polytope.py b/polytope_server/common/datasource/polytope.py index d578ac31..46b4fedb 100644 --- a/polytope_server/common/datasource/polytope.py +++ b/polytope_server/common/datasource/polytope.py @@ -45,6 +45,7 @@ def __init__(self, config): self.gh69_fix_grids = config.get("gh69_fix_grids", False) # https://github.com/ecmwf/polytope-server/issues/70 self.gh70_fix_step_ranges = config.get("gh70_fix_step_ranges", False) + self.gh176_fix_timespan = config.get("gh176_fix_timespan", False) self.separate_datetime = config.get("separate_datetime", False) self.obey_schedule = config.get("obey_schedule", False) self.output = None @@ -85,6 +86,9 @@ def retrieve(self, request): if self.gh70_fix_step_ranges: if k == "param": pre_path[k] = v[0] + if self.gh176_fix_timespan: + if k == "param": + pre_path[k] = v[0] if len(v) == 1: v = v[0] pre_path[k] = v