[Numpy-discussion] "import numpy" is slow

Robert Kern robert.kern@gmail....
Thu Jul 31 01:44:33 CDT 2008


On Thu, Jul 31, 2008 at 01:12, Andrew Dalke <dalke@dalkescientific.com> wrote:
> On Jul 31, 2008, at 3:53 AM, David Cournapeau wrote:
>> You are supposed to run the tests on an installed numpy, not in the
>> sources:
>>
>> import numpy
>> numpy.test(verbose = 10)
>
> Doesn't that make things more cumbersome to test?  That is, if I were
> to make a change I would need to:
>   - python setup.py build  (to put the code into the build/*
> subdirectory)
>   - cd the build directory, or switch to a terminal which was
> already there
>   - manually do the import/test code you wrote, or a write two-line
> program for it

Developers can build_ext --inplace and frequently use nosetests
anyways. numpy.test() is now primarily for users who are trying to see
if their installation worked (or gathering requested information for
the people on this list to help them troubleshoot) need to test the
installed numpy.

Note that we are *just* now transitioning to using nosetests for the
development version of numpy. It used to be (through the 1.1.x
releases) that we had our own test collection code inside numpy.
numpy.test() was *necessary* in those releases. By now, we have most
of the denizens here trained to do numpy.test() when testing their new
installations. Maybe in 1.3, we'll remove it in favor of just having
people use the nosetests command.

-- 
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 Numpy-discussion mailing list