From 264bd1d842cb6e4c8df24492ed303c32ab7222e1 Mon Sep 17 00:00:00 2001 From: Marvin Albert Date: Wed, 2 Aug 2023 07:27:20 +0200 Subject: [PATCH] Added missing cupy test mark and fixed cupy threshold (#329) * Added missing cupy test mark * threshold_local: ensure sigma argument is passed as numpy array --- dask_image/ndfilters/_threshold.py | 2 +- tests/test_dask_image/test_ndfilters/test_cupy_threshold.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dask_image/ndfilters/_threshold.py b/dask_image/ndfilters/_threshold.py index c9133a80..88082db4 100644 --- a/dask_image/ndfilters/_threshold.py +++ b/dask_image/ndfilters/_threshold.py @@ -80,7 +80,7 @@ def threshold_local(image, block_size, method='gaussian', offset=0, mode=mode, cval=cval) elif method == 'gaussian': if param is None: - sigma = (da.asarray(block_size, like=image._meta) - 1) / 6.0 + sigma = (np.array(block_size).astype(float) - 1) / 6.0 else: sigma = param thresh_image = _gaussian.gaussian_filter(image, sigma, mode=mode, diff --git a/tests/test_dask_image/test_ndfilters/test_cupy_threshold.py b/tests/test_dask_image/test_ndfilters/test_cupy_threshold.py index 2793796f..7be79f56 100644 --- a/tests/test_dask_image/test_ndfilters/test_cupy_threshold.py +++ b/tests/test_dask_image/test_ndfilters/test_cupy_threshold.py @@ -10,6 +10,7 @@ cupy = pytest.importorskip("cupy", minversion="5.0.0") +@pytest.mark.cupy @pytest.mark.parametrize('block_size', [ 3, [3, 3],