You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The gridSpec key is available but disabled. To enable it we have to make ecCodes depend on eckit (turning on the cmake option ENABLE_ECKIT_GEO). This is not ready yet so when you decode the gridSpec key, you get the error code GRIB_NOT_IMPLEMENTED
@shahramn, It comes down to the high level python API in ecCodes, which only returns the specified default value when there is a KeyError. Should not it do the same when the key is not implemented??
defget(self, name, default=None, ktype=None):
"""Get the value of a key Parameters ---------- name: str Name of the key. Can be suffixed with ":str", ":int", or ":float" to request a specific type. default: any, optional Value if the key is not Found, or ``None`` if not specified. ktype: type Request a specific type for the value. Overrides the suffix in ``name``"""try:
returnself._get(name, ktype=ktype)
exceptKeyError:
returndefault
OK. I can change the function to include FunctionNotImplementedError:
def raise_keyerror(name):
"""Make operations on a key raise a KeyError if not found"""
try:
yield
except (eccodes.KeyValueNotFoundError, eccodes.FunctionNotImplementedError):
raise KeyError(name)
What happened?
After updating to the new eccodes
2.41.0
runningresults in a
FunctionNotImplementedError
being raised fromgribapi
. In prior versions, the default was properly used, and returned.What are the steps to reproduce the bug?
With
eccodes==2.41.0
Version
0.13.3
Platform (OS and architecture)
ATOS
Relevant log output
Accompanying data
No response
Organisation
ECMWF
The text was updated successfully, but these errors were encountered: