MillionConcepts / pdr

[P]lanetary [D]ata [R]eader - A single function to read all Planetary Data System (PDS) data into Python
Other
62 stars 7 forks source link

set the values of metadata keys associated with blank FITS header cards to `None` #58

Closed m-stclair closed 4 months ago

m-stclair commented 5 months ago

When astropy.io.fits is constructing a Header and encounters a card that is defined but has no assigned value, it sets the value of that key to an astropy.io.fits.card.Undefined object. These objects pass in string form into *HEADER MultiDicts constructed from those Headers, and as Undefined objects into pdr.Metadata objects constructed while reading FITS files in "primary" mode. Undefined objects inherit object.__str__ and object.__repr__ and therefore do not have stable string representations. This means that ix cannot generate stable hashes for MultiDicts generated from the headers of FITS files of this type. Also, while basically harmless in normal operation, presenting users with objects of unusual library-specific types is not consistent with pdr's general idiom. We can address these issues by simply replacing Undefined objects with None.

m-stclair commented 5 months ago

addressed by d68b1c7. keeping this open until merged.

m-stclair commented 4 months ago

merged; closing.