diff --git a/CHANGES.rst b/CHANGES.rst index 8b6883fc..4d0a3a09 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -2,6 +2,7 @@ ------------------ * Support loading, viewing, and slicing through TPF data cubes. [#82] +* Metdata plugin: show undefined entries as empty string instead of object repr. [#108] 0.3.0 - (04-05-2024) -------------------- diff --git a/lcviz/plugins/metadata_viewer/metadata_viewer.py b/lcviz/plugins/metadata_viewer/metadata_viewer.py index 35a4571f..2aeb9886 100644 --- a/lcviz/plugins/metadata_viewer/metadata_viewer.py +++ b/lcviz/plugins/metadata_viewer/metadata_viewer.py @@ -1,9 +1,16 @@ +from astropy.io.fits.card import Undefined + from jdaviz.configs.default.plugins import MetadataViewer from jdaviz.core.registries import tray_registry __all__ = ['MetadataViewer'] +# monkeypatch astropy.io.fits.card.Undefined to show an empty string +# instead of '' +Undefined.__str__ = lambda x: '' + + @tray_registry('lcviz-metadata-viewer', label="Metadata") class MetadataViewer(MetadataViewer): """