[Numpy-discussion] Creating a descr with aligned=1 using the C API

Albert Strasheim fullung at gmail.com
Sun Apr 30 17:11:05 CDT 2006

Hello all

I was wondering what the best way would be to create the following descr
using the C API:

descr = dtype({'names' : ['index', 'value'], 'formats' : [intc, 'f8']},

One could use PyArray_DescrConverter in multiarraymodule.c, but there
doesn't seem to be a way to specify aligned=1 and one would have to build
the dict object before being able to pass it on for conversion.

Unless there's another easy way I'm missing, the API could possibly do with
a function like PyArray_DescrFromCommaString(const char*, int align) which
calls _convert_from_commastring. By the way, what is the general format of
these commastrings?

Comments appreciated.



More information about the Numpy-discussion mailing list