Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metadata: monkeypatch Undefined to show as empty string #108

Merged
merged 2 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading