-
Notifications
You must be signed in to change notification settings - Fork 95
Closed
Description
In the kerchunk.grib2.scan_grib() function, there is a loop when processing the coordinate variables for a message, and there is a try/except block in this loop:
Lines 258 to 267 in a0c4f3b
| try: | |
| x = m.get(coord2) | |
| except eccodes.WrongStepUnitError as e: | |
| logger.warning( | |
| "Ignoring coordinate '%s' for varname '%s', raises: eccodes.WrongStepUnitError(%s)", | |
| coord2, | |
| varName, | |
| e, | |
| ) | |
| continue |
that appears to be intended to skip coordinate variables that produce errors when retrieving the coordinate information with cfgrib (the m object is a cfgrib.cfmessage.CfMessage object). However, exceptions produced in this try block never get caught because cfgrib only ever raises ValueError or AssertionError exceptions (at least with the recent versions of cfgrib).
Should this try block be modified to catch ValueError exceptions instead?
Metadata
Metadata
Assignees
Labels
No labels