Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug that caused incompatible subsets to be rendered in some contexts rather than be hidden #2425

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions glue/viewers/image/layer_artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,17 +238,19 @@ def __call__(self, bounds):
if (self.layer_artist is None or
self.layer_state is None or
self.viewer_state is None):
return np.broadcast_to(np.nan, self.shape)
return None

# We should compute the mask even if the layer is not visible as we need
# the layer to show up properly when it is made visible (which doesn't
# trigger __getitem__)
# trigger __getitem__). However, if the layer is disabled, then we will
# call this method when it is enabled, so in this case we just return
# an empty mask.

try:
mask = self.layer_state.get_sliced_data(bounds=bounds)
except IncompatibleAttribute:
self.layer_artist.disable_incompatible_subset()
return np.broadcast_to(np.nan, self.shape)
return None
else:
self.layer_artist.enable(redraw=False)

Expand Down