[Biopython-dev] PATCH: NumPy support for BioPython

Ed Schofield edschofield at gmail.com
Fri Mar 9 19:22:13 UTC 2007

On 3/9/07, Michiel Jan Laurens de Hoon <mdehoon at c2b2.columbia.edu> wrote:
> Ed Schofield wrote:
> > I've now finished the first version of a patch to add support for NumPy
> in
> > addition to Numeric. I'll try to attach it to this message; you can also
> > get
> > it from http://edschofield.com/biopython-numpy-support.patch. ...
> Thanks, Ed.
> Quick question:
> The patch #includes numpy/oldnumeric.h for Python <--> C glue code that
> uses Numeric. Why is this needed?

For the CONTIGUOUS and import_array() definitions right now. As you pointed
out earlier in the thread, these are only used a couple of times. But
including the header is simpler than pasting these two definitions into the
C source files and should maximize compatibility should they be extended
further in the future.

I haven't yet got around to answering your question about import_array() ...

Do you know why it appears in oldnumeric.h? As the exact same definition
> appears in numpy/core/code_generators/generate_array_api.py, I would
> think that there is no need for it in oldnumeric.h .

... because I don't know how the code generation works within NumPy. But I
don't think extension modules will ever use NumPy's internal code
generators; they just need the headers.

-- Ed

More information about the Biopython-dev mailing list