We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
skimage.test does not execute the unit test
## Description

`skimage.test` does not run the unit tests.  

```
~$ python -c "import skimage; print(skimage.__version__); skimage.test()"
0.14.0
====================================================================== test session starts ======================================================================
platform linux -- Python 3.6.5, pytest-3.6.1, py-1.5.3, pluggy-0.6.0
rootdir: /home/jhelmus, inifile:

================================================================= no tests ran in 0.00 seconds ==================================================================
ERROR: file not found: skimage
```

<details><summary>Environment Details</summary>

```
$ conda info

     active environment : sktest
    active env location : /home/jhelmus/anaconda3/envs/sktest
            shell level : 1
       user config file : /home/jhelmus/.condarc
 populated config files : /home/jhelmus/.condarc
          conda version : 4.5.4
    conda-build version : 3.9.1
         python version : 3.6.4.final.0
       base environment : /home/jhelmus/anaconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/linux-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/pro/linux-64
                          https://repo.anaconda.com/pkgs/pro/noarch
          package cache : /home/jhelmus/anaconda3/pkgs
                          /home/jhelmus/.conda/pkgs
       envs directories : /home/jhelmus/anaconda3/envs
                          /home/jhelmus/.conda/envs
               platform : linux-64
             user-agent : conda/4.5.4 requests/2.18.4 CPython/3.6.4 Linux/4.13.0-41-generic ubuntu/16.04 glibc/2.23
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False
$ conda create -n sktest python=3.6 pip
Solving environment: done

## Package Plan ##

  environment location: /home/jhelmus/anaconda3/envs/sktest

  added / updated specs: 
    - pip
    - python=3.6


The following NEW packages will be INSTALLED:

    ca-certificates: 2018.03.07-0            defaults
    certifi:         2018.4.16-py36_0        defaults
    libedit:         3.1.20170329-h6b74fdf_2 defaults
    libffi:          3.2.1-hd88cf55_4        defaults
    libgcc-ng:       7.2.0-hdf63c60_3        defaults
    libstdcxx-ng:    7.2.0-hdf63c60_3        defaults
    ncurses:         6.1-hf484d3e_0          defaults
    openssl:         1.0.2o-h20670df_0       defaults
    pip:             10.0.1-py36_0           defaults
    python:          3.6.5-hc3d631a_2        defaults
    readline:        7.0-ha6073c6_4          defaults
    setuptools:      39.2.0-py36_0           defaults
    sqlite:          3.23.1-he433501_0       defaults
    tk:              8.6.7-hc745277_3        defaults
    wheel:           0.31.1-py36_0           defaults
    xz:              5.2.4-h14c3975_4        defaults
    zlib:            1.2.11-ha838bed_2       defaults

Proceed ([y]/n)? y
...
$ pip install scikit-image
Collecting scikit-image
  Using cached https://files.pythonhosted.org/packages/34/79/cefff573a53ca3fb4c390739d19541b95f371e24d2990aed4cd8837971f0/scikit_image-0.14.0-cp36-cp36m-manylinux1_x86_64.whl
...
Successfully installed PyWavelets-0.5.2 cloudpickle-0.5.3 cycler-0.10.0 dask-0.17.5 decorator-4.3.0 kiwisolver-1.0.1 matplotlib-2.2.2 networkx-2.1 numpy-1.14.3 pillow-5.1.0 pyparsing-2.2.0 python-dateutil-2.7.3 pytz-2018.4 scikit-image-0.14.0 scipy-1.1.0 six-1.11.0 toolz-0.9.0
$ pip install pytest
Collecting pytest
  Using cached https://files.pythonhosted.org/packages/d3/75/e79b66c9fe6166a90004bb8fb02bab06213c3348e93f3be41d7eaf625554/pytest-3.6.1-py2.py3-none-any.whl
Collecting pluggy<0.7,>=0.5 (from pytest)
...
Successfully installed atomicwrites-1.1.5 attrs-18.1.0 more-itertools-4.2.0 pluggy-0.6.0 py-1.5.3 pytest-3.6.1
```

</details>


## Way to reproduce

- [x] Code example
- [ ] Relevant images (if any)
- [x] Operating system and version
- [x] Python version
- [x] scikit-image version (run `skimage.__version__`)

This has been observed on conda-forge, see conda-forge/scikit-image-feedstock#23


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `skimage/__init__.py`
Content:
```
1 """Image Processing SciKit (Toolbox for SciPy)
2 
3 ``scikit-image`` (a.k.a. ``skimage``) is a collection of algorithms for image
4 processing and computer vision.
5 
6 The main package of ``skimage`` only provides a few utilities for converting
7 between image data types; for most features, you need to import one of the
8 following subpackages:
9 
10 Subpackages
11 -----------
12 color
13     Color space conversion.
14 data
15     Test images and example data.
16 draw
17     Drawing primitives (lines, text, etc.) that operate on NumPy arrays.
18 exposure
19     Image intensity adjustment, e.g., histogram equalization, etc.
20 feature
21     Feature detection and extraction, e.g., texture analysis corners, etc.
22 filters
23     Sharpening, edge finding, rank filters, thresholding, etc.
24 graph
25     Graph-theoretic operations, e.g., shortest paths.
26 io
27     Reading, saving, and displaying images and video.
28 measure
29     Measurement of image properties, e.g., similarity and contours.
30 morphology
31     Morphological operations, e.g., opening or skeletonization.
32 novice
33     Simplified interface for teaching purposes.
34 restoration
35     Restoration algorithms, e.g., deconvolution algorithms, denoising, etc.
36 segmentation
37     Partitioning an image into multiple regions.
38 transform
39     Geometric and other transforms, e.g., rotation or the Radon transform.
40 util
41     Generic utilities.
42 viewer
43     A simple graphical user interface for visualizing results and exploring
44     parameters.
45 
46 Utility Functions
47 -----------------
48 img_as_float
49     Convert an image to floating point format, with values in [0, 1].
50 img_as_uint
51     Convert an image to unsigned integer format, with values in [0, 65535].
52 img_as_int
53     Convert an image to signed integer format, with values in [-32768, 32767].
54 img_as_ubyte
55     Convert an image to unsigned byte format, with values in [0, 255].
56 
57 """
58 
59 import os.path as osp
60 import imp
61 import functools
62 import warnings
63 import sys
64 
65 pkg_dir = osp.abspath(osp.dirname(__file__))
66 data_dir = osp.join(pkg_dir, 'data')
67 
68 __version__ = '0.15dev'
69 
70 
71 if sys.version_info < (3,):
72     raise ImportError("""
73 
74 You are running scikit-image on Python 2.
75 
76 Unfortunately, scikit-image 0.15 and above no longer work on this
77 version of Python.  You therefore have two options: either upgrade to
78 Python 3, or install an older version of scikit-image using
79 
80  $ pip install 'scikit-image<0.15'
81 
82 Please also consider updating `pip` and `setuptools`:
83 
84  $ pip install pip setuptools --upgrade
85 
86 Newer versions of these tools avoid installing packages incompatible
87 with your version of Python.
88 """)
89 
90 
91 try:
92     imp.find_module('pytest')
93 except ImportError:
94     def _test(doctest=False, verbose=False):
95         """This would run all unit tests, but pytest couldn't be
96         imported so the test suite can not run.
97         """
98         raise ImportError("Could not load pytest. Unit tests not available.")
99 
100 else:
101     def _test(doctest=False, verbose=False):
102         """Run all unit tests."""
103         import pytest
104         import warnings
105         args = ['skimage']
106         if verbose:
107             args.extend(['-v', '-s'])
108         if doctest:
109             args.extend(['--doctest-modules'])
110             # Make sure warnings do not break the doc tests
111             with warnings.catch_warnings():
112                 warnings.simplefilter("ignore")
113                 success = pytest.main(args)
114         else:
115             success = pytest.main(args)
116         # Return sys.exit code
117         if success:
118             return 0
119         else:
120             return 1
121 
122 
123 # do not use `test` as function name as this leads to a recursion problem with
124 # the nose test suite
125 test = _test
126 test_verbose = functools.partial(test, verbose=True)
127 test_verbose.__doc__ = test.__doc__
128 doctest = functools.partial(test, doctest=True)
129 doctest.__doc__ = doctest.__doc__
130 doctest_verbose = functools.partial(test, doctest=True, verbose=True)
131 doctest_verbose.__doc__ = doctest.__doc__
132 
133 
134 # Logic for checking for improper install and importing while in the source
135 # tree when package has not been installed inplace.
136 # Code adapted from scikit-learn's __check_build module.
137 _INPLACE_MSG = """
138 It appears that you are importing a local scikit-image source tree. For
139 this, you need to have an inplace install. Maybe you are in the source
140 directory and you need to try from another location."""
141 
142 _STANDARD_MSG = """
143 Your install of scikit-image appears to be broken.
144 Try re-installing the package following the instructions at:
145 http://scikit-image.org/docs/stable/install.html """
146 
147 
148 def _raise_build_error(e):
149     # Raise a comprehensible error
150     local_dir = osp.split(__file__)[0]
151     msg = _STANDARD_MSG
152     if local_dir == "skimage":
153         # Picking up the local install: this will work only if the
154         # install is an 'inplace build'
155         msg = _INPLACE_MSG
156     raise ImportError("""%s
157 It seems that scikit-image has not been built correctly.
158 %s""" % (e, msg))
159 
160 try:
161     # This variable is injected in the __builtins__ by the build
162     # process. It used to enable importing subpackages of skimage when
163     # the binaries are not built
164     __SKIMAGE_SETUP__
165 except NameError:
166     __SKIMAGE_SETUP__ = False
167 
168 if __SKIMAGE_SETUP__:
169     sys.stderr.write('Partial import of skimage during the build process.\n')
170     # We are not importing the rest of the scikit during the build
171     # process, as it may not be compiled yet
172 else:
173     try:
174         from ._shared import geometry
175         del geometry
176     except ImportError as e:
177         _raise_build_error(e)
178     from .util.dtype import *
179 
180 
181 def lookfor(what):
182     """Do a keyword search on scikit-image docstrings.
183 
184     Parameters
185     ----------
186     what : str
187         Words to look for.
188 
189     """
190     import numpy as np
191     import sys
192     return np.lookfor(what, sys.modules[__name__])
193 
194 
195 del warnings, functools, osp, imp, sys
196
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/skimage/__init__.py b/skimage/__init__.py
--- a/skimage/__init__.py
+++ b/skimage/__init__.py
@@ -102,7 +102,7 @@
         """Run all unit tests."""
         import pytest
         import warnings
-        args = ['skimage']
+        args = ['--pyargs', 'skimage']
         if verbose:
             args.extend(['-v', '-s'])
         if doctest:

{"golden_diff": "diff --git a/skimage/__init__.py b/skimage/__init__.py\n--- a/skimage/__init__.py\n+++ b/skimage/__init__.py\n@@ -102,7 +102,7 @@\n         \"\"\"Run all unit tests.\"\"\"\n         import pytest\n         import warnings\n-        args = ['skimage']\n+        args = ['--pyargs', 'skimage']\n         if verbose:\n             args.extend(['-v', '-s'])\n         if doctest:\n", "issue": "skimage.test does not execute the unit test\n## Description\r\n\r\n`skimage.test` does not run the unit tests.  \r\n\r\n```\r\n~$ python -c \"import skimage; print(skimage.__version__); skimage.test()\"\r\n0.14.0\r\n====================================================================== test session starts ======================================================================\r\nplatform linux -- Python 3.6.5, pytest-3.6.1, py-1.5.3, pluggy-0.6.0\r\nrootdir: /home/jhelmus, inifile:\r\n\r\n================================================================= no tests ran in 0.00 seconds ==================================================================\r\nERROR: file not found: skimage\r\n```\r\n\r\n<details><summary>Environment Details</summary>\r\n\r\n```\r\n$ conda info\r\n\r\n     active environment : sktest\r\n    active env location : /home/jhelmus/anaconda3/envs/sktest\r\n            shell level : 1\r\n       user config file : /home/jhelmus/.condarc\r\n populated config files : /home/jhelmus/.condarc\r\n          conda version : 4.5.4\r\n    conda-build version : 3.9.1\r\n         python version : 3.6.4.final.0\r\n       base environment : /home/jhelmus/anaconda3  (writable)\r\n           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64\r\n                          https://repo.anaconda.com/pkgs/main/noarch\r\n                          https://repo.anaconda.com/pkgs/free/linux-64\r\n                          https://repo.anaconda.com/pkgs/free/noarch\r\n                          https://repo.anaconda.com/pkgs/r/linux-64\r\n                          https://repo.anaconda.com/pkgs/r/noarch\r\n                          https://repo.anaconda.com/pkgs/pro/linux-64\r\n                          https://repo.anaconda.com/pkgs/pro/noarch\r\n          package cache : /home/jhelmus/anaconda3/pkgs\r\n                          /home/jhelmus/.conda/pkgs\r\n       envs directories : /home/jhelmus/anaconda3/envs\r\n                          /home/jhelmus/.conda/envs\r\n               platform : linux-64\r\n             user-agent : conda/4.5.4 requests/2.18.4 CPython/3.6.4 Linux/4.13.0-41-generic ubuntu/16.04 glibc/2.23\r\n                UID:GID : 1000:1000\r\n             netrc file : None\r\n           offline mode : False\r\n$ conda create -n sktest python=3.6 pip\r\nSolving environment: done\r\n\r\n## Package Plan ##\r\n\r\n  environment location: /home/jhelmus/anaconda3/envs/sktest\r\n\r\n  added / updated specs: \r\n    - pip\r\n    - python=3.6\r\n\r\n\r\nThe following NEW packages will be INSTALLED:\r\n\r\n    ca-certificates: 2018.03.07-0            defaults\r\n    certifi:         2018.4.16-py36_0        defaults\r\n    libedit:         3.1.20170329-h6b74fdf_2 defaults\r\n    libffi:          3.2.1-hd88cf55_4        defaults\r\n    libgcc-ng:       7.2.0-hdf63c60_3        defaults\r\n    libstdcxx-ng:    7.2.0-hdf63c60_3        defaults\r\n    ncurses:         6.1-hf484d3e_0          defaults\r\n    openssl:         1.0.2o-h20670df_0       defaults\r\n    pip:             10.0.1-py36_0           defaults\r\n    python:          3.6.5-hc3d631a_2        defaults\r\n    readline:        7.0-ha6073c6_4          defaults\r\n    setuptools:      39.2.0-py36_0           defaults\r\n    sqlite:          3.23.1-he433501_0       defaults\r\n    tk:              8.6.7-hc745277_3        defaults\r\n    wheel:           0.31.1-py36_0           defaults\r\n    xz:              5.2.4-h14c3975_4        defaults\r\n    zlib:            1.2.11-ha838bed_2       defaults\r\n\r\nProceed ([y]/n)? y\r\n...\r\n$ pip install scikit-image\r\nCollecting scikit-image\r\n  Using cached https://files.pythonhosted.org/packages/34/79/cefff573a53ca3fb4c390739d19541b95f371e24d2990aed4cd8837971f0/scikit_image-0.14.0-cp36-cp36m-manylinux1_x86_64.whl\r\n...\r\nSuccessfully installed PyWavelets-0.5.2 cloudpickle-0.5.3 cycler-0.10.0 dask-0.17.5 decorator-4.3.0 kiwisolver-1.0.1 matplotlib-2.2.2 networkx-2.1 numpy-1.14.3 pillow-5.1.0 pyparsing-2.2.0 python-dateutil-2.7.3 pytz-2018.4 scikit-image-0.14.0 scipy-1.1.0 six-1.11.0 toolz-0.9.0\r\n$ pip install pytest\r\nCollecting pytest\r\n  Using cached https://files.pythonhosted.org/packages/d3/75/e79b66c9fe6166a90004bb8fb02bab06213c3348e93f3be41d7eaf625554/pytest-3.6.1-py2.py3-none-any.whl\r\nCollecting pluggy<0.7,>=0.5 (from pytest)\r\n...\r\nSuccessfully installed atomicwrites-1.1.5 attrs-18.1.0 more-itertools-4.2.0 pluggy-0.6.0 py-1.5.3 pytest-3.6.1\r\n```\r\n\r\n</details>\r\n\r\n\r\n## Way to reproduce\r\n\r\n- [x] Code example\r\n- [ ] Relevant images (if any)\r\n- [x] Operating system and version\r\n- [x] Python version\r\n- [x] scikit-image version (run `skimage.__version__`)\r\n\r\nThis has been observed on conda-forge, see conda-forge/scikit-image-feedstock#23\r\n\n", "before_files": [{"content": "\"\"\"Image Processing SciKit (Toolbox for SciPy)\n\n``scikit-image`` (a.k.a. ``skimage``) is a collection of algorithms for image\nprocessing and computer vision.\n\nThe main package of ``skimage`` only provides a few utilities for converting\nbetween image data types; for most features, you need to import one of the\nfollowing subpackages:\n\nSubpackages\n-----------\ncolor\n    Color space conversion.\ndata\n    Test images and example data.\ndraw\n    Drawing primitives (lines, text, etc.) that operate on NumPy arrays.\nexposure\n    Image intensity adjustment, e.g., histogram equalization, etc.\nfeature\n    Feature detection and extraction, e.g., texture analysis corners, etc.\nfilters\n    Sharpening, edge finding, rank filters, thresholding, etc.\ngraph\n    Graph-theoretic operations, e.g., shortest paths.\nio\n    Reading, saving, and displaying images and video.\nmeasure\n    Measurement of image properties, e.g., similarity and contours.\nmorphology\n    Morphological operations, e.g., opening or skeletonization.\nnovice\n    Simplified interface for teaching purposes.\nrestoration\n    Restoration algorithms, e.g., deconvolution algorithms, denoising, etc.\nsegmentation\n    Partitioning an image into multiple regions.\ntransform\n    Geometric and other transforms, e.g., rotation or the Radon transform.\nutil\n    Generic utilities.\nviewer\n    A simple graphical user interface for visualizing results and exploring\n    parameters.\n\nUtility Functions\n-----------------\nimg_as_float\n    Convert an image to floating point format, with values in [0, 1].\nimg_as_uint\n    Convert an image to unsigned integer format, with values in [0, 65535].\nimg_as_int\n    Convert an image to signed integer format, with values in [-32768, 32767].\nimg_as_ubyte\n    Convert an image to unsigned byte format, with values in [0, 255].\n\n\"\"\"\n\nimport os.path as osp\nimport imp\nimport functools\nimport warnings\nimport sys\n\npkg_dir = osp.abspath(osp.dirname(__file__))\ndata_dir = osp.join(pkg_dir, 'data')\n\n__version__ = '0.15dev'\n\n\nif sys.version_info < (3,):\n    raise ImportError(\"\"\"\n\nYou are running scikit-image on Python 2.\n\nUnfortunately, scikit-image 0.15 and above no longer work on this\nversion of Python.  You therefore have two options: either upgrade to\nPython 3, or install an older version of scikit-image using\n\n $ pip install 'scikit-image<0.15'\n\nPlease also consider updating `pip` and `setuptools`:\n\n $ pip install pip setuptools --upgrade\n\nNewer versions of these tools avoid installing packages incompatible\nwith your version of Python.\n\"\"\")\n\n\ntry:\n    imp.find_module('pytest')\nexcept ImportError:\n    def _test(doctest=False, verbose=False):\n        \"\"\"This would run all unit tests, but pytest couldn't be\n        imported so the test suite can not run.\n        \"\"\"\n        raise ImportError(\"Could not load pytest. Unit tests not available.\")\n\nelse:\n    def _test(doctest=False, verbose=False):\n        \"\"\"Run all unit tests.\"\"\"\n        import pytest\n        import warnings\n        args = ['skimage']\n        if verbose:\n            args.extend(['-v', '-s'])\n        if doctest:\n            args.extend(['--doctest-modules'])\n            # Make sure warnings do not break the doc tests\n            with warnings.catch_warnings():\n                warnings.simplefilter(\"ignore\")\n                success = pytest.main(args)\n        else:\n            success = pytest.main(args)\n        # Return sys.exit code\n        if success:\n            return 0\n        else:\n            return 1\n\n\n# do not use `test` as function name as this leads to a recursion problem with\n# the nose test suite\ntest = _test\ntest_verbose = functools.partial(test, verbose=True)\ntest_verbose.__doc__ = test.__doc__\ndoctest = functools.partial(test, doctest=True)\ndoctest.__doc__ = doctest.__doc__\ndoctest_verbose = functools.partial(test, doctest=True, verbose=True)\ndoctest_verbose.__doc__ = doctest.__doc__\n\n\n# Logic for checking for improper install and importing while in the source\n# tree when package has not been installed inplace.\n# Code adapted from scikit-learn's __check_build module.\n_INPLACE_MSG = \"\"\"\nIt appears that you are importing a local scikit-image source tree. For\nthis, you need to have an inplace install. Maybe you are in the source\ndirectory and you need to try from another location.\"\"\"\n\n_STANDARD_MSG = \"\"\"\nYour install of scikit-image appears to be broken.\nTry re-installing the package following the instructions at:\nhttp://scikit-image.org/docs/stable/install.html \"\"\"\n\n\ndef _raise_build_error(e):\n    # Raise a comprehensible error\n    local_dir = osp.split(__file__)[0]\n    msg = _STANDARD_MSG\n    if local_dir == \"skimage\":\n        # Picking up the local install: this will work only if the\n        # install is an 'inplace build'\n        msg = _INPLACE_MSG\n    raise ImportError(\"\"\"%s\nIt seems that scikit-image has not been built correctly.\n%s\"\"\" % (e, msg))\n\ntry:\n    # This variable is injected in the __builtins__ by the build\n    # process. It used to enable importing subpackages of skimage when\n    # the binaries are not built\n    __SKIMAGE_SETUP__\nexcept NameError:\n    __SKIMAGE_SETUP__ = False\n\nif __SKIMAGE_SETUP__:\n    sys.stderr.write('Partial import of skimage during the build process.\\n')\n    # We are not importing the rest of the scikit during the build\n    # process, as it may not be compiled yet\nelse:\n    try:\n        from ._shared import geometry\n        del geometry\n    except ImportError as e:\n        _raise_build_error(e)\n    from .util.dtype import *\n\n\ndef lookfor(what):\n    \"\"\"Do a keyword search on scikit-image docstrings.\n\n    Parameters\n    ----------\n    what : str\n        Words to look for.\n\n    \"\"\"\n    import numpy as np\n    import sys\n    return np.lookfor(what, sys.modules[__name__])\n\n\ndel warnings, functools, osp, imp, sys\n", "path": "skimage/__init__.py"}], "after_files": [{"content": "\"\"\"Image Processing SciKit (Toolbox for SciPy)\n\n``scikit-image`` (a.k.a. ``skimage``) is a collection of algorithms for image\nprocessing and computer vision.\n\nThe main package of ``skimage`` only provides a few utilities for converting\nbetween image data types; for most features, you need to import one of the\nfollowing subpackages:\n\nSubpackages\n-----------\ncolor\n    Color space conversion.\ndata\n    Test images and example data.\ndraw\n    Drawing primitives (lines, text, etc.) that operate on NumPy arrays.\nexposure\n    Image intensity adjustment, e.g., histogram equalization, etc.\nfeature\n    Feature detection and extraction, e.g., texture analysis corners, etc.\nfilters\n    Sharpening, edge finding, rank filters, thresholding, etc.\ngraph\n    Graph-theoretic operations, e.g., shortest paths.\nio\n    Reading, saving, and displaying images and video.\nmeasure\n    Measurement of image properties, e.g., similarity and contours.\nmorphology\n    Morphological operations, e.g., opening or skeletonization.\nnovice\n    Simplified interface for teaching purposes.\nrestoration\n    Restoration algorithms, e.g., deconvolution algorithms, denoising, etc.\nsegmentation\n    Partitioning an image into multiple regions.\ntransform\n    Geometric and other transforms, e.g., rotation or the Radon transform.\nutil\n    Generic utilities.\nviewer\n    A simple graphical user interface for visualizing results and exploring\n    parameters.\n\nUtility Functions\n-----------------\nimg_as_float\n    Convert an image to floating point format, with values in [0, 1].\nimg_as_uint\n    Convert an image to unsigned integer format, with values in [0, 65535].\nimg_as_int\n    Convert an image to signed integer format, with values in [-32768, 32767].\nimg_as_ubyte\n    Convert an image to unsigned byte format, with values in [0, 255].\n\n\"\"\"\n\nimport os.path as osp\nimport imp\nimport functools\nimport warnings\nimport sys\n\npkg_dir = osp.abspath(osp.dirname(__file__))\ndata_dir = osp.join(pkg_dir, 'data')\n\n__version__ = '0.15dev'\n\n\nif sys.version_info < (3,):\n    raise ImportError(\"\"\"\n\nYou are running scikit-image on Python 2.\n\nUnfortunately, scikit-image 0.15 and above no longer work on this\nversion of Python.  You therefore have two options: either upgrade to\nPython 3, or install an older version of scikit-image using\n\n $ pip install 'scikit-image<0.15'\n\nPlease also consider updating `pip` and `setuptools`:\n\n $ pip install pip setuptools --upgrade\n\nNewer versions of these tools avoid installing packages incompatible\nwith your version of Python.\n\"\"\")\n\n\ntry:\n    imp.find_module('pytest')\nexcept ImportError:\n    def _test(doctest=False, verbose=False):\n        \"\"\"This would run all unit tests, but pytest couldn't be\n        imported so the test suite can not run.\n        \"\"\"\n        raise ImportError(\"Could not load pytest. Unit tests not available.\")\n\nelse:\n    def _test(doctest=False, verbose=False):\n        \"\"\"Run all unit tests.\"\"\"\n        import pytest\n        import warnings\n        args = ['--pyargs', 'skimage']\n        if verbose:\n            args.extend(['-v', '-s'])\n        if doctest:\n            args.extend(['--doctest-modules'])\n            # Make sure warnings do not break the doc tests\n            with warnings.catch_warnings():\n                warnings.simplefilter(\"ignore\")\n                success = pytest.main(args)\n        else:\n            success = pytest.main(args)\n        # Return sys.exit code\n        if success:\n            return 0\n        else:\n            return 1\n\n\n# do not use `test` as function name as this leads to a recursion problem with\n# the nose test suite\ntest = _test\ntest_verbose = functools.partial(test, verbose=True)\ntest_verbose.__doc__ = test.__doc__\ndoctest = functools.partial(test, doctest=True)\ndoctest.__doc__ = doctest.__doc__\ndoctest_verbose = functools.partial(test, doctest=True, verbose=True)\ndoctest_verbose.__doc__ = doctest.__doc__\n\n\n# Logic for checking for improper install and importing while in the source\n# tree when package has not been installed inplace.\n# Code adapted from scikit-learn's __check_build module.\n_INPLACE_MSG = \"\"\"\nIt appears that you are importing a local scikit-image source tree. For\nthis, you need to have an inplace install. Maybe you are in the source\ndirectory and you need to try from another location.\"\"\"\n\n_STANDARD_MSG = \"\"\"\nYour install of scikit-image appears to be broken.\nTry re-installing the package following the instructions at:\nhttp://scikit-image.org/docs/stable/install.html \"\"\"\n\n\ndef _raise_build_error(e):\n    # Raise a comprehensible error\n    local_dir = osp.split(__file__)[0]\n    msg = _STANDARD_MSG\n    if local_dir == \"skimage\":\n        # Picking up the local install: this will work only if the\n        # install is an 'inplace build'\n        msg = _INPLACE_MSG\n    raise ImportError(\"\"\"%s\nIt seems that scikit-image has not been built correctly.\n%s\"\"\" % (e, msg))\n\ntry:\n    # This variable is injected in the __builtins__ by the build\n    # process. It used to enable importing subpackages of skimage when\n    # the binaries are not built\n    __SKIMAGE_SETUP__\nexcept NameError:\n    __SKIMAGE_SETUP__ = False\n\nif __SKIMAGE_SETUP__:\n    sys.stderr.write('Partial import of skimage during the build process.\\n')\n    # We are not importing the rest of the scikit during the build\n    # process, as it may not be compiled yet\nelse:\n    try:\n        from ._shared import geometry\n        del geometry\n    except ImportError as e:\n        _raise_build_error(e)\n    from .util.dtype import *\n\n\ndef lookfor(what):\n    \"\"\"Do a keyword search on scikit-image docstrings.\n\n    Parameters\n    ----------\n    what : str\n        Words to look for.\n\n    \"\"\"\n    import numpy as np\n    import sys\n    return np.lookfor(what, sys.modules[__name__])\n\n\ndel warnings, functools, osp, imp, sys\n", "path": "skimage/__init__.py"}]}