Re: [Numpy-discussion] recarray fun

2008-05-01 Thread Stéfan van der Walt
2008/5/1 Travis E. Oliphant <[EMAIL PROTECTED]>: > Stéfan van der Walt wrote: > > > > 2008/5/1 Travis E. Oliphant <[EMAIL PROTECTED]>: > > > >> > OK, I see your point. I'm working on a patch that does the following: > >> > > >> > def view(type_or_dtype=None, dtype=None, type=None): > >> >

Re: [Numpy-discussion] recarray fun

2008-05-01 Thread Travis E. Oliphant
Stéfan van der Walt wrote: > 2008/5/1 Travis E. Oliphant <[EMAIL PROTECTED]>: > >> > OK, I see your point. I'm working on a patch that does the following: >> > >> > def view(type_or_dtype=None, dtype=None, type=None): >> > if type_or_dtype: >> > if dtype: >> > ra

Re: [Numpy-discussion] recarray fun

2008-05-01 Thread Alan G Isaac
On Thu, 01 May 2008, Christopher Barker apparently wrote: > Maybe we should have a Wiki page for "stuff we'd like to change, but > won't until major API breakage is otherwise occurring" Perhaps http://www.scipy.org/ProposedEnhancements> would suffice? Cheers, Alan _

Re: [Numpy-discussion] recarray fun

2008-05-01 Thread Travis E. Oliphant
> Please review http://projects.scipy.org/scipy/numpy/changeset/5117. > Stefan, I don't think we really need the dtype_or_type keyword.It seems that we could just check the first argument (dtype) to see if it is a subtype of the ndarray and assume that it is type= in that case. -Travi

Re: [Numpy-discussion] recarray fun

2008-05-01 Thread Stéfan van der Walt
2008/5/1 Travis E. Oliphant <[EMAIL PROTECTED]>: > > OK, I see your point. I'm working on a patch that does the following: > > > > def view(type_or_dtype=None, dtype=None, type=None): > > if type_or_dtype: > > if dtype: > > raise ValueError("Cannot specify dtype twi

Re: [Numpy-discussion] recarray fun

2008-05-01 Thread Christopher Barker
Travis E. Oliphant wrote: >> def view(type_or_dtype=None, dtype=None, type=None): > Yes, I think that would work. Is there a way to deprecate this for future API-incompatible versions? It's better than non keywords, but a bit ugly. Maybe we should have a Wiki page for "stuff we'd like to chang

Re: [Numpy-discussion] recarray fun

2008-05-01 Thread Travis E. Oliphant
Stéfan van der Walt wrote: > 2008/5/1 Travis E. Oliphant <[EMAIL PROTECTED]>: > >> Stéfan van der Walt wrote: >> > 2008/4/30 Christopher Barker <[EMAIL PROTECTED]>: >> > >> >> Stéfan van der Walt wrote: >> >> > That's the way, or just rgba_image.view(numpy.int32). >> >> >> >> ah -- inter

Re: [Numpy-discussion] recarray fun

2008-05-01 Thread Stéfan van der Walt
2008/5/1 Travis E. Oliphant <[EMAIL PROTECTED]>: > Stéfan van der Walt wrote: > > 2008/4/30 Christopher Barker <[EMAIL PROTECTED]>: > > > >> Stéfan van der Walt wrote: > >> > That's the way, or just rgba_image.view(numpy.int32). > >> > >> ah -- interestingly, I tried: > >> > >> rgba_imag

Re: [Numpy-discussion] recarray fun

2008-04-30 Thread Anne Archibald
2008/5/1 Travis E. Oliphant <[EMAIL PROTECTED]>: > Stéfan van der Walt wrote: > > 2008/4/30 Christopher Barker <[EMAIL PROTECTED]>: > > > >> Stéfan van der Walt wrote: > >> > That's the way, or just rgba_image.view(numpy.int32). > >> > >> ah -- interestingly, I tried: > >> > >> rgba_imag

Re: [Numpy-discussion] recarray fun

2008-04-30 Thread Chris.Barker
Travis E. Oliphant wrote: > Stéfan van der Walt wrote: >> 2008/4/30 Christopher Barker <[EMAIL PROTECTED]>: >>> Since it is optional, shouldn't it be keyword argument? >>> >> Thanks, fixed in r5115. >> >> > This was too hasty. I had considered this before. > > The problem with this is t

Re: [Numpy-discussion] recarray fun

2008-04-30 Thread Travis E. Oliphant
Stéfan van der Walt wrote: > 2008/4/30 Christopher Barker <[EMAIL PROTECTED]>: > >> Stéfan van der Walt wrote: >> > That's the way, or just rgba_image.view(numpy.int32). >> >> ah -- interestingly, I tried: >> >> rgba_image.view(dtype=numpy.int32) >> >> and got: >> >> Traceback (most recent

Re: [Numpy-discussion] recarray fun

2008-04-30 Thread Stéfan van der Walt
2008/4/30 Christopher Barker <[EMAIL PROTECTED]>: > Stéfan van der Walt wrote: > > That's the way, or just rgba_image.view(numpy.int32). > > ah -- interestingly, I tried: > > rgba_image.view(dtype=numpy.int32) > > and got: > > Traceback (most recent call last): >File "", line 1, in > Typ

Re: [Numpy-discussion] recarray fun

2008-04-30 Thread Christopher Barker
Stéfan van der Walt wrote: > That's the way, or just rgba_image.view(numpy.int32). ah -- interestingly, I tried: rgba_image.view(dtype=numpy.int32) and got: Traceback (most recent call last): File "", line 1, in TypeError: view() takes no keyword arguments Since it is optional, shouldn't i

Re: [Numpy-discussion] recarray fun

2008-04-30 Thread Stéfan van der Walt
Hi Chris 2008/4/30 Christopher Barker <[EMAIL PROTECTED]>: > Someone on the wxPython list posted a nifty recarray example that I > don't quite understand. The idea is to have an array for an RGBA image: > > rgbarec = numpy.dtype({'r':(numpy.uint8,0), > 'g':(numpy.uint8,1

Re: [Numpy-discussion] recarray fun

2008-04-30 Thread Travis E. Oliphant
Christopher Barker wrote: > Hi folks, > > Someone on the wxPython list posted a nifty recarray example that I > don't quite understand. The idea is to have an array for an RGBA image: > > rgbarec = numpy.dtype({'r':(numpy.uint8,0), > 'g':(numpy.uint8,1), >

[Numpy-discussion] recarray fun

2008-04-30 Thread Christopher Barker
Hi folks, Someone on the wxPython list posted a nifty recarray example that I don't quite understand. The idea is to have an array for an RGBA image: rgbarec = numpy.dtype({'r':(numpy.uint8,0), 'g':(numpy.uint8,1), 'b':(numpy.uint8,2),