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

Albert Strasheim fullung at gmail.com
Sun Apr 30 17:11:05 EDT 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']},
align=1)

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.

Regards,

Albert





More information about the NumPy-Discussion mailing list