Skip to content

Commit

Permalink
Update resolution calculation to account for scatter layers in ipyvol…
Browse files Browse the repository at this point in the history
…ume viewers.
  • Loading branch information
Carifio24 committed Oct 3, 2024
1 parent 543ba63 commit 1f9a0c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion glue_ar/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ def get_resolution(viewer_state: Viewer3DState) -> int:
try:
from glue_jupyter.common.state3d import VolumeViewerState
if isinstance(viewer_state, VolumeViewerState):
return max((getattr(state, 'max_resolution', 256) for state in viewer_state.layers), default=256)
resolutions = tuple(getattr(state, 'max_resolution', None) for state in viewer_state.layers)
return max((res for res in resolutions if res is not None), default=256)

Check warning on line 283 in glue_ar/utils.py

View check run for this annotation

Codecov / codecov/patch

glue_ar/utils.py#L282-L283

Added lines #L282 - L283 were not covered by tests
except ImportError:
pass

Expand Down

0 comments on commit 1f9a0c1

Please sign in to comment.