From d538abdb97470cc4f95c32d6a22acb4f85257de2 Mon Sep 17 00:00:00 2001 From: Juan Nunez-Iglesias Date: Thu, 8 Jan 2015 18:25:51 +1100 Subject: [PATCH] Fix order kwarg for some versions of numpy.copy It seems it isn't always a valid kwarg. This bypasses that problem by calling `np.array` directly (which is just what `np.copy` does under the hood anyway). --- skimage/util/arraypad.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skimage/util/arraypad.py b/skimage/util/arraypad.py index cce40dc8..3d9d6533 100644 --- a/skimage/util/arraypad.py +++ b/skimage/util/arraypad.py @@ -1532,7 +1532,7 @@ def crop(ar, crop_width, copy=False, order='K'): crops = _validate_lengths(ar, crop_width) slices = [slice(a, ar.shape[i] - b) for i, (a, b) in enumerate(crops)] if copy: - cropped = np.copy(ar[slices], order=order) + cropped = np.array(ar[slices], order=order, copy=True) else: cropped = ar[slices] return cropped