From 17aaff9006126f29360c85445560fd82392be41c Mon Sep 17 00:00:00 2001 From: Mike Taves Date: Tue, 28 Nov 2023 13:46:37 +1300 Subject: [PATCH] Revert "Work around a random-bug in Python 3.5" --- cfgrib/xarray_to_grib.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/cfgrib/xarray_to_grib.py b/cfgrib/xarray_to_grib.py index ef145cca..06e6554f 100644 --- a/cfgrib/xarray_to_grib.py +++ b/cfgrib/xarray_to_grib.py @@ -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): @@ -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