Skip to content

Commit

Permalink
metadata: monkeypatch Undefined to show as empty string (#108)
Browse files Browse the repository at this point in the history
* monkeypatch Undefined to show as empty string
  • Loading branch information
kecnry authored Apr 19, 2024
1 parent 389d4d5 commit a4a822d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
--------------------
Expand Down
7 changes: 7 additions & 0 deletions lcviz/plugins/metadata_viewer/metadata_viewer.py
Original file line number Diff line number Diff line change
@@ -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 '<astropy.io.fits.card.Undefined object at 0x29f5b94d0>'
Undefined.__str__ = lambda x: ''


@tray_registry('lcviz-metadata-viewer', label="Metadata")
class MetadataViewer(MetadataViewer):
"""
Expand Down

0 comments on commit a4a822d

Please sign in to comment.