mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-12 12:30:16 +08:00
pep8
This commit is contained in:
@@ -27,7 +27,8 @@ def _get_chunks(shape, ncpu):
|
||||
return tuple(chunks)
|
||||
|
||||
|
||||
def process_chunks(function, array, args=(), kwargs={} chunks=None, depth=0, mode=None):
|
||||
def process_chunks(function, array, args=(), kwargs={}, chunks=None, depth=0,
|
||||
mode=None):
|
||||
"""Map a function in parallel across an array.
|
||||
|
||||
Split an array into possibly overlapping chunks of a given depth and
|
||||
@@ -56,7 +57,7 @@ def process_chunks(function, array, args=(), kwargs={} chunks=None, depth=0, mod
|
||||
a chunk.
|
||||
|
||||
"""
|
||||
if chunks == None:
|
||||
if chunks is None:
|
||||
shape = array.shape
|
||||
ncpu = cpu_count()
|
||||
chunks = _get_chunks(shape, ncpu)
|
||||
|
||||
@@ -4,6 +4,7 @@ from numpy.testing import assert_array_almost_equal
|
||||
from skimage.filters import threshold_adaptive, gaussian_filter
|
||||
from skimage.util import process_chunks
|
||||
|
||||
|
||||
def test_process_chunks():
|
||||
# data
|
||||
a = np.arange(144).reshape(12, 12).astype(float)
|
||||
@@ -31,6 +32,7 @@ def test_process_chunks():
|
||||
|
||||
def test_no_chunks():
|
||||
a = np.ones(1 * 4 * 8 * 9).reshape(1, 4, 8, 9)
|
||||
|
||||
def add_42(arr):
|
||||
return arr + 42
|
||||
|
||||
|
||||
Reference in New Issue
Block a user