-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added regression test for bug that caused image viewer to turn green …
…when an incompatible subset was present
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import numpy as np | ||
|
||
from glue_jupyter import jglue | ||
from glue_jupyter.tests.helpers import visual_widget_test | ||
|
||
|
||
@visual_widget_test | ||
def test_visual_incompatible_subset( | ||
tmp_path, | ||
page_session, | ||
solara_test, | ||
): | ||
|
||
# Regression test for a bug that caused incompatible subsets | ||
# to make the whole image green. | ||
|
||
np.random.seed(12345) | ||
im = np.random.random((64, 64)) | ||
x = np.random.normal(3, 1, 100) | ||
y = np.random.normal(2, 1.5, 100) | ||
|
||
app = jglue() | ||
data1 = app.add_data(image={"image": im})[0] | ||
data2 = app.add_data(catalog={"x": x, "y": y})[0] | ||
scatter = app.imshow(data=data1, show=False) | ||
state1 = data1.pixel_component_ids[1] > 32 | ||
app.data_collection.new_subset_group('image[x] > 32', state1) | ||
state2 = data2.id['x'] > 1 | ||
app.data_collection.new_subset_group('x > 1', state2) | ||
figure = scatter.figure_widget | ||
figure.layout = {"width": "400px", "height": "250px"} | ||
return figure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"glue_jupyter.bqplot.scatter.tests.test_visual.test_visual_scatter2d[chromium]": "edd4e65c87369bc6e403f45e87d914223bc13f42c2f90a55535614923e233c00", | ||
"glue_jupyter.bqplot.scatter.tests.test_visual.test_visual_scatter2d_density[chromium]": "60f38b822f89603874cd508e0c320db92185129631dd89a58624dd667eb8a5a7" | ||
"glue_jupyter.bqplot.scatter.tests.test_visual.test_visual_incompatible_subset[chromium]": "60f38b822f89603874cd508e0c320db92185129631dd89a58624dd667eb8a5a7" | ||
} |