Re: [Numpy-discussion] Numpy array from ctypes pointer object?

2006-07-12 Thread Mark Heslep
Albert Strasheim wrote: > Hello all > > Various people wrote: > >>> Im curious though: the several projects recently using ctypes >>> and numpy to wrap libraries (Pygame SDL, OpenGL, svm) must have come >>> across the issue of using a creating a numpy array from a ctypes >>> pointer. Ill have

Re: [Numpy-discussion] Numpy array from ctypes pointer object?

2006-07-12 Thread Albert Strasheim
Hello all Various people wrote: > > Im curious though: the several projects recently using ctypes > > and numpy to wrap libraries (Pygame SDL, OpenGL, svm) must have come > > across the issue of using a creating a numpy array from a ctypes > > pointer. Ill have to look further. > > > It depends

Re: [Numpy-discussion] Numpy array from ctypes pointer object?

2006-07-12 Thread Travis Oliphant
Mark Heslep wrote: > Travis Oliphant wrote: > >> The problem here is that from Python NumPy has no way to create an >> ndarray from a pointer. Doing this creates a situtation where it is >> unclear who owns the memory. It is probably best to wrap the pointer >> into some kind of object exp

Re: [Numpy-discussion] Numpy array from ctypes pointer object?

2006-07-12 Thread Mark Heslep
Travis Oliphant wrote: > The problem here is that from Python NumPy has no way to create an > ndarray from a pointer. Doing this creates a situtation where it is > unclear who owns the memory. It is probably best to wrap the pointer > into some kind of object exposing the buffer protocol and

Re: [Numpy-discussion] Numpy array from ctypes pointer object?

2006-07-12 Thread Travis Oliphant
Mark Heslep wrote: > Travis Oliphant wrote: > >> Mark Heslep wrote: >> >>> I don't see a clean way to create a numpy array from a ctypes pointer >>> object. Is the __array_interface_ in ctypes the thing thats missing >>> needed to make this happen? I've followed Albert's Scipy cookbook

Re: [Numpy-discussion] Numpy array from ctypes pointer object?

2006-07-12 Thread Travis Oliphant
Mark Heslep wrote: > I don't see a clean way to create a numpy array from a ctypes pointer object. > Is the __array_interface_ in ctypes the thing thats missing needed to make > this happen? I've followed Albert's Scipy cookbook on ctypes here > > http://www.scipy.org/Cookbook/Ctypes <-- getti

Re: [Numpy-discussion] Numpy array from ctypes pointer object?

2006-07-12 Thread Thomas Heller
Mark Heslep schrieb: > Travis Oliphant wrote: >> Mark Heslep wrote: >>> I don't see a clean way to create a numpy array from a ctypes pointer >>> object. Is the __array_interface_ in ctypes the thing thats missing >>> needed to make this happen? I've followed Albert's Scipy cookbook >>> on cty

Re: [Numpy-discussion] Numpy array from ctypes pointer object?

2006-07-12 Thread Mark Heslep
Travis Oliphant wrote: > Mark Heslep wrote: >> I don't see a clean way to create a numpy array from a ctypes pointer >> object. Is the __array_interface_ in ctypes the thing thats missing >> needed to make this happen? I've followed Albert's Scipy cookbook >> on ctypes here >> >> On the C side

Re: [Numpy-discussion] Numpy array from ctypes pointer object?

2006-07-12 Thread Travis Oliphant
Mark Heslep wrote: > I don't see a clean way to create a numpy array from a ctypes pointer object. > Is the __array_interface_ in ctypes the thing thats missing needed to make > this happen? I've followed Albert's Scipy cookbook on ctypes here > > On the C side the PyArray_SimpleNewFromData( ..

[Numpy-discussion] Numpy array from ctypes pointer object?

2006-07-12 Thread Mark Heslep
I don't see a clean way to create a numpy array from a ctypes pointer object. Is the __array_interface_ in ctypes the thing thats missing needed to make this happen? I've followed Albert's Scipy cookbook on ctypes here http://www.scipy.org/Cookbook/Ctypes <-- getting dated now for numpy SVN b