Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 09cf069

Browse files
committed
Simplified test_scatter and tox
1 parent 12e5e0a commit 09cf069

File tree

2 files changed

+3
-21
lines changed

2 files changed

+3
-21
lines changed

src/napari_matplotlib/tests/test_scatter.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import numpy as np
55
import numpy.typing as npt
66
import pytest
7-
from skimage.measure import regionprops_table
87

98
from napari_matplotlib import FeaturesScatterWidget, ScatterWidget
109

@@ -36,21 +35,6 @@ def test_features_scatter_widget_2D(make_napari_viewer, astronaut_data):
3635

3736
viewer.add_image(astronaut_data[0], **astronaut_data[1], name="astronaut")
3837

39-
# make a test label image
40-
label_image = np.zeros((100, 100), dtype=np.uint16)
41-
label_image[10:20, 10:20] = 1
42-
label_image[50:70, 50:70] = 2
43-
label_image * -1
44-
45-
feature_table_1 = regionprops_table(
46-
label_image, properties=("label", "area", "perimeter")
47-
)
48-
feature_table_1["index"] = feature_table_1["label"]
49-
50-
viewer.add_labels(
51-
label_image, name="label+features", features=feature_table_1
52-
)
53-
5438
# make the points data
5539
n_points = 100
5640
np.random.seed(10)
@@ -69,10 +53,8 @@ def test_features_scatter_widget_2D(make_napari_viewer, astronaut_data):
6953
viewer.layers.selection.add(
7054
viewer.layers["points_data"]
7155
) # images need to be selected
72-
x_column = "feature_0"
73-
widget.x_axis_key = x_column
74-
y_column = "feature_1"
75-
widget.y_axis_key = y_column # features need to be set here
56+
widget.x_axis_key = "feature_0"
57+
widget.y_axis_key = "feature_1"
7658

7759
# Select label data and chosen features
7860
# viewer.layers.selection.add(viewer.layers["label+features"])

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ commands =
1919
cp -R {toxinidir}/src/napari_matplotlib/tests/baseline {envdir}/baseline
2020
ls {toxinidir}/src/napari_matplotlib/tests/baseline
2121
python -c 'from skimage import data; data.brain()'
22-
python -m pytest --mpl --mpl-baseline-path={toxinidir}/src/napari_matplotlib/tests/baseline --mpl-generate-summary=html --mpl-results-path={toxinidir}/reports -v --color=yes --cov=napari_matplotlib --cov-report=xml
22+
python -m pytest --mpl --mpl-generate-summary=html --mpl-results-path={toxinidir}/reports -v --color=yes --cov=napari_matplotlib --cov-report=xml

0 commit comments

Comments
 (0)