[Biopython-dev] Numeric/numpy

Peter biopython at maubp.freeserve.co.uk
Tue Sep 23 09:12:32 UTC 2008


I was just thinking about the situation where people have both Numeric
and numpy installed, and that rather than using:

try:
    from Numeric import x, y, z
except ImportError:
    from numpy.oldnumeric import x, y, z

arguably we should be giving numpy priority.  One solution would be
something like this:

try:
    from numpy.oldnumeric import x, y, z
except ImportError, e:
   try :
       from Numeric import x, y, z
   except ImportError :
       raise e #Want to complain about numpy, not Numeric

Unfortunately this is rather long!

Alternatively, shall we wait until the end of the week (say), and if
no-one objects to a straight switch from Numeric to numpy, proceed
with just the following?:

from numpy.oldnumeric import x, y, z

Peter



More information about the Biopython-dev mailing list