From 1f9a0c100103b04a26c2f345939f94961c2ff524 Mon Sep 17 00:00:00 2001 From: Carifio24 Date: Thu, 3 Oct 2024 12:45:18 -0400 Subject: [PATCH] Update resolution calculation to account for scatter layers in ipyvolume viewers. --- glue_ar/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/glue_ar/utils.py b/glue_ar/utils.py index 6c21c36..62d43e6 100644 --- a/glue_ar/utils.py +++ b/glue_ar/utils.py @@ -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) except ImportError: pass