mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-08 11:26:12 +08:00
Turn dask into an optional dependency
Dask is not yet packaged on all platforms, so make it optional for now.
This commit is contained in:
@@ -2,11 +2,13 @@ from __future__ import absolute_import
|
||||
|
||||
import numpy as np
|
||||
from numpy.testing import assert_array_almost_equal
|
||||
from numpy.testing.decorators import skipif
|
||||
|
||||
from skimage.filters import threshold_adaptive, gaussian
|
||||
from skimage.util.apply_parallel import apply_parallel
|
||||
from skimage.util.apply_parallel import apply_parallel, dask_available
|
||||
|
||||
|
||||
@skipif(not dask_available)
|
||||
def test_apply_parallel():
|
||||
# data
|
||||
a = np.arange(144).reshape(12, 12).astype(float)
|
||||
@@ -28,6 +30,7 @@ def test_apply_parallel():
|
||||
assert_array_almost_equal(result2, expected2)
|
||||
|
||||
|
||||
@skipif(not dask_available)
|
||||
def test_no_chunks():
|
||||
a = np.ones(1 * 4 * 8 * 9).reshape(1, 4, 8, 9)
|
||||
|
||||
@@ -40,6 +43,7 @@ def test_no_chunks():
|
||||
assert_array_almost_equal(result, expected)
|
||||
|
||||
|
||||
@skipif(not dask_available)
|
||||
def test_apply_parallel_wrap():
|
||||
def wrapped(arr):
|
||||
return gaussian(arr, 1, mode='wrap')
|
||||
@@ -50,6 +54,7 @@ def test_apply_parallel_wrap():
|
||||
assert_array_almost_equal(result, expected)
|
||||
|
||||
|
||||
@skipif(not dask_available)
|
||||
def test_apply_parallel_nearest():
|
||||
def wrapped(arr):
|
||||
return gaussian(arr, 1, mode='nearest')
|
||||
|
||||
Reference in New Issue
Block a user