grib2io icon indicating copy to clipboard operation
grib2io copied to clipboard

Problem in bitmap test ?

Open alcoat opened this issue 10 months ago • 1 comments

https://github.com/NOAA-MDL/grib2io/blob/f1643e3a84bc8d740481fd72ccef9a440c64220a/src/grib2io/_grib2io.py#L922 Shouldn't this line check that bitmap attribute is None ? The bitmap attribute may always exists as it is set to None in the post_init function https://github.com/NOAA-MDL/grib2io/blob/f1643e3a84bc8d740481fd72ccef9a440c64220a/src/grib2io/_grib2io.py#L716

alcoat avatar Apr 23 '24 15:04 alcoat

The fix remove the bitmap attribute assignment and delete it when flush is called if it has been assigned

alcoat avatar Apr 26 '24 07:04 alcoat

Thanks for reporting. It is the desire to always have bitmap attribute to exist. It was an oversight to still use hasattr() for the bitmap.

EricEngle-NOAA avatar Jun 03 '24 15:06 EricEngle-NOAA

The file has been changed since my first patch : now, the line to change is : https://github.com/NOAA-MDL/grib2io/blob/master/src/grib2io/_grib2io.py#L928 with a check to None of the bitmap attribute.

alcoat avatar Jun 03 '24 16:06 alcoat