[Biopython-dev] Offer to convert BioPython to NumPy

Michiel Jan Laurens de Hoon mdehoon at c2b2.columbia.edu
Mon Mar 5 18:17:28 UTC 2007


Ed Schofield wrote:
> I've started work on a simple wrapper layer for Biopython to use either 
> Numeric or numpy.oldnumeric. I'll post more details soon.

Thanks Ed!
I looked at the definitions in oldnumeric.h. It turned out that only two 
of them are actually used in Biopython:

#define CONTIGUOUS NPY_CONTIGUOUS

and

#undef import_array
#define import_array() { if (_import_array() < 0) {PyErr_Print(); 
PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to 
import"); } }

So it appears that the compatibility problem of Biopython and numpy may 
not be as big as it seemed at first, at least as far as the C-code is 
concerned.

About the import_array definition:

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.

--Michiel.


-- 
Michiel de Hoon
Center for Computational Biology and Bioinformatics
Columbia University
1130 St Nicholas Avenue
New York, NY 10032



More information about the Biopython-dev mailing list