From 4cfec880b68962647638b6dd16439b2d01433114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jostein=20B=C3=B8=20Fl=C3=B8ystad?= Date: Mon, 15 Jul 2013 17:44:17 +0200 Subject: [PATCH] unwrap: Small style-like fixes. Based on comments by ahojnnes. --- skimage/exposure/unwrap.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/skimage/exposure/unwrap.py b/skimage/exposure/unwrap.py index b9c099e0..e4d112bd 100644 --- a/skimage/exposure/unwrap.py +++ b/skimage/exposure/unwrap.py @@ -46,7 +46,7 @@ def unwrap(image, wrap_around=False): wrap_around = [wrap_around] * image.ndim elif (hasattr(wrap_around, '__getitem__') and not isinstance(wrap_around, string_types)): - if not len(wrap_around) == image.ndim: + if len(wrap_around) != image.ndim: raise ValueError('Length of wrap_around must equal the ' 'dimensionality of image') wrap_around = [bool(wa) for wa in wrap_around] @@ -57,9 +57,9 @@ def unwrap(image, wrap_around=False): if np.ma.isMaskedArray(image): mask = np.require(image.mask, np.uint8, ['C']) else: - mask = np.zeros(image.shape, dtype=np.uint8, order='C') + mask = np.zeros_like(image, dtype=np.uint8, order='C') image_not_masked = np.asarray(image, dtype=np.float32, order='C') - image_unwrapped = np.empty(image.shape, dtype=np.float32) + image_unwrapped = np.empty_like(image, dtype=np.float32, order='C') if image.ndim == 2: unwrap_2d(image_not_masked, mask, image_unwrapped,