Skip to content

Commit

Permalink
fix subset histogram update bug in plot options
Browse files Browse the repository at this point in the history
  • Loading branch information
bmorris3 committed Aug 25, 2023
1 parent bbcdcc8 commit b5f4287
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ Bug Fixes
the selection when the choices change if any of the previous entries are still
valid. [#2344]

- Fixed Plot Options stretch histogram bug that raised an error when a spatial subset
was selected in Imviz and Cubeviz. [#2393]

Cubeviz
^^^^^^^

Expand Down
5 changes: 5 additions & 0 deletions jdaviz/configs/default/plugins/plot_options/plot_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from astropy.visualization import PercentileInterval
from traitlets import Any, Dict, Float, Bool, Int, List, Unicode, observe

from glue.core.subset_group import GroupedSubset
from glue.viewers.scatter.state import ScatterViewerState
from glue.viewers.profile.state import ProfileViewerState, ProfileLayerState
from glue.viewers.image.state import ImageSubsetLayerState
Expand Down Expand Up @@ -579,6 +580,10 @@ def _update_stretch_histogram(self, msg={}):
# skip further updates if no data are available:
return

if isinstance(data, GroupedSubset):
# don't update histogram for subsets:
return

comp = data.get_component(data.main_components[0])

# TODO: further optimization could be done by caching sub_data
Expand Down

0 comments on commit b5f4287

Please sign in to comment.