numarray bug or my?
marco at bubke.de
Tue Feb 24 17:48:50 CET 2004
Simon Burton wrote:
> On Mon, 23 Feb 2004 23:14:03 +0100, Marco Bubke wrote:
>> Ok, its in Pyrex and has a bug in
>> flat_view = array_to_int(viewport),
>> but I don't know why. If I change the code to flat_view =
>> array_to_double(viewport) its runnig without glitches. I really dont
>> understand it.
> Yes, me too. I wasn't sure if NA_InputArray was supposed
> to be able to handle type conversions, so I used the python
> array = array.astype(numarray.Int32)
> and then used NA_InputArray on that.
Ok, Than I do that, I get everytime a Segmentation fault. Before it was only
from time to time. An its 100% NA_InputArray. If I erease NA_updateDataPtr
before NA_InputArray I get a amok process.
cdef NumArray array_to_float(NumArray array):
# maybe here is memoty leak!
cdef NumArray flat_array
cdef NumArray new_array
print 'mark 1'
new_array = array.astype('Float32')
print 'mark 2'
print 'mark 3'
NA_IoArray(new_array, tFloat32, NUM_C_ARRAY)
print 'mark 4'
flat_array = NA_updateDataPtr(flat_array)
print 'mark 5'
More information about the Python-list