[BioPython] Do you mean Numpy or Numeric?

Wolfgang Meyer wolfgang.meyer at gmail.com
Fri Feb 2 23:37:14 UTC 2007


On 2/2/07, Peter <biopython at maubp.freeserve.co.uk> wrote:
>
> Wolfgang Meyer wrote:
> > Hi,
> >
> > I read the previous posts about numpy / numeric confusions. I were also
> > stumbled by it very much and wanted some issues to be clarified.
> >
> > In the documentation for BioPython on web, many input/output arrays
> > are specified as "Numpy arrays". However, I think it should be "Numeric
> > arrays".
> >
> > ...
> >
> > Why? Because the function is expecting a Numeric array,
> > rather than Numpy array, which is specified in the documentation.
>
> Its because "NumPy" means something different now, than when that was
> written (when it meant the Numeric library).  See below.


Thank! Good to learn this. I read the below text a long time ago but did not
pay attention
to the "misuse" of "numpy".


> So why is this the case? I know Numeric is not under development
> > anymore, and Numpy is a "new" Numeric.
>
> See: http://www.scipy.org/History_of_SciPy
>
> (1) Numeric
> Once upon a time there was a python array and matrix library called
> "Numerical Python" which was used with "import Numeric" but was
> frequently referred to as simply "NumPy".
>
> (2) numarray
> Then there was a new, incompatible, branch NumArray used with "import
> numarry" which was much better for large array (but not so good with
> small arrays).
>
> (3) numpy
> Now developers are working on the third iteration, which ended up being
> called "NumPy" and used with "import numpy".
>
> So the term "NumPy" in recent documentation means the third project,
> used with "import numpy".  BUT in older documentation it is shorthand
> for the first project, "Numerical python" used with "import Numeric".
>
> > But according to my
> > experiences they are really different in many aspects so far. If one
> > mixes them in programs, one can really have a lot headaches.
>
> Mixing the two is a certainly a bad idea :)


But certainly there are scenarios where both are needed.  For example,
a user who is in favor of both numpy and biopython will be simply pathetic
:-)

> So I suggest to give real instructions in documentation, instead
> > of causing more confusions.
>
> Apart from "KDTree.py" are there any other uses of the term "NumPy"
> which would be better as "Numeric"?

IMHO, wherever "numpy" shows up in the current documentation should be
replaced by 'numeric'. Simply image a user who just come to the filed
and is unaware of the development history of numpy, (nor does he/she is
aware
of the 'misuse' of the term). When he/she is reading BioPython
documentation,
he will definitely take "NumPy" for "numpy".


BioPython will have to move from Numeric to NumPy at some point anyway...


Looking forward to that.

Peter
>
>


-- 
Wolfgang Meyer



More information about the Biopython mailing list