Skip to content

Commit 7d20cf2

Browse files
committed
allows handling transforms in polytope datasource which don't match the request
1 parent 1a881ec commit 7d20cf2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

polytope_server/common/datasource/polytope.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,18 @@ def retrieve(self, request):
7070
polytope_mars_config = copy.deepcopy(self.config)
7171
polytope_mars_config["options"]["pre_path"] = pre_path
7272

73+
transforms = []
74+
for transform in polytope_mars_config["options"]["axis_config"]:
75+
if transform["axis_name"] in r.keys():
76+
logging.info("Found axis {} in request".format(transform["axis_name"]))
77+
transforms.append(transform)
78+
if transform["axis_name"] in ("latitude", "longitude", "values"):
79+
transforms.append(transform)
80+
81+
82+
polytope_mars_config["options"]["axis_config"] = transforms
83+
84+
7385

7486
polytope_mars = PolytopeMars(
7587
polytope_mars_config,

0 commit comments

Comments
 (0)