From f2ace7536992a2bec24150682958f9ba6bfc82aa Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Thu, 25 Apr 2013 23:13:41 -0500 Subject: [PATCH] Fixes to make doctests pass. --- skimage/exposure/exposure.py | 8 ++++---- skimage/filter/ctmf.py | 2 +- skimage/measure/find_contours.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/skimage/exposure/exposure.py b/skimage/exposure/exposure.py index 10d2427d..6f2066aa 100644 --- a/skimage/exposure/exposure.py +++ b/skimage/exposure/exposure.py @@ -36,11 +36,11 @@ def histogram(image, nbins=256): Examples -------- - >>> camera = skimage.data.camera() - >>> hi = exposure.histogram(camera) - >>> # Plot histogram + >>> from skimage import data + >>> hist = histogram(data.camera()) >>> import matplotlib.pyplot as plt - >>> plt.plot(hi[1], hi[0]) + >>> plt.plot(hist[1], hist[0]) # doctest: +ELLIPSIS + [...] """ # For integer types, histogramming with bincount is more efficient. diff --git a/skimage/filter/ctmf.py b/skimage/filter/ctmf.py index 45c387b5..267c5b6c 100644 --- a/skimage/filter/ctmf.py +++ b/skimage/filter/ctmf.py @@ -46,7 +46,7 @@ def median_filter(image, radius=2, mask=None, percent=50): -------- >>> a = np.ones((5, 5)) >>> a[2, 2] = 10 # introduce outlier - >>> b = filter.median_filter(a) + >>> b = median_filter(a) >>> b[2, 2] # the median filter is good at removing outliers 1.0 ''' diff --git a/skimage/measure/find_contours.py b/skimage/measure/find_contours.py index 4a7a6bbf..68e471ac 100755 --- a/skimage/measure/find_contours.py +++ b/skimage/measure/find_contours.py @@ -103,7 +103,7 @@ def find_contours(array, level, array([[ 1., 0., 0.], [ 0., 0., 0.], [ 0., 0., 0.]]) - >>> measure.find_contours(a, 0.5) + >>> find_contours(a, 0.5) [array([[ 0. , 0.5], [ 0.5, 0. ]])] """