Skip to content

Commit

Permalink
Backport PR #2393: fix subset histogram bug in plot options
Browse files Browse the repository at this point in the history
  • Loading branch information
bmorris3 authored and meeseeksmachine committed Aug 25, 2023
1 parent 340c7c8 commit d267458
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 @@ -11,6 +11,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 @@ -6,6 +6,7 @@
from ipywidgets import widget_serialization
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 @@ -570,6 +571,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 d267458

Please sign in to comment.