-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-Authored-By: Marcelo Zoccoler <[email protected]>
- Loading branch information
1 parent
308134b
commit 91f6d16
Showing
3 changed files
with
149 additions
and
2 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
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
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,8 +1,27 @@ | ||
from napari_matplotlib import HistogramWidget | ||
from napari_matplotlib import HistogramWidget, FeaturesHistogramWidget | ||
|
||
|
||
def test_example_q_widget(make_napari_viewer, image_data): | ||
# Smoke test adding a histogram widget | ||
viewer = make_napari_viewer() | ||
viewer.add_image(image_data[0], **image_data[1]) | ||
HistogramWidget(viewer) | ||
|
||
def test_feature_histogram(make_napari_viewer): | ||
|
||
import numpy as np | ||
|
||
n_points = 1000 | ||
random_points = np.random.random((n_points,3))*10 | ||
feature1 = np.random.random(n_points) | ||
feature2 = np.random.normal(size=n_points) | ||
|
||
viewer = make_napari_viewer() | ||
viewer.add_points(random_points, properties={'feature1': feature1, 'feature2': feature2}, face_color='feature1', size=1) | ||
|
||
widget = FeaturesHistogramWidget(viewer) | ||
viewer.window.add_dock_widget(widget) | ||
widget._set_axis_keys('feature1') | ||
widget._key_selection_widget() | ||
widget._set_axis_keys('feature2') | ||
widget._key_selection_widget() |