Skip to content

Commit

Permalink
Merge pull request #357 from mwtoews/undo-py35-workaround
Browse files Browse the repository at this point in the history
Revert "Work around a random-bug in Python 3.5"
  • Loading branch information
iainrussell authored Dec 7, 2023
2 parents a1490da + 17aaff9 commit 0206444
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions cfgrib/xarray_to_grib.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,6 @@
"rotated_ll",
"sh",
]
MESSAGE_DEFINITION_KEYS = [
# for the GRIB 2 sample we must set this before setting 'totalNumber'
"productDefinitionTemplateNumber",
# NO IDEA WHAT IS GOING ON HERE: saving regular_ll_msl.grib results in the wrong `paramId`
# unless `units` is set before some other unknown key, this happens at random and only in
# Python 3.5, so it must be linked to dict key stability.
"units",
]


def regular_ll_params(values, min_value=-180.0, max_value=360.0):
Expand Down Expand Up @@ -191,11 +183,6 @@ def make_template_message(merged_grib_keys, template_path=None, sample_name=None
sample_name = detect_sample_name(merged_grib_keys)
template_message = cfmessage.CfMessage.from_sample_name(sample_name)

for key in MESSAGE_DEFINITION_KEYS:
if key in list(merged_grib_keys):
template_message[key] = merged_grib_keys[key]
merged_grib_keys.pop(key)

for key, value in merged_grib_keys.items():
try:
template_message[key] = value
Expand Down

0 comments on commit 0206444

Please sign in to comment.