[cctbxbb] flex and numpy caveats
luc_j_bourhis at mac.com
Fri Apr 5 05:46:36 PDT 2013
> This may be more generally useful:
> The relevant fields of the returned PyArray_Descr seem to be kind, byteorder, and elsize.
thanks for digging that out. I can now envision how to compare the numpy array and the flex array element types. Lots of boring bookkeeping but definitively possible.
However, we haven't address the important question: what behaviour do we really want?
(i) the numpy array and the flex array must have the same element type, and an exception is thrown if this precondition is violated;
(ii) we use a fast copy of the numpy array to the flex array if the element types are the same; otherwise we fall back to a slower conversion.
More information about the cctbxbb