Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Work around a random-bug in Python 3.5" #357

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading