Re: Policy for import of submodules
On Wed, Jan 30, 2013 at 11:42 AM, Tony Yu <tsyu80@gmail.com> wrote:
So my question is, is this behaviour by design, or should there be nothing at all in the top-level, or should everything be imported?
I tend to agree that it should be one or the other (with the exception of the standard metadata at the top-level).
As Tony mentioned, it's by design from the lessons learnt in NumPy, aimed at limiting the import time of the library. Because ``img_as_float``, ``test`` etc. are used so often, we put them in the root namespace. We have: skimage.data_dir skimage.img_as_int skimage.test skimage.get_log skimage.img_as_ubyte skimage.test_verbose skimage.img_as_bool skimage.img_as_uint skimage.util skimage.img_as_float skimage.pkg_dir skimage.version Of these, I would keep at least skimage.version, skimage.test, skimage.test_verbose and skimage.get_log, because they provide overarching functionality. Stéfan
participants (1)
-
Stéfan van der Walt