Skip to content

Commit

Permalink
limit implementation to specviz
Browse files Browse the repository at this point in the history
* defer issues with syncing axes to image viewer (specviz2d, mosviz), and slice (cubeviz)
  • Loading branch information
kecnry committed Mar 29, 2023
1 parent 4e1b6b2 commit dd329aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
4 changes: 0 additions & 4 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ New Features
Cubeviz
^^^^^^^

* Re-enabled unit conversion support. [#2048]

Imviz
^^^^^

Expand All @@ -25,8 +23,6 @@ Specviz
Specviz2d
^^^^^^^^^

* Re-enabled unit conversion support. [#2048]

API Changes
-----------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ class UnitConversion(PluginTemplateMixin):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

# TODO: support for multiple viewers
# TODO: support for sky coordinate axes?
# TODO: support for z-axes in image viewers
# TODO: slice indicator broken after changing spectral_unit
if self.config not in ['specviz']:
# TODO [specviz2d, mosviz] x_display_unit is not implemented in glue for image viewer used by spectrum-2d-viewer
# TODO [mosviz]: add to yaml file
# TODO [cubeviz, slice]: slice indicator broken after changing spectral_unit
# TODO: support for multiple viewers and handling of mixed state from glue (or does this force all to sync?)
self.disabled_msg = f'This plugin is temporarily disabled in {self.config}. Effort to improve it is being tracked at GitHub Issue 1972.' # noqa

# TODO [markers]: existing markers need converting
self.spectrum_viewer.state.add_callback('x_display_unit',
self._on_glue_x_display_unit_changed)
self.spectrum_viewer.state.add_callback('y_display_unit',
Expand All @@ -54,11 +58,7 @@ def __init__(self, *args, **kwargs):

@property
def user_api(self):
expose = []
if self.config in ['specviz', 'specviz2d', 'cubeviz', 'mosviz']:
expose += ['spectral_unit']
expose += ['flux_unit']
return PluginUserApi(self, expose=expose)
return PluginUserApi(self, expose=('spectral_unit', 'flux_unit'))

def _on_glue_x_display_unit_changed(self, x_unit):
if x_unit is None:
Expand Down

0 comments on commit dd329aa

Please sign in to comment.