Re: [Numpy-discussion] numpy.ctypeslib.ndpointer and the restype attribute [patch]

2009-04-04 Thread Travis E. Oliphant
Thomas Heller wrote: Thomas Heller schrieb: Sturla Molden schrieb: On 3/26/2009 12:41 PM, Jens Rantil wrote: Wouldn't my code, or a tweak of it, be a nice feature in numpy.ctypeslib? Is this the wrong channel for proposing things like this? If you look at

Re: [Numpy-discussion] numpy.ctypeslib.ndpointer and the restype attribute [patch]

2009-04-03 Thread Thomas Heller
Thomas Heller schrieb: Sturla Molden schrieb: On 3/26/2009 12:41 PM, Jens Rantil wrote: Wouldn't my code, or a tweak of it, be a nice feature in numpy.ctypeslib? Is this the wrong channel for proposing things like this? If you look at

Re: [Numpy-discussion] numpy.ctypeslib.ndpointer and the restype attribute [patch]

2009-03-27 Thread Thomas Heller
Sturla Molden schrieb: On 3/26/2009 12:41 PM, Jens Rantil wrote: Wouldn't my code, or a tweak of it, be a nice feature in numpy.ctypeslib? Is this the wrong channel for proposing things like this? If you look at http://svn.scipy.org/svn/numpy/trunk/numpy/ctypeslib.py you will

Re: [Numpy-discussion] numpy.ctypeslib.ndpointer and the restype attribute [patch]

2009-03-26 Thread Jens Rantil
Hi again, On Mon, 2009-03-23 at 14:36 +0100, Jens Rantil wrote: So I have a C-function in a DLL loaded through ctypes. This particular function returns a pointer to a double. In fact I know that this pointer points to the first element in an array of, say for simplicity, 200 elements. How

Re: [Numpy-discussion] numpy.ctypeslib.ndpointer and the restype attribute [patch]

2009-03-26 Thread Thomas Heller
Sturla Molden schrieb: On 3/26/2009 12:41 PM, Jens Rantil wrote: Wouldn't my code, or a tweak of it, be a nice feature in numpy.ctypeslib? Is this the wrong channel for proposing things like this? If you look at http://svn.scipy.org/svn/numpy/trunk/numpy/ctypeslib.py you will

Re: [Numpy-discussion] numpy.ctypeslib.ndpointer and the restype attribute

2009-03-24 Thread Jens Rantil
On Mon, 2009-03-23 at 15:40 +0100, Sturla Molden wrote: def fromaddress(address, nbytes, dtype=double): class Dummy(object): pass d = Dummy() d.__array_interface__ = { 'data' : (address, False), 'typestr' : numpy.uint8.str, 'descr' : numpy.uint8.descr,

Re: [Numpy-discussion] numpy.ctypeslib.ndpointer and the restype attribute

2009-03-24 Thread Sturla Molden
Jens Rantil wrote: Thanks Sturla. However numpy.uint8 seem to be lacking attributes 'str' and 'descr'. I'm using installed Ubuntu package 1:1.1.1-1. Is it too old or is the code broken? Oops, my fault :) def fromaddress(address, nbytes, dtype=float): class Dummy(object): pass d =

Re: [Numpy-discussion] numpy.ctypeslib.ndpointer and the restype attribute

2009-03-23 Thread Jochen Schroeder
On 23/03/09 15:40, Sturla Molden wrote: Jens Rantil wrote: Hi all, So I have a C-function in a DLL loaded through ctypes. This particular function returns a pointer to a double. In fact I know that this pointer points to the first element in an array of, say for simplicity, 200

Re: [Numpy-discussion] numpy.ctypeslib.ndpointer and the restype attribute

2009-03-23 Thread Sturla Molden
Sturla Molden wrote: def fromaddress(address, nbytes, dtype=double): I guess dtype=float works better... S.M. ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion