From 1cc0f36d1568d1be49f846f7ecd115ea1fbdfa74 Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Sat, 15 Oct 2011 12:44:26 -0400 Subject: [PATCH] Reformat doctests so that tests pass I believe the dtype print out was changed to a string in a recent version of numpy, so this change may actually break the doctest for older versions. --- scikits/image/morphology/watershed.py | 30 +++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/scikits/image/morphology/watershed.py b/scikits/image/morphology/watershed.py index 1065dbd3..5c74374a 100644 --- a/scikits/image/morphology/watershed.py +++ b/scikits/image/morphology/watershed.py @@ -249,32 +249,32 @@ def is_local_maximum(image, labels=None, footprint=None): >>> image[3, 3] = 1 >>> image array([[ 0., 0., 0., 0.], - [ 0., 0., 2., 0.], - [ 0., 0., 0., 0.], - [ 0., 0., 0., 1.]]) + [ 0., 0., 2., 0.], + [ 0., 0., 0., 0.], + [ 0., 0., 0., 1.]]) >>> is_local_maximum(image) array([[ True, False, False, False], - [ True, False, True, False], - [ True, False, False, False], - [ True, True, False, True]], dtype=bool) + [ True, False, True, False], + [ True, False, False, False], + [ True, True, False, True]], dtype='bool') >>> image = np.arange(16).reshape((4, 4)) >>> labels = np.array([[1, 2], [3, 4]]) >>> labels = np.repeat(np.repeat(labels, 2, axis=0), 2, axis=1) >>> labels array([[1, 1, 2, 2], - [1, 1, 2, 2], - [3, 3, 4, 4], - [3, 3, 4, 4]]) + [1, 1, 2, 2], + [3, 3, 4, 4], + [3, 3, 4, 4]]) >>> image array([[ 0, 1, 2, 3], - [ 4, 5, 6, 7], - [ 8, 9, 10, 11], - [12, 13, 14, 15]]) + [ 4, 5, 6, 7], + [ 8, 9, 10, 11], + [12, 13, 14, 15]]) >>> is_local_maximum(image, labels=labels) array([[False, False, False, False], - [False, True, False, True], - [False, False, False, False], - [False, True, False, True]], dtype=bool) + [False, True, False, True], + [False, False, False, False], + [False, True, False, True]], dtype='bool') """ if labels is None: labels = np.ones(image.shape, dtype=np.uint8)