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 CI issues and fix colormap validation with numpy 2 #75

Merged
merged 2 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion glue_plotly/common/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def colorscale_info(layer_state, interval, contrast_bias):
unmapped_space = np.linspace(0, 1, 60)
mapped_space = np.linspace(mapped_bounds[0], mapped_bounds[1], 60)
color_space = [cmap(b)[:3] for b in mapped_space]
color_values = [tuple(256 * v for v in p) for p in color_space]
color_values = [tuple(float(256 * v) for v in p) for p in color_space]
colorscale = [[0, 'rgb{0}'.format(color_values[0])]] + \
[[u, 'rgb{0}'.format(c)] for u, c in zip(unmapped_space, color_values)] + \
[[1, 'rgb{0}'.format(color_values[-1])]]
Expand Down
6 changes: 6 additions & 0 deletions glue_plotly/common/tests/test_dendrogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from glue.config import settings
from glue.core import Data
from glue.tests.helpers import make_skipper
from glue_qt.app import GlueApplication
from glue_qt.plugins.dendro_viewer import DendrogramViewer

Expand All @@ -12,6 +13,11 @@
from glue_plotly.common.dendrogram import trace_for_layer, x_axis


NUMPY_LT_2, requires_numpy_lt2 = make_skipper('numpy', version='2.0', skip_if='ge')


# Workaround until for the issue solved in https://github.com/glue-viz/glue-qt/pull/19
@requires_numpy_lt2
class TestDendrogram:

def setup_method(self, method):
Expand Down
6 changes: 6 additions & 0 deletions glue_plotly/html_exporters/qt/tests/test_dendrogram.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os

from glue.core import Data
from glue.tests.helpers import make_skipper

from pytest import importorskip

Expand All @@ -11,6 +12,11 @@
from .test_base import TestQtExporter # noqa: E402


NUMPY_LT_2, requires_numpy_lt2 = make_skipper('numpy', version='2.0', skip_if='ge')


# Workaround until for the issue solved in https://github.com/glue-viz/glue-qt/pull/19
@requires_numpy_lt2
class TestDendrogram(TestQtExporter):

viewer_type = DendrogramViewer
Expand Down