From c61fe51d2f5edd44f4a7be3b81d18840dfca844d Mon Sep 17 00:00:00 2001 From: Nicolas Pinto Date: Tue, 14 Feb 2012 20:08:25 -0500 Subject: [PATCH] DOC: remove nastiness, replace with appropriate doctest directive --- skimage/util/montage.py | 4 +--- skimage/util/shape.py | 15 +++------------ 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/skimage/util/montage.py b/skimage/util/montage.py index a879a0a2..7d9fe5ee 100644 --- a/skimage/util/montage.py +++ b/skimage/util/montage.py @@ -50,13 +50,11 @@ def montage2d(arr_in, fill='mean', rescale_intensity=False): >>> import numpy as np >>> from skimage.util.montage import montage2d >>> arr_in = np.arange(3 * 2 * 2).reshape(3, 2, 2) - >>> print arr_in + >>> print arr_in # doctest: +NORMALIZE_WHITESPACE [[[ 0 1] [ 2 3]] - [[ 4 5] [ 6 7]] - [[ 8 9] [10 11]]] >>> arr_out = montage2d(arr_in) diff --git a/skimage/util/shape.py b/skimage/util/shape.py index 7d796405..fc562ea9 100644 --- a/skimage/util/shape.py +++ b/skimage/util/shape.py @@ -37,22 +37,19 @@ def view_as_blocks(arr_in, block_shape): >>> B[1, 0, 1, 1] 13 >>> A = np.arange(4*4*6).reshape(4,4,6) - >>> A + >>> A # doctest: +NORMALIZE_WHITESPACE array([[[ 0, 1, 2, 3, 4, 5], [ 6, 7, 8, 9, 10, 11], [12, 13, 14, 15, 16, 17], [18, 19, 20, 21, 22, 23]], - [[24, 25, 26, 27, 28, 29], [30, 31, 32, 33, 34, 35], [36, 37, 38, 39, 40, 41], [42, 43, 44, 45, 46, 47]], - [[48, 49, 50, 51, 52, 53], [54, 55, 56, 57, 58, 59], [60, 61, 62, 63, 64, 65], [66, 67, 68, 69, 70, 71]], - [[72, 73, 74, 75, 76, 77], [78, 79, 80, 81, 82, 83], [84, 85, 86, 87, 88, 89], @@ -60,11 +57,9 @@ def view_as_blocks(arr_in, block_shape): >>> B = view_as_blocks(A, block_shape=(1, 2, 2)) >>> B.shape (4, 2, 3, 1, 2, 2) - >>> B[2:, 0, 2] + >>> B[2:, 0, 2] # doctest: +NORMALIZE_WHITESPACE array([[[[52, 53], [58, 59]]], - - [[[76, 77], [82, 83]]]]) """ @@ -166,23 +161,19 @@ def view_as_windows(arr_in, window_shape): >>> B = view_as_windows(A, window_shape) >>> B.shape (2, 2, 4, 3) - >>> B + >>> B # doctest: +NORMALIZE_WHITESPACE array([[[[ 0, 1, 2], [ 4, 5, 6], [ 8, 9, 10], [12, 13, 14]], - [[ 1, 2, 3], [ 5, 6, 7], [ 9, 10, 11], [13, 14, 15]]], - - [[[ 4, 5, 6], [ 8, 9, 10], [12, 13, 14], [16, 17, 18]], - [[ 5, 6, 7], [ 9, 10, 11], [13, 14, 15],