Hey all, I noticed that loading skimage seemed to take a bit longer than I'd like, so I profiled it. On my machine, it takes 1.6 seconds to import skimage, 0.4 of which was from numpy, and 1.2 of which was from loading nose in skimage/__init__.py. This simple patch brings my import time down to ~0.4 seconds, since it only imports nose when the test function is called. diff --git a/skimage/__init__.py b/skimage/__init__.py index 1ac121b..f3e5e88 100644 --- a/skimage/__init__.py +++ b/skimage/__init__.py @@ -84,8 +84,9 @@ def _setup_test(verbose=False): return f -test = _setup_test() -test_verbose = _setup_test(verbose=True) +test = lambda : _setup_test()() +test_verbose = lambda : _setup_test(verbose=True)() +test_verbose.__doc__ = test.__doc__ = 'Invoke the skimage test suite.' def get_log(name=None):