Skip to content

Commit 149afbd

Browse files
committed
fix fact that when we have standard resolution in dt, we should always set h128 as grid
1 parent caebe82 commit 149afbd

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

polytope_server/common/datasource/polytope.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def change_grids(self, request, config):
130130
# all resolution=standard have h128
131131
if request["resolution"] == "standard":
132132
res = 128
133+
return self.change_config_grid(config, res)
133134

134135
# for activity CMIP6 and experiment hist, all models except ifs-nemo have h512 and ifs-nemo has h1024
135136
if request["activity"] == "cmip6" and request["experiment"] == "hist":
@@ -151,13 +152,17 @@ def change_grids(self, request, config):
151152
# Only assign new resolution if it was changed here
152153
if res:
153154
# Find the mapper transformation
154-
for mappings in config["options"]["axis_config"]:
155-
for sub_mapping in mappings["transformations"]:
156-
if sub_mapping["name"] == "mapper":
157-
sub_mapping["resolution"] = res
155+
self.change_config_grid(config, res)
158156

159157
return config
160158

159+
def change_config_grid(self, config, res):
160+
for mappings in config["options"]["axis_config"]:
161+
for sub_mapping in mappings["transformations"]:
162+
if sub_mapping["name"] == "mapper":
163+
sub_mapping["resolution"] = res
164+
return config
165+
161166
def result(self, request):
162167
logging.info("Getting result")
163168
yield self.output

0 commit comments

Comments
 (0)