[Biopython-dev] PATCH: NumPy support for BioPython

Ed Schofield edschofield at gmail.com
Sat Mar 10 01:25:37 UTC 2007

On 3/9/07, Michiel Jan Laurens de Hoon <mdehoon at c2b2.columbia.edu> wrote:
> Ed Schofield wrote:
> >> 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.
> For the CONTIGUOUS definition, there's a simpler solution.
> [snip]
> So, if we use this macro instead of CONTIGUOUS directly, we can avoid
> using oldnumeric.h. Or am I missing something?

Yeah, sure, but why would we want to avoid using oldnumeric.h? Perhaps
you're assuming this is the 'oldnumeric' compatibility layer that I
mentioned earlier. The C header is actually only a very small part of it;
the meat of it is in the numpy.oldnumeric module imported by the Python
code, which we're inextricably bound to using as long as we preserve Numeric

> I haven't yet got around to answering your question about import_array()
> ...
> > ... because I don't know how the code generation works within NumPy.
> Yeah I know, I don't think that code generation in NumPy was a good
> idea. It makes it too hard to figure out what is going on.

Well, that might be too harsh a judgment. Remember, the code generation is
only for the internals -- I don't think it's something extension writers
should need to know or worry about...

-- Ed

More information about the Biopython-dev mailing list