Skip to content

Commit

Permalink
allow change hash for ml operational data
Browse files Browse the repository at this point in the history
  • Loading branch information
mathleur committed Jan 24, 2025
1 parent bcff2d3 commit 1dc193e
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions polytope_server/common/datasource/polytope.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ def retrieve(self, request):

if self.hacky_fix_destine_dt:
self.change_grids(r, polytope_mars_config)
self.change_hash(r, polytope_mars_config)

self.change_hash(r, polytope_mars_config)

polytope_mars = PolytopeMars(
polytope_mars_config,
Expand Down Expand Up @@ -171,15 +172,16 @@ def change_grids(self, request, config):

def change_hash(self, request, config):
# This only holds for extremes dt data
if request.get("dataset", None) == "extremes-dt":
if request["levtype"] == "pl" and "130" in request["param"]:
if request["param"] != "130":
raise ValueError(
"""Parameter 130 is on a different grids than other parameters.
Please request it separately."""
)
hash = "1c409f6b78e87eeaeeb4a7294c28add7"
return self.change_config_grid_hash(config, hash)
if self.hacky_fix_destine_dt:
if request.get("dataset", None) == "extremes-dt":
if request["levtype"] == "pl" and "130" in request["param"]:
if request["param"] != "130":
raise ValueError(
"""Parameter 130 is on a different grids than other parameters.
Please request it separately."""
)
hash = "1c409f6b78e87eeaeeb4a7294c28add7"
return self.change_config_grid_hash(config, hash)

# This only holds for operational data
if request.get("dataset", None) is None:
Expand Down

0 comments on commit 1dc193e

Please sign in to comment.