I am using idiom
size_x, size_y, size_z = some_array.shape
quite often when working with numpy arrays. The same does not seem to work in Cython when the array in question has a type, e.g.
def someFunc(np.ndarray[np.float32_t, ndim=2] arr): sx, sy = arr.shape
we get a compilation error like
Cannot convert 'npy_intp *' to Python object
which may be due to the fact that the "form" is converted to a C array (for faster access), so it is no longer a tuple.
Can this tuple be retrieved somehow even in Keaton? (Or should I just stick to sx, sy = arr.shape[0], arr.shape[1] ?)
source share