Skip to content

Commit

Permalink
exclude subsets from WCS-only layer filter
Browse files Browse the repository at this point in the history
  • Loading branch information
bmorris3 committed Jul 17, 2024
1 parent 23b3edd commit 8511b66
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions jdaviz/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def layer_is_table_data(layer):


def is_wcs_only(layer):
# exclude WCS-only layers from the layer choices:
# identify WCS-only layers, exclude subsets:
if hasattr(layer, 'layer'):
state = layer.layer
elif hasattr(layer, 'data'):
Expand All @@ -250,7 +250,17 @@ def is_wcs_only(layer):
state = layer
else:
raise NotImplementedError
return getattr(state, 'meta', {}).get(_wcs_only_label, False)

is_subset = hasattr(layer, 'subset_state') or hasattr(state, 'subset_state')

return (
# WCS-only layers have a metadata label:
getattr(state, 'meta', {}).get(_wcs_only_label, False) and

# the above logic doesn't exclude 100% of subsets, so here we
# ensure that no subsets make it through the filter:
not is_subset
)


def is_not_wcs_only(layer):
Expand Down

0 comments on commit 8511b66

Please sign in to comment.