DOC: remove <BLANKLINE> nastiness, replace with appropriate doctest directive

This commit is contained in:
Nicolas Pinto
2012-02-14 20:08:25 -05:00
parent ac54f6969e
commit c61fe51d2f
2 changed files with 4 additions and 15 deletions
+1 -3
View File
@@ -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]]
<BLANKLINE>
[[ 4 5]
[ 6 7]]
<BLANKLINE>
[[ 8 9]
[10 11]]]
>>> arr_out = montage2d(arr_in)
+3 -12
View File
@@ -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]],
<BLANKLINE>
[[24, 25, 26, 27, 28, 29],
[30, 31, 32, 33, 34, 35],
[36, 37, 38, 39, 40, 41],
[42, 43, 44, 45, 46, 47]],
<BLANKLINE>
[[48, 49, 50, 51, 52, 53],
[54, 55, 56, 57, 58, 59],
[60, 61, 62, 63, 64, 65],
[66, 67, 68, 69, 70, 71]],
<BLANKLINE>
[[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]]],
<BLANKLINE>
<BLANKLINE>
[[[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]],
<BLANKLINE>
[[ 1, 2, 3],
[ 5, 6, 7],
[ 9, 10, 11],
[13, 14, 15]]],
<BLANKLINE>
<BLANKLINE>
[[[ 4, 5, 6],
[ 8, 9, 10],
[12, 13, 14],
[16, 17, 18]],
<BLANKLINE>
[[ 5, 6, 7],
[ 9, 10, 11],
[13, 14, 15],