From f03e333245147fbaa878cb387203c8974d981dce Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Wed, 17 Apr 2024 14:21:30 -0400 Subject: [PATCH] monkeypatch Undefined to show as empty string --- lcviz/plugins/metadata_viewer/metadata_viewer.py | 7 +++++++ 1 file changed, 7 insertions(+) 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): """