From be7154f23dcc64ce28a6c5b91003b0f9eb9d273c Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sun, 25 Jan 2015 15:56:16 -0600 Subject: [PATCH] Skip build on 3.2 Skip doc build on 3.2 Skip doc build on 3.2 Use block literal Fix html make target Revert change to threshold_isodata Fix skimage.novice and thresholding warnings Fix feature.__init__ __all__ Fix generic.py link Doc reference fixes Fix missing class member warnings Add parallelization to the user guide toc Remove unused automodule directives Fix sub_dirs in gallery_index Remove unused file and fix reference to api/api Add missing links to user guide Use pre-output links to images Recover from Juan's doc 'upgrades' --- Makefile | 2 +- doc/ext/plot2rst.py | 3 +- doc/source/conf.py | 1 + doc/source/contents.txt | 7 ---- doc/source/index.txt | 2 +- doc/source/user_guide.txt | 2 ++ doc/source/user_guide/numpy_images.txt | 32 ++++++++++--------- .../user_guide/transforming_image_data.txt | 6 ++-- .../user_guide/tutorial_segmentation.txt | 18 +++++------ skimage/feature/__init__.py | 2 +- skimage/filters/rank/generic.py | 6 ++-- skimage/filters/thresholding.py | 4 +-- tools/travis_script.sh | 4 ++- 13 files changed, 45 insertions(+), 44 deletions(-) delete mode 100644 doc/source/contents.txt diff --git a/Makefile b/Makefile index 270aee98..03712fcf 100644 --- a/Makefile +++ b/Makefile @@ -17,4 +17,4 @@ coverage: html: pip install sphinx - make -C docs html + make -C doc html diff --git a/doc/ext/plot2rst.py b/doc/ext/plot2rst.py index 0b618b3b..99fd9a3f 100644 --- a/doc/ext/plot2rst.py +++ b/doc/ext/plot2rst.py @@ -258,7 +258,8 @@ def write_gallery(gallery_index, src_dir, rst_dir, cfg, depth=0): else: sub_dir_list = src_dir.psplit()[-depth:] sub_dir = Path('/'.join(sub_dir_list) + '/') - gallery_index.write(TOCTREE_TEMPLATE % (sub_dir + '\n '.join(ex_names))) + joiner = '\n %s' % sub_dir + gallery_index.write(TOCTREE_TEMPLATE % (sub_dir + joiner.join(ex_names))) for src_name in examples: diff --git a/doc/source/conf.py b/doc/source/conf.py index c2179b41..94904305 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -251,6 +251,7 @@ latex_use_modindex = False # Numpy extensions # ----------------------------------------------------------------------------- numpydoc_show_class_members = False +numpydoc_class_members_toctree = False # ----------------------------------------------------------------------------- # Plots diff --git a/doc/source/contents.txt b/doc/source/contents.txt deleted file mode 100644 index 250546b0..00000000 --- a/doc/source/contents.txt +++ /dev/null @@ -1,7 +0,0 @@ -Table of Contents -================= - -.. toctree:: - - /api/api - diff --git a/doc/source/index.txt b/doc/source/index.txt index 3c6ff75c..93fb259a 100644 --- a/doc/source/index.txt +++ b/doc/source/index.txt @@ -15,7 +15,7 @@ Sections :hidden: overview - api + api/api api_changes install user_guide diff --git a/doc/source/user_guide.txt b/doc/source/user_guide.txt index 7be3e7a8..197c12cb 100644 --- a/doc/source/user_guide.txt +++ b/doc/source/user_guide.txt @@ -12,3 +12,5 @@ User Guide user_guide/tutorials user_guide/getting_help user_guide/viewer + user_guide/tutorial_parallelization + user_guide/tutorial_segmentation \ No newline at end of file diff --git a/doc/source/user_guide/numpy_images.txt b/doc/source/user_guide/numpy_images.txt index 916c5285..3dab852a 100644 --- a/doc/source/user_guide/numpy_images.txt +++ b/doc/source/user_guide/numpy_images.txt @@ -81,7 +81,7 @@ disk: :: ... (nrows / 2)**2) >>> camera[outer_disk_mask] = 0 -.. image:: ../../_images/plot_camera_numpy_1.png +.. image:: ../auto_examples/images/plot_camera_numpy_1.png :width: 45% :target: ../auto_examples/plot_camera_numpy.html @@ -123,6 +123,8 @@ the grayscale image above: Using a 2D mask on a 2D color image + >>> from skimage import data + >>> cat = data.chelsea() >>> reddish = cat[:, :, 0] > 160 >>> cat[reddish] = [0, 255, 0] >>> plt.imshow(cat) @@ -153,14 +155,14 @@ These conventions are summarized below: .. table:: Dimension name and order conventions in scikit-image -======================== ======================================== -Image type coordinates -======================== ======================================== -2D grayscale (row, col) -2D multichannel (eg. RGB) (row, col, ch) -3D grayscale (pln, row, col) -3D multichannel (pln, row, col, ch) -======================== ======================================== + ========================= ======================================== + Image type coordinates + ========================= ======================================== + 2D grayscale (row, col) + 2D multichannel (eg. RGB) (row, col, ch) + 3D grayscale (pln, row, col) + 3D multichannel (pln, row, col, ch) + ========================= ======================================== Many functions in scikit-image operate on 3D images directly: @@ -248,9 +250,9 @@ We can then supplement the above table as follows: .. table:: Addendum to dimension names and orders in scikit-image -======================== ======================================== -Image type coordinates -======================== ======================================== -2D color video (t, row, col, ch) -3D multichannel video (t, pln, row, col, ch) -======================== ======================================== + ======================== ======================================== + Image type coordinates + ======================== ======================================== + 2D color video (t, row, col, ch) + 3D multichannel video (t, pln, row, col, ch) + ======================== ======================================== diff --git a/doc/source/user_guide/transforming_image_data.txt b/doc/source/user_guide/transforming_image_data.txt index 325017ff..9dfe3139 100644 --- a/doc/source/user_guide/transforming_image_data.txt +++ b/doc/source/user_guide/transforming_image_data.txt @@ -67,7 +67,7 @@ from RGB to grayscale:: array([[ 0.7154]]) -Converting a grayscale image to RGB with :func:`gray2rgb``simply +Converting a grayscale image to RGB with :func:`gray2rgb` simply duplicates the gray values over the three color channels. Painting images with labels @@ -78,7 +78,7 @@ using an array of labels to encode the regions to be represented with the same color. -.. image:: ../../_images/plot_join_segmentations_1.png +.. image: ../auto_examples/images/plot_join_segmentations_1.png :target: ../auto_examples/plot_join_segmentations.html :align: center :width: 80% @@ -159,7 +159,7 @@ image with :func:`equalize_adapthist`, in order to correct for exposure gradients across the image. See the example :ref:`example_plot_equalize.py`. -.. image:: ../../_images/plot_equalize_1.png +.. image:: ../auto_examples/images/plot_equalize_1.png :target: ../auto_examples/plot_equalize.html :align: center :width: 90% diff --git a/doc/source/user_guide/tutorial_segmentation.txt b/doc/source/user_guide/tutorial_segmentation.txt index 0c373062..2cf45374 100644 --- a/doc/source/user_guide/tutorial_segmentation.txt +++ b/doc/source/user_guide/tutorial_segmentation.txt @@ -11,7 +11,7 @@ the coins cannot be done directly from the histogram of grey values, because the background shares enough grey levels with the coins that a thresholding segmentation is not sufficient. -.. image:: ../../_images/plot_coins_segmentation_1.png +.. image:: ../auto_examples/applications/images/plot_coins_segmentation_1.png :target: ../auto_examples/applications/plot_coins_segmentation.html :align: center @@ -26,7 +26,7 @@ Simply thresholding the image leads either to missing significant parts of the coins, or to merging parts of the background with the coins. This is due to the inhomogeneous lighting of the image. -.. image:: ../../_images/plot_coins_segmentation_2.png +.. image:: ../auto_examples/applications/images/plot_coins_segmentation_2.png :target: ../auto_examples/applications/plot_coins_segmentation.html :align: center @@ -53,7 +53,7 @@ boundary of the coins, or inside the coins. >>> from scipy import ndimage >>> fill_coins = ndimage.binary_fill_holes(edges) -.. image:: ../../_images/plot_coins_segmentation_3.png +.. image:: ../auto_examples/applications/images/plot_coins_segmentation_3.png :target: ../auto_examples/applications/plot_coins_segmentation.html :align: center @@ -62,7 +62,7 @@ we fill the inner part of the coins using the ``ndimage.binary_fill_holes`` function, which uses mathematical morphology to fill the holes. -.. image:: ../../_images/plot_coins_segmentation_4.png +.. image:: ../auto_examples/applications/images/plot_coins_segmentation_4.png :target: ../auto_examples/applications/plot_coins_segmentation.html :align: center @@ -83,7 +83,7 @@ has not been segmented correctly at all. The reason is that the contour that we got from the Canny detector was not completely closed, therefore the filling function did not fill the inner part of the coin. -.. image:: ../../_images/plot_coins_segmentation_5.png +.. image:: ../auto_examples/applications/images/plot_coins_segmentation_5.png :target: ../auto_examples/applications/plot_coins_segmentation.html :align: center @@ -128,7 +128,7 @@ separate the coins from the background. and here is the corresponding 2-D plot: -.. image:: ../../_images/plot_coins_segmentation_6.png +.. image:: ../auto_examples/applications/images/plot_coins_segmentation_6.png :target: ../auto_examples/applications/plot_coins_segmentation.html :align: center @@ -139,7 +139,7 @@ extreme parts of the histogram of grey values:: >>> markers[coins < 30] = 1 >>> markers[coins > 150] = 2 -.. image:: ../../_images/plot_coins_segmentation_7.png +.. image:: ../auto_examples/applications/images/plot_coins_segmentation_7.png :target: ../auto_examples/applications/plot_coins_segmentation.html :align: center @@ -148,7 +148,7 @@ Let us now compute the watershed transform:: >>> from skimage.morphology import watershed >>> segmentation = watershed(elevation_map, markers) -.. image:: ../../_images/plot_coins_segmentation_8.png +.. image:: ../auto_examples/applications/images/plot_coins_segmentation_8.png :target: ../auto_examples/applications/plot_coins_segmentation.html :align: center @@ -165,7 +165,7 @@ We can now label all the coins one by one using ``ndimage.label``:: >>> labeled_coins, _ = ndimage.label(segmentation) -.. image:: ../../_images/plot_coins_segmentation_9.png +.. image:: ../auto_examples/applications/images/plot_coins_segmentation_9.png :target: ../auto_examples/applications/plot_coins_segmentation.html :align: center diff --git a/skimage/feature/__init__.py b/skimage/feature/__init__.py index 90bb6e53..518aaef2 100644 --- a/skimage/feature/__init__.py +++ b/skimage/feature/__init__.py @@ -18,7 +18,7 @@ from .util import plot_matches from .blob import blob_dog, blob_log, blob_doh -__all__ = ['canny' +__all__ = ['canny', 'daisy', 'hog', 'greycomatrix', diff --git a/skimage/filters/rank/generic.py b/skimage/filters/rank/generic.py index d444a6a5..467c54ed 100644 --- a/skimage/filters/rank/generic.py +++ b/skimage/filters/rank/generic.py @@ -749,7 +749,7 @@ def tophat(image, selem, out=None, mask=None, shift_x=False, shift_y=False): def noise_filter(image, selem, out=None, mask=None, shift_x=False, shift_y=False): - """Noise feature as described in [Hashimoto12]_. + """Noise feature as described in [1]_. Parameters ---------- @@ -769,7 +769,7 @@ def noise_filter(image, selem, out=None, mask=None, shift_x=False, References ---------- - .. [Hashimoto12] N. Hashimoto et al. Referenceless image quality evaluation + .. [1] N. Hashimoto et al. Referenceless image quality evaluation for whole slide imaging. J Pathol Inform 2012;3:9. Returns @@ -872,7 +872,7 @@ def otsu(image, selem, out=None, mask=None, shift_x=False, shift_y=False): References ---------- - .. [otsu] http://en.wikipedia.org/wiki/Otsu's_method + .. [1] http://en.wikipedia.org/wiki/Otsu's_method Examples -------- diff --git a/skimage/filters/thresholding.py b/skimage/filters/thresholding.py index 00e3763c..e10bca5c 100644 --- a/skimage/filters/thresholding.py +++ b/skimage/filters/thresholding.py @@ -201,8 +201,8 @@ def threshold_isodata(image, nbins=256, return_all=False): Histogram-based threshold, known as Ridler-Calvard method or inter-means. Threshold values returned satisfy the following equality: - ``threshold = (image[image <= threshold].mean() +`` - ``image[image > threshold].mean()) / 2.0`` + `threshold = (image[image <= threshold].mean() +` + `image[image > threshold].mean()) / 2.0` That is, returned thresholds are intensities that separate the image into two groups of pixels, where the threshold intensity is midway between the diff --git a/tools/travis_script.sh b/tools/travis_script.sh index 38e2f72a..3e06413a 100755 --- a/tools/travis_script.sh +++ b/tools/travis_script.sh @@ -6,7 +6,9 @@ nosetests $TEST_ARGS skimage section_end "Test.with.min.requirements" section "Build.docs" -make html +if [[ $TRAVIS_PYTHON_VERSION != 3.2 ]]; then + make html +fi section_end "Build.docs" section "Flake8.test"