Create new expected_warnings helper and some cleanup

Add new helper function for expected warnings during test

Indentation cleanups and avoid skipping doctests if possible.
This commit is contained in:
Steven Silvester
2014-12-23 16:50:18 -06:00
parent 782ba46a4c
commit a4e4e57ba5
7 changed files with 53 additions and 13 deletions
+2 -2
View File
@@ -416,12 +416,12 @@ def label(input, neighbors=None, background=None, return_num=False,
[0 1 0]
[0 0 1]]
>>> from skimage.measure import label
>>> print(label(x, neighbors=4)) # doctest: +SKIP
>>> print(label(x, connectivity=1))
[[0 1 1]
[2 3 1]
[2 2 4]]
>>> print(label(x, neighbors=8)) # doctest: +SKIP
>>> print(label(x, connectivity=2))
[[0 1 1]
[1 0 1]
[1 1 0]]
+4 -4
View File
@@ -473,13 +473,13 @@ def regionprops(label_image, intensity_image=None, cache=True):
>>> from skimage import data, util
>>> from skimage.morphology import label
>>> img = util.img_as_ubyte(data.coins()) > 110
>>> label_img = label(img) # doctest: +SKIP
>>> props = regionprops(label_img) # doctest: +SKIP
>>> label_img = label(img, connectivity=img.ndim)
>>> props = regionprops(label_img)
>>> # centroid of first labeled object
>>> props[0].centroid # doctest: +SKIP
>>> props[0].centroid
(22.729879860483141, 81.912285234465827)
>>> # centroid of first labeled object
>>> props[0]['centroid'] # doctest: +SKIP
>>> props[0]['centroid']
(22.729879860483141, 81.912285234465827)
"""