Skip to content

Commit

Permalink
fix test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Sep 12, 2024
1 parent 9293060 commit 55c36a8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def _on_add_data_to_viewer(self, msg):
# data already existed in this viewer and display units were already set
return

# this spectral viewer was empty (did not have display units set yet),
# this spectral viewer was empty (did not have display units set yet),˜
# but global selections are available in the plugin,
# so we'll set them to the viewer here
viewer.state.x_display_unit = self.spectral_unit_selected
Expand Down Expand Up @@ -346,7 +346,8 @@ def _handle_attribute_display_unit(self, attr_unit, layers=None):
# DQ layer doesn't play nicely with this attribute
if "DQ" in layer.layer.label or isinstance(layer.layer, GroupedSubset):
continue
elif u.Unit(layer.layer.get_component("flux").units).physical_type != 'surface brightness': # noqa
elif ("flux" in [str(c) for c in layer.layer.components]
and u.Unit(layer.layer.get_component("flux").units).physical_type != 'surface brightness'): # noqa
continue
if hasattr(layer, 'attribute_display_unit'):
layer.attribute_display_unit = attr_unit

0 comments on commit 55c36a8

Please sign in to comment.