From d00020c4e4dc1a5decd7271476d0eeba20241bb3 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Thu, 7 Dec 2023 08:46:29 -0500 Subject: [PATCH] bump glue-jupyter which in turn requires a bump to glue-core --- CHANGES.rst | 5 ++++- .../default/plugins/plot_options/plot_options.py | 14 +++----------- pyproject.toml | 4 ++-- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index ddd374c891..bd0bfba40b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -65,7 +65,10 @@ Other Changes and Additions Bug Fixes --------- -- Compatibility with glue-core 1.17. [#2591] +- Compatibility with glue-core 1.17. [#2591, #2595] + +- Fix image layer visibility toggle in plot options. [#2595] + Cubeviz ^^^^^^^ diff --git a/jdaviz/configs/default/plugins/plot_options/plot_options.py b/jdaviz/configs/default/plugins/plot_options/plot_options.py index d2c9dab192..f5ab09951a 100644 --- a/jdaviz/configs/default/plugins/plot_options/plot_options.py +++ b/jdaviz/configs/default/plugins/plot_options/plot_options.py @@ -4,7 +4,6 @@ import matplotlib import numpy as np -from astropy.utils import minversion from astropy.visualization import ( ManualInterval, ContrastBiasStretch, PercentileInterval ) @@ -33,8 +32,6 @@ __all__ = ['PlotOptions'] -GLUE_LT_1_17 = not minversion("glue", "1.17") - class SplineStretch: """ @@ -92,10 +89,7 @@ def update_knots(self, x, y): # Add the spline stretch to the glue stretch registry if not registered if "spline" not in stretches: - if GLUE_LT_1_17: - stretches.add("spline", SplineStretch(), display="Spline") - else: - stretches.add("spline", SplineStretch, display="Spline") + stretches.add("spline", SplineStretch, display="Spline") @tray_registry('g-plot-options', label="Plot Options") @@ -852,10 +846,8 @@ def _update_stretch_curve(self, msg=None): # procedure in glue's CompositeArray: interval = ManualInterval(self.stretch_vmin_value, self.stretch_vmax_value) contrast_bias = ContrastBiasStretch(self.image_contrast_value, self.image_bias_value) - if GLUE_LT_1_17: - stretch = stretches.members[self.stretch_function_value] - else: - stretch = stretches.members[self.stretch_function_value]() + stretch = layer.state.stretch_object + layer_cmap = layer.state.cmap # show the colorbar diff --git a/pyproject.toml b/pyproject.toml index 8cd1f9df83..b09d57ff37 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,8 +12,8 @@ dependencies = [ "traitlets>=5.0.5", "bqplot>=0.12.37", "bqplot-image-gl>=1.4.11", - "glue-core>=1.16.0", - "glue-jupyter>=0.19", + "glue-core>=1.17.1", + "glue-jupyter>=0.20", "echo>=0.5.0", "ipykernel>=6.19.4", "ipyvue>=1.6",