[SciPy-user] NumPy vs. SciPy and other speed comparisons

Robert Kern robert.kern at gmail.com
Wed Jun 11 06:33:30 EDT 2008


On Wed, Jun 11, 2008 at 05:06, Pearu Peterson <pearu at cens.ioc.ee> wrote:
>
> Robert Kern wrote:
>> On Wed, Jun 11, 2008 at 04:52, Pearu Peterson <pearu at cens.ioc.ee> wrote:
>>> Robert Kern wrote:
>>>
>>>> What really annoys me is that "from scipy import *" imports all of the
>>>> subpackages. Again. I don't know how many times I thought I removed
>>>> that nonsense, but like a bloody vampire, it just ... keeps ... coming
>>>> ... back.
>>> There should be a unittest for that..
>>>
>>> Eventhough scipy.__version__ == 0.7.0.dev4124 (that I have at the
>>> current computer) does not import scipy subpackages,
>>
>> Specifically, it is "from scipy import *" that imports the
>> subpackages. "import scipy" does not.
>
> Ahh, right.
>
> We used to have postponed import hooks for that in past
> but afaik we dropped these because they were hackish and at some moment
> the time of importing scipy improved (I think it was in Python 2.4 or
> 2.5) considerably.

The problem is that we left scipy.pkgload in, and creating that from
numpy._import_tools.PackageLoader implicitly adds all of the
subpackages to scipy.__all__.

> Nevertheless, the test functions could import nose only when required.
> That would save some import time.

Yes, I have a patch for that.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco



More information about the SciPy-User mailing list