Skip to content

Commit

Permalink
ensure that custom params '~' in grib stay as param_id
Browse files Browse the repository at this point in the history
  • Loading branch information
floriankrb committed May 13, 2024
1 parent 794b2d9 commit 54c94fd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/climetlab/readers/grib/codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@ def get(self, name):

if size and size > 1:
return eccodes.codes_get_array(self.handle, name)
return eccodes.codes_get(self.handle, name)
result = eccodes.codes_get(self.handle, name)

if result == "~" and name == "shortName":
return str(self.get("param"))
return result
except eccodes.KeyValueNotFoundError:
return None

Expand Down

0 comments on commit 54c94fd

Please sign in to comment.