NOAA-MDL / grib2io

Python interface to the NCEP G2C Library for reading and writing GRIB2 messages.
https://noaa-mdl.github.io/grib2io
MIT License
30 stars 11 forks source link

Set kwargs["_xarray_backend"], an assert to ValueError, removed if. #126

Closed TimothyCera-NOAA closed 8 months ago

TimothyCera-NOAA commented 8 months ago

If not using the xarray backend, in some situations the kwargs["_xarray_backend"] throws a KeyError. Fixed that if not available, setting to False, which is the default.

If opening a GRIB v1 file, there was an AssertionError which is changed to raise an error and offer an error message.

Removed an unnecessary if block that tested for a header which is now done in a loop immediately before.