From fa226ad807233eeea987913c59cf951147bdacbb Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sat, 7 Feb 2015 10:30:22 -0600 Subject: [PATCH] Update the README with some warning hints Update the readme with some warning hints Tweak README Tweak README Fix preferred plugins test Pep8 fix Remove imshow from PIL plugin Fix spelling Tweak readme --- doc/README.md | 13 +++++++++++++ skimage/io/_plugins/pil_plugin.py | 17 ----------------- skimage/io/tests/test_plugin.py | 9 ++++++--- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/doc/README.md b/doc/README.md index 48e26788..015693e1 100644 --- a/doc/README.md +++ b/doc/README.md @@ -3,3 +3,16 @@ To build docs, run `make` in this directory. `make help` lists all targets. ## Requirements ## Sphinx is needed to build doc. Install with `pip install sphinx`. + +## Fixing Warnings ## + +- "citation not found: R###" + $ cd doc/build; grep -rin R### . + There is probably an underscore after the reference (e.g. [1]_) + +- "Duplicate citation R###, other instance in..."" + There is probably a [2] without a [1] in one of + the docstrings + +- Make sure to use pre-sphinxification paths to images + (not the _images directory) diff --git a/skimage/io/_plugins/pil_plugin.py b/skimage/io/_plugins/pil_plugin.py index e2108145..db58c3ba 100644 --- a/skimage/io/_plugins/pil_plugin.py +++ b/skimage/io/_plugins/pil_plugin.py @@ -260,20 +260,3 @@ def imsave(fname, arr, format_str=None): img = ndarray_to_pil(arr, format_str=format_str) img.save(fname, format=format_str) - - -def imshow(arr): - """Display an image, using PIL's default display command. - - Parameters - ---------- - arr : ndarray - Image to display. Images of dtype float are assumed to be in - [0, 1]. Images of dtype uint8 are in [0, 255]. - - """ - Image.fromarray(img_as_ubyte(arr)).show() - - -def _app_show(): - pass diff --git a/skimage/io/tests/test_plugin.py b/skimage/io/tests/test_plugin.py index 117e5ab9..00dd5b15 100644 --- a/skimage/io/tests/test_plugin.py +++ b/skimage/io/tests/test_plugin.py @@ -93,15 +93,18 @@ def test_available(): def test_load_preferred_plugins_all(): - from skimage.io._plugins import pil_plugin + from skimage.io._plugins import pil_plugin, matplotlib_plugin with protect_preferred_plugins(): - manage_plugins.preferred_plugins = {'all': ['pil']} + manage_plugins.preferred_plugins = {'all': ['pil'], + 'imshow': ['matplotlib']} manage_plugins.reset_plugins() - for plugin_type in ('imread', 'imsave', 'imshow'): + for plugin_type in ('imread', 'imsave'): plug, func = manage_plugins.plugin_store[plugin_type][0] assert func == getattr(pil_plugin, plugin_type) + plug, func = manage_plugins.plugin_store['imshow'][0] + assert func == getattr(matplotlib_plugin, 'imshow') def test_load_preferred_plugins_imread():