Re: [Numpy-discussion] np.void from 0d array + subclassing

2009-12-17 Thread David Goldsmith
On Thu, Dec 17, 2009 at 3:46 PM, Robert Kern wrote: > On Thu, Dec 17, 2009 at 17:41, Pierre GM wrote: >> Well, that's slick and really neat !!! Typically Robert K's... Thanks a lot >> !!! Yeah, sometimes I think the only reason we have a mailing list is so that we're not all just emailing Rober

Re: [Numpy-discussion] np.void from 0d array + subclassing

2009-12-17 Thread Robert Kern
On Thu, Dec 17, 2009 at 17:41, Pierre GM wrote: > On Dec 17, 2009, at 6:35 PM, Robert Kern wrote: >> On Thu, Dec 17, 2009 at 16:11, Pierre GM wrote: >>> Here's the catch: IIUC, each individual element of a nD structured array is >>> a void, provided the element can be accessed, ie that n>0. A 0

Re: [Numpy-discussion] np.void from 0d array + subclassing

2009-12-17 Thread Pierre GM
On Dec 17, 2009, at 6:35 PM, Robert Kern wrote: > On Thu, Dec 17, 2009 at 16:11, Pierre GM wrote: >> On Dec 17, 2009, at 10:16 AM, Francesc Alted wrote: >>> A Thursday 17 December 2009 15:16:29 Pierre GM escrigué: All, * What is the most efficient way to get a np.void object from a 0d >>

Re: [Numpy-discussion] np.void from 0d array + subclassing

2009-12-17 Thread Robert Kern
On Thu, Dec 17, 2009 at 16:11, Pierre GM wrote: > On Dec 17, 2009, at 10:16 AM, Francesc Alted wrote: >> A Thursday 17 December 2009 15:16:29 Pierre GM escrigué: >>> All, >>> * What is the most efficient way to get a np.void object from a 0d >>> structured ndarray ? >> >> I normally use `PyArray_G

Re: [Numpy-discussion] np.void from 0d array + subclassing

2009-12-17 Thread David Goldsmith
On Thu, Dec 17, 2009 at 2:11 PM, Pierre GM wrote: > Francesc, you're overestimating my knowledge of C... Can we stick to the > Python implementation ? > Here's the catch: IIUC, each individual element of a nD structured array is a > void, provided the element can be accessed, ie that n>0. A 0D a

Re: [Numpy-discussion] np.void from 0d array + subclassing

2009-12-17 Thread Pierre GM
On Dec 17, 2009, at 10:16 AM, Francesc Alted wrote: > A Thursday 17 December 2009 15:16:29 Pierre GM escrigué: >> All, >> * What is the most efficient way to get a np.void object from a 0d >> structured ndarray ? > > I normally use `PyArray_GETITEM` C macro for general n-d structured arrays. > I

Re: [Numpy-discussion] np.void from 0d array + subclassing

2009-12-17 Thread David Goldsmith
On Thu, Dec 17, 2009 at 6:16 AM, Pierre GM wrote: > All, > * What is the most efficient way to get a np.void object from a 0d structured > ndarray ? > * Is there any way to subclass np.void ? The standard way (more or less) works for me: >>> class myvoidclass(np.void): ... pass ... >>> foo

Re: [Numpy-discussion] np.void from 0d array + subclassing

2009-12-17 Thread Francesc Alted
A Thursday 17 December 2009 15:16:29 Pierre GM escrigué: > All, > * What is the most efficient way to get a np.void object from a 0d > structured ndarray ? I normally use `PyArray_GETITEM` C macro for general n-d structured arrays. I suppose that this will work with 0-d arrays too. -- Frances

[Numpy-discussion] np.void from 0d array + subclassing

2009-12-17 Thread Pierre GM
All, * What is the most efficient way to get a np.void object from a 0d structured ndarray ? * Is there any way to subclass np.void ? Thanks a lot in advance ! P. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/