Skip to content

Commit

Permalink
Add check if subset label not in dc subset groups
Browse files Browse the repository at this point in the history
  • Loading branch information
javerbukh committed Mar 21, 2023
1 parent 23bcadc commit 8b3db42
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion jdaviz/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,14 @@ def get_subsets(self, subset_name=None, spectral_only=False,
all_subsets[label] = [reg['region'] for reg in subset_region]
else:
all_subsets[label] = subset_region
return all_subsets[subset_name] if subset_name else all_subsets

all_subset_names = [subset.label for subset in dc.subset_groups]
if subset_name and subset_name in all_subset_names:
return all_subsets[subset_name]
elif subset_name:
raise ValueError(f"{subset_name} not in {all_subset_names}")
else:
return all_subsets

def _remove_duplicate_bounds(self, spec_regions):
regions_no_dups = None
Expand Down

0 comments on commit 8b3db42

Please sign in to comment.