From bd0d47a1830fa23726b60e9295b94fd09d3a8417 Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Sun, 2 Sep 2012 12:23:17 -0400 Subject: [PATCH 1/3] DOC: Turn off numpydoc flag to silence warnings --- doc/source/conf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index 0bc673e6..438aaaf8 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -224,6 +224,8 @@ latex_documents = [ # Make numpydoc to generate plots for example sections #numpydoc_use_plots = True +numpydoc_show_class_members = False + # ----------------------------------------------------------------------------- # Plots # ----------------------------------------------------------------------------- From 8b15656febe96f77276a8ce1b067ec567554228e Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Sun, 2 Sep 2012 12:23:52 -0400 Subject: [PATCH 2/3] Change import to silence import errors in docs. `import skimage` in submodules seems to cause issues with Sphinx autodocs. (Maybe some sort of circular import issue.) Note the `ImportErrors` fixed by this commit don't actually cause sphinx build errors; Sphinx seems to capture the errors, but it's annoyingly noisy, nonetheless. --- skimage/exposure/exposure.py | 4 ++-- skimage/morphology/grey.py | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/skimage/exposure/exposure.py b/skimage/exposure/exposure.py index b0ef45cf..bffe660a 100644 --- a/skimage/exposure/exposure.py +++ b/skimage/exposure/exposure.py @@ -1,6 +1,6 @@ import numpy as np -import skimage +from skimage import img_as_float from skimage.util.dtype import dtype_range @@ -101,7 +101,7 @@ def equalize(image, nbins=256): .. [2] http://en.wikipedia.org/wiki/Histogram_equalization """ - image = skimage.img_as_float(image) + image = img_as_float(image) cdf, bin_centers = cumulative_distribution(image, nbins) out = np.interp(image.flat, bin_centers, cdf) return out.reshape(image.shape) diff --git a/skimage/morphology/grey.py b/skimage/morphology/grey.py index 5ef6b9af..dc34d3d6 100644 --- a/skimage/morphology/grey.py +++ b/skimage/morphology/grey.py @@ -7,7 +7,7 @@ __docformat__ = 'restructuredtext en' import warnings import numpy as np -import skimage +from skimage import img_as_ubyte from . import cmorph @@ -63,8 +63,8 @@ def erosion(image, selem, out=None, shift_x=False, shift_y=False): if image is out: raise NotImplementedError("In-place erosion not supported!") - image = skimage.img_as_ubyte(image) - selem = skimage.img_as_ubyte(selem) + image = img_as_ubyte(image) + selem = img_as_ubyte(selem) return cmorph.erode(image, selem, out=out, shift_x=shift_x, shift_y=shift_y) @@ -115,8 +115,8 @@ def dilation(image, selem, out=None, shift_x=False, shift_y=False): if image is out: raise NotImplementedError("In-place dilation not supported!") - image = skimage.img_as_ubyte(image) - selem = skimage.img_as_ubyte(selem) + image = img_as_ubyte(image) + selem = img_as_ubyte(selem) return cmorph.dilate(image, selem, out=out, shift_x=shift_x, shift_y=shift_y) @@ -262,7 +262,7 @@ def white_tophat(image, selem, out=None): """ if image is out: raise NotImplementedError("Cannot perform white top hat in place.") - image = skimage.img_as_ubyte(image) + image = img_as_ubyte(image) out = opening(image, selem, out=out) out = image - out @@ -312,7 +312,7 @@ def black_tophat(image, selem, out=None): if image is out: raise NotImplementedError("Cannot perform white top hat in place.") - image = skimage.img_as_ubyte(image) + image = img_as_ubyte(image) out = closing(image, selem, out=out) out = out - image From 12c35908c90a2fe80ffa8f2e34f020ffa65aa966 Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Sun, 2 Sep 2012 12:32:14 -0400 Subject: [PATCH 3/3] DOC: Separate config sections in conf.py --- doc/source/conf.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 438aaaf8..cb22e6f0 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -221,9 +221,6 @@ latex_documents = [ # ----------------------------------------------------------------------------- # Numpy extensions # ----------------------------------------------------------------------------- -# Make numpydoc to generate plots for example sections -#numpydoc_use_plots = True - numpydoc_show_class_members = False # ----------------------------------------------------------------------------- @@ -259,7 +256,9 @@ plot2rst_index_name = 'README' plot2rst_rcparams = {'image.cmap' : 'gray', 'image.interpolation' : 'none'} - +# ----------------------------------------------------------------------------- +# intersphinx +# ----------------------------------------------------------------------------- _python_doc_base = 'http://docs.python.org/2.7' intersphinx_mapping = { _python_doc_base: None,