Skip to content

Commit

Permalink
Merge branch 'feature/changing_grids_dt' into feature/fix_duplicate_h…
Browse files Browse the repository at this point in the history
…ashes
  • Loading branch information
peshence authored Jan 22, 2025
2 parents 82a16c6 + c40af17 commit 3cabfb7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 26 deletions.
14 changes: 5 additions & 9 deletions polytope_server/common/datasource/coercion.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ class CoercionError(Exception):

class Coercion:

allow_ranges = [
"number",
"step",
"date",
]
allow_lists = ["class", "stream", "type", "expver", "param", "number", "date", "step"]
allow_ranges = ["number", "step", "date", "time"]
allow_lists = ["class", "stream", "type", "expver", "param", "number", "date", "step", "time"]

@staticmethod
def coerce(request: Dict[str, Any]) -> Dict[str, Any]:
Expand Down Expand Up @@ -198,9 +194,9 @@ def coerce_time(value: Any) -> str:
if minute != 0:
raise CoercionError("Invalid time format, expected HHMM or HH.")

# Format time as HHMM
time_str = f"{hour:02d}{minute:02d}"
return time_str
# # Format time as HHMM
# time_str = f"{hour:02d}{minute:02d}"
# return time_str

# Validate hour and minute
if not (0 <= hour <= 23):
Expand Down
16 changes: 8 additions & 8 deletions polytope_server/common/datasource/polytope.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,14 @@ def match(self, request):
if "feature" not in r:
raise Exception("request does not contain key 'feature'")

# Check that there is only one value if required
for k, v in r.items():
if k in self.req_single_keys:
v = [v] if isinstance(v, str) else v
if len(v) > 1:
raise Exception("key '{}' cannot accept a list yet. This feature is planned.".format(k))
elif len(v) == 0:
raise Exception("Expected a value for key {}".format(k))
# # Check that there is only one value if required
# for k, v in r.items():
# if k in self.req_single_keys:
# v = [v] if isinstance(v, str) else v
# if len(v) > 1:
# raise Exception("key '{}' cannot accept a list yet. This feature is planned.".format(k))
# elif len(v) == 0:
# raise Exception("Expected a value for key {}".format(k))

for k, v in self.match_rules.items():
# Check that all required keys exist
Expand Down
24 changes: 15 additions & 9 deletions skaffold.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

apiVersion: skaffold/v4beta10
kind: Config

Expand All @@ -18,8 +17,15 @@ build:
concurrency: 1

tagPolicy:
gitCommit:
ignoreChanges: true
customTemplate:
template: "{{.PREFIX}}{{.GIT_TAG}}"
components:
- name: PREFIX
envTemplate:
template: '{{default "" .PREFIX}}'
- name: GIT_TAG
gitCommit:
ignoreChanges: true

artifacts:

Expand All @@ -28,19 +34,19 @@ build:
docker:
target: polytope-common
buildArgs:
developer_mode: "{{ .developer_mode }}"
developer_mode: '{{ default "false" .developer_mode }}'

# Worker with all clients (FDB, GribJump, MARS C, MARS CPP)
- image: "worker"
docker:
target: worker
buildArgs:
rpm_repo: "{{ .rpm_repo }}"
mars_config_repo: "{{ .mars_config_repo }}"
mars_config_branch: "{{ .mars_config_branch }}"
developer_mode: "{{ .developer_mode }}"
rpm_repo: '{{ .rpm_repo }}'
mars_config_repo: '{{ .mars_config_repo }}'
mars_config_branch: '{{ .mars_config_branch }}'
developer_mode: '{{ .developer_mode }}'
# mars_client_c_version: 6.33.20.2
gribjump_version: 0.8.0
gribjump_version: '{{ default "0.8.0" .gribjump_version }}'
# mars_client_cpp_version: 6.99.3.0
# ecbuild_version: 3.8.2
# eccodes_version: 2.33.1
Expand Down

0 comments on commit 3cabfb7

Please sign in to comment.