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:
Stefan van der Walt
2016-03-16 16:50:57 -07:00
parent b9b5fde082
commit 2df22d2fc5
3 changed files with 19 additions and 5 deletions
+6 -1
View File
@@ -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')