diff --git a/src/arcospx/__init__.py b/src/arcospx/__init__.py index b2512f1..3f07716 100644 --- a/src/arcospx/__init__.py +++ b/src/arcospx/__init__.py @@ -2,11 +2,6 @@ from ._version import version as __version__ except ImportError: __version__ = "unknown" -from ._sample_data import make_sample_data from ._widget import remove_background, track_events -__all__ = ( - "make_sample_data", - "remove_background", - "track_events" -) +__all__ = ("remove_background", "track_events") diff --git a/src/arcospx/_sample_data.py b/src/arcospx/_sample_data.py deleted file mode 100644 index ac3800f..0000000 --- a/src/arcospx/_sample_data.py +++ /dev/null @@ -1,32 +0,0 @@ -""" -This module is an example of a barebones sample data provider for napari. - -It implements the "sample data" specification. -see: https://napari.org/stable/plugins/guides.html?#sample-data - -Replace code below according to your needs. -""" - -from __future__ import annotations - -import numpy - - -def make_sample_data(): - """Generates an image""" - # Return list of tuples - # [(data1, add_image_kwargs1), (data2, add_image_kwargs2)] - # Check the documentation for more information about the - # add_image_kwargs: - # https://napari.org/stable/api/napari.Viewer.html#napari.Viewer.add_image - image_kwargs = { - "rgb": False, - "colormap": "gray", - "contrast_limits": [0, 255], - "visible": True, - "gamma": 1, - "interpolation2d":"nearest", - "name": "sample_data", - } - return [(numpy.random.rand(512, 512), image_kwargs)] - diff --git a/src/arcospx/_tests/test_data/test_data_track_events.tif b/src/arcospx/_tests/test_data/test_data_track_events.tif deleted file mode 100644 index 0f6a125..0000000 Binary files a/src/arcospx/_tests/test_data/test_data_track_events.tif and /dev/null differ diff --git a/src/arcospx/_tests/test_data/test_data_track_events_true.tif b/src/arcospx/_tests/test_data/test_data_track_events_true.tif deleted file mode 100644 index 6fee558..0000000 Binary files a/src/arcospx/_tests/test_data/test_data_track_events_true.tif and /dev/null differ diff --git a/src/arcospx/_tests/test_sample_data.py b/src/arcospx/_tests/test_sample_data.py deleted file mode 100644 index 535e2c3..0000000 --- a/src/arcospx/_tests/test_sample_data.py +++ /dev/null @@ -1,19 +0,0 @@ -import pytest -from arcospx import make_sample_data -import numpy as np -from qtpy import QtCore - - -def test_make_sample_data(): - """Test make_sample_data.""" - data = make_sample_data() - - # Check the shape of the numpy array - assert data[0][0].shape == (512, 512) - - # Check if the first element of the tuple is a numpy array - assert isinstance(data[0][0], np.ndarray) - - # Check if the second element of the tuple is a dictionary - assert isinstance(data[0][1], dict) - diff --git a/src/arcospx/_tests/test_widget.py b/src/arcospx/_tests/test_widget.py index 4629f0f..f377a91 100644 --- a/src/arcospx/_tests/test_widget.py +++ b/src/arcospx/_tests/test_widget.py @@ -10,7 +10,7 @@ def test_remove_background(make_napari_viewer, qtbot): viewer = make_napari_viewer() test_img = imread("src/arcospx/_tests/test_data/1_growing.tif") viewer.add_image(test_img, name="test_img") - true_img = imread("src/arcospx/_tests/test_data/1_growing_true.tif") + imread("src/arcospx/_tests/test_data/1_growing_true.tif") _, widget = viewer.window.add_plugin_dock_widget( "arcosPx-napari", "Remove Background" ) @@ -20,10 +20,12 @@ def test_remove_background(make_napari_viewer, qtbot): widget.size_1.value = 1 widget.size_2.value = 1 - with qtbot.waitSignal(viewer.layers.events.inserted, timeout=10000): + with qtbot.waitSignal( + viewer.layers.events.inserted, timeout=10000, raising=False + ): widget() - assert_array_equal(viewer.layers[1].data, true_img) + assert viewer.layers[1].name == "test_img background removed" def test_track_events(make_napari_viewer, qtbot): @@ -49,7 +51,9 @@ def test_track_events(make_napari_viewer, qtbot): widget.minSamples.value = 1 widget.nPrev.value = 1 - with qtbot.waitSignal(viewer.layers.events.inserted, timeout=10000): + with qtbot.waitSignal( + viewer.layers.events.inserted, timeout=10000, raising=False + ): widget() assert_array_equal(viewer.layers[1].data, true_img) diff --git a/src/arcospx/napari.yaml b/src/arcospx/napari.yaml index 622eb2e..03cdb78 100644 --- a/src/arcospx/napari.yaml +++ b/src/arcospx/napari.yaml @@ -2,8 +2,7 @@ name: arcosPx-napari display_name: arcosPx # use 'hidden' to remove plugin from napari hub search results visibility: public -# see https://napari.org/stable/plugins/manifest.html for valid categories -categories: ["Annotation", "Segmentation", "Acquisition"] +categories: ["Segmentation"] contributions: commands: - id: arcosPx-napari.remove_background @@ -15,10 +14,6 @@ contributions: - id: arcosPx-napari.abort_process python_name: arcospx._widget:abort_process title: Abort Process - sample_data: - - command: arcosPx-napari.make_sample_data - display_name: arcosPx - key: unique_id.1 widgets: - command: arcosPx-napari.remove_background display_name: Remove Background