I was getting 'Buffer types only allowed as function local variables'
errors when I tried to declare my array in the class, rather than in
the method.
I found this question and reply for the same problem:
<http://codespeak.net/pipermail/cython-dev/2009-April/005214.html>
but the last workaround that was mentioned I do not understand well
enough.
Is there sombody who can write the cython code that would do the
following so that I can understand it ?
I think I understand what it means, but I don't know how to do it in
Cython.
(start quote)
I'm afraid the only solution right now is
to store it as numpy.ndarray and access the data field (i.e.
self.data.data), casted to numpy.float_t*. You must then make sure
you
work with a contiguous array:
if not data.flags['C_CONTIGUOUS']:
data = data.copy()
self.data = data
(end quote)
how do I cast self.data.data to soemthing and how do I use it as I
would use an array ?
any insights welcome,
Joost.
I would like to second Rekveld's request. I've run into the same issue
and can't wuite understand what Dag was trying to say for his
workaround suggestion.
Thanks,
Mike