Skip to content

Commit

Permalink
add API test
Browse files Browse the repository at this point in the history
  • Loading branch information
gibsongreen committed Oct 24, 2024
1 parent fc62e99 commit 43b2123
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ def test_mosviz_profile_view_mouseover(specviz2d_helper, spectrum2d):
viewer = specviz2d_helper.app.get_viewer("spectrum-viewer")
plg = specviz2d_helper.plugins["Unit Conversion"]

# make sure we don't expose angle, sb, nor spectral-y units when native
# units are in flux
assert hasattr(plg, 'flux_unit')
assert not hasattr(plg, 'angle_unit')
assert not hasattr(plg, 'sb_unit')
assert not hasattr(plg, 'spectral_y_type')

label_mouseover = specviz2d_helper.app.session.application._tools['g-coords-info']
label_mouseover._viewer_mouse_event(viewer,
{'event': 'mousemove',
Expand Down
4 changes: 0 additions & 4 deletions jdaviz/core/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,6 @@ def _handle_display_units(self, data, use_display_units=True):

else:
new_uncert = None
if ('_pixel_scale_factor' in data.meta):
new_y = flux_conversion(data.flux.value, data.flux.unit,
y_unit, spec=data) * u.Unit(y_unit)
else:
new_y = flux_conversion(data.flux.value, data.flux.unit,
y_unit, spec=data) * u.Unit(y_unit)
new_spec = (spectral_axis_conversion(data.spectral_axis.value,
Expand Down

0 comments on commit 43b2123

Please sign in to comment.