[Numpy-discussion] PyArray_BASE equivalent in python

2013-11-26 Thread Peter Rennert
Hi, I as the title says, I am looking for a way to set in python the base of an ndarray to an object. Use case is porting qimage2ndarray to PySide where I want to do something like: In [1]: from PySide import QtGui In [2]: image = QtGui.QImage('/home/peter/code/pyTools/sandbox/images/faceDem

Re: [Numpy-discussion] PyArray_BASE equivalent in python

2013-11-26 Thread Peter Rennert
Brilliant thanks, I will try out the "little class" approach. On 11/26/2013 08:03 PM, Nathaniel Smith wrote: > On Tue, Nov 26, 2013 at 11:54 AM, Peter Rennert > wrote: >> Hi, >> >> I as the title says, I am looking for a way to set in python the base of >

Re: [Numpy-discussion] PyArray_BASE equivalent in python

2013-11-26 Thread Peter Rennert
myArray(): def __init__(self, shape, bits, strides): self.__array_interface__ = \ {'data': bits, 'typestr': ' del image b # booom # On 11/26/2013 08:12 PM, Peter Rennert wrote: > Brilliant thanks, I will try out the "little clas

Re: [Numpy-discussion] PyArray_BASE equivalent in python

2013-11-26 Thread Peter Rennert
Btw, I just wanted to file a bug at PySide, but it might be alright at their end, because I can do this: from PySide import QtGui image = QtGui.QImage('/home/peter/code/pyTools/sandbox/images/faceDemo.jpg') a = image.bits() del image a # On 11/26/2013 09:37 PM, Peter Rennert

Re: [Numpy-discussion] PyArray_BASE equivalent in python

2013-11-27 Thread Peter Rennert
Nathaniel Smith wrote: > On Tue, Nov 26, 2013 at 2:55 PM, Peter Rennert wrote: >> Btw, I just wanted to file a bug at PySide, but it might be alright at >> their end, because I can do this: >> >> from PySide import QtGui >> >> image = QtGui.QImage('/home/pet