Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-19 Thread Pierre GM
On Mar 18, 2010, at 4:12 PM, Eric Firing wrote: > Ryan May wrote: >> On Thu, Mar 18, 2010 at 2:46 PM, Christopher Barker >> wrote: >>> Gael Varoquaux wrote: On Thu, Mar 18, 2010 at 12:12:10PM -0700, Christopher Barker wrote: > sure -- that's kind of my point -- if EVERY numpy array were >

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-19 Thread Darren Dale
On Wed, Mar 17, 2010 at 10:16 PM, Charles R Harris wrote: > On Wed, Mar 17, 2010 at 7:39 PM, Darren Dale wrote: >> On Wed, Mar 17, 2010 at 8:22 PM, Charles R Harris >> > What bothers me here is the opposing desire to separate ufuncs from >> > their >> > ndarray dependency, having them operate on

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-18 Thread josef . pktd
On Thu, Mar 18, 2010 at 7:26 PM, Christopher Barker wrote: > josef.p...@gmail.com wrote: >>> I'm facing this at the moment: not a big deal, but I'm using histogram2d >>> on some data. I just realized that it may have some NaNs in it, and I >>> have no idea how those are being handled. > >> histogr

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-18 Thread Christopher Barker
josef.p...@gmail.com wrote: >> I'm facing this at the moment: not a big deal, but I'm using histogram2d >> on some data. I just realized that it may have some NaNs in it, and I >> have no idea how those are being handled. > histogram2d handles neither masked arrays nor arrays with nans > correctly

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-18 Thread Darren Dale
On Thu, Mar 18, 2010 at 5:12 PM, Eric Firing wrote: > Ryan May wrote: >> On Thu, Mar 18, 2010 at 2:46 PM, Christopher Barker >> wrote: >>> Gael Varoquaux wrote: On Thu, Mar 18, 2010 at 12:12:10PM -0700, Christopher Barker wrote: > sure -- that's kind of my point -- if EVERY numpy array w

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-18 Thread Eric Firing
Ryan May wrote: > On Thu, Mar 18, 2010 at 2:46 PM, Christopher Barker > wrote: >> Gael Varoquaux wrote: >>> On Thu, Mar 18, 2010 at 12:12:10PM -0700, Christopher Barker wrote: sure -- that's kind of my point -- if EVERY numpy array were (potentially) masked, then folks would write code t

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-18 Thread josef . pktd
On Thu, Mar 18, 2010 at 3:46 PM, Christopher Barker wrote: > Gael Varoquaux wrote: >> On Thu, Mar 18, 2010 at 12:12:10PM -0700, Christopher Barker wrote: >>> sure -- that's kind of my point -- if EVERY numpy array were >>> (potentially) masked, then folks would write code to deal with them >>> app

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-18 Thread Ryan May
On Thu, Mar 18, 2010 at 2:46 PM, Christopher Barker wrote: > Gael Varoquaux wrote: >> On Thu, Mar 18, 2010 at 12:12:10PM -0700, Christopher Barker wrote: >>> sure -- that's kind of my point -- if EVERY numpy array were >>> (potentially) masked, then folks would write code to deal with them >>> app

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-18 Thread Christopher Barker
Gael Varoquaux wrote: > On Thu, Mar 18, 2010 at 12:12:10PM -0700, Christopher Barker wrote: >> sure -- that's kind of my point -- if EVERY numpy array were >> (potentially) masked, then folks would write code to deal with them >> appropriately. > > That's pretty much saying: "I have a complicate

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-18 Thread josef . pktd
On Thu, Mar 18, 2010 at 3:19 PM, Gael Varoquaux wrote: > On Thu, Mar 18, 2010 at 12:12:10PM -0700, Christopher Barker wrote: >> sure -- that's kind of my point -- if EVERY numpy array were >> (potentially) masked, then folks would write code to deal with them >> appropriately. > > That's pretty mu

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-18 Thread Gael Varoquaux
On Thu, Mar 18, 2010 at 12:12:10PM -0700, Christopher Barker wrote: > sure -- that's kind of my point -- if EVERY numpy array were > (potentially) masked, then folks would write code to deal with them > appropriately. That's pretty much saying: "I have a complicated problem and I want every one

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-18 Thread Christopher Barker
josef.p...@gmail.com wrote: > On Wed, Mar 17, 2010 at 3:12 PM, Christopher Barker >> Given all the limitations of NaN, having a masked >> array is a better way to go, but I'd love it if they were "just there", >> and therefore EVERY numpy function and package built on numpy would >> handle them gr

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-18 Thread Pierre GM
On Mar 18, 2010, at 11:03 AM, Bruce Southey wrote: > On 03/17/2010 04:20 PM, Pierre GM wrote: >> On Mar 17, 2010, at 11:09 AM, Bruce Southey wrote: >> >>> On 03/17/2010 01:07 AM, Pierre GM wrote: >>> All, As you're probably aware, the current test suite for numpy.ma raises some na

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-18 Thread Pierre GM
On Mar 17, 2010, at 9:16 PM, Charles R Harris wrote: > > > On Wed, Mar 17, 2010 at 7:39 PM, Darren Dale wrote: > On Wed, Mar 17, 2010 at 8:22 PM, Charles R Harris > wrote: > > > > What bothers me here is the opposing desire to separate ufuncs from their > > ndarray dependency, having them opera

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-18 Thread Bruce Southey
On 03/17/2010 04:20 PM, Pierre GM wrote: > On Mar 17, 2010, at 11:09 AM, Bruce Southey wrote: > >> On 03/17/2010 01:07 AM, Pierre GM wrote: >> >>> All, >>> As you're probably aware, the current test suite for numpy.ma raises some >>> nagging warnings such as "invalid value in ...". These

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-18 Thread Pierre GM
On Mar 17, 2010, at 5:43 PM, Charles R Harris wrote: > > > > On Wed, Mar 17, 2010 at 3:13 PM, Darren Dale wrote: > On Wed, Mar 17, 2010 at 4:48 PM, Pierre GM wrote: > > On Mar 17, 2010, at 8:19 AM, Darren Dale wrote: > >> > >> I started thinking about a third method called __input_prepare__ th

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-18 Thread Pierre GM
On Mar 17, 2010, at 3:18 PM, josef.p...@gmail.com wrote: > On Wed, Mar 17, 2010 at 3:12 PM, Christopher Barker > wrote: >> >> One of the things I liked about MATLAB was that NaNs were well handled >> almost all the time. Given all the limitations of NaN, having a masked >> array is a better way t

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-18 Thread Pierre GM
On Mar 17, 2010, at 11:09 AM, Bruce Southey wrote: > On 03/17/2010 01:07 AM, Pierre GM wrote: >> All, >> As you're probably aware, the current test suite for numpy.ma raises some >> nagging warnings such as "invalid value in ...". These warnings are only >> issued when a standard numpy ufunc (eg.

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-17 Thread Charles R Harris
On Wed, Mar 17, 2010 at 7:39 PM, Darren Dale wrote: > On Wed, Mar 17, 2010 at 8:22 PM, Charles R Harris > wrote: > > > > > > On Wed, Mar 17, 2010 at 5:26 PM, Darren Dale wrote: > >> > >> On Wed, Mar 17, 2010 at 5:43 PM, Charles R Harris > >> wrote: > >> > On Wed, Mar 17, 2010 at 3:13 PM, Darre

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-17 Thread Darren Dale
On Wed, Mar 17, 2010 at 8:22 PM, Charles R Harris wrote: > > > On Wed, Mar 17, 2010 at 5:26 PM, Darren Dale wrote: >> >> On Wed, Mar 17, 2010 at 5:43 PM, Charles R Harris >> wrote: >> > On Wed, Mar 17, 2010 at 3:13 PM, Darren Dale wrote: >> >> On Wed, Mar 17, 2010 at 4:48 PM, Pierre GM >> >> w

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-17 Thread Charles R Harris
On Wed, Mar 17, 2010 at 5:26 PM, Darren Dale wrote: > On Wed, Mar 17, 2010 at 5:43 PM, Charles R Harris > wrote: > > On Wed, Mar 17, 2010 at 3:13 PM, Darren Dale wrote: > >> On Wed, Mar 17, 2010 at 4:48 PM, Pierre GM > wrote: > >> > On Mar 17, 2010, at 8:19 AM, Darren Dale wrote: > >> >> > >>

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-17 Thread Darren Dale
On Wed, Mar 17, 2010 at 5:43 PM, Charles R Harris wrote: > On Wed, Mar 17, 2010 at 3:13 PM, Darren Dale wrote: >> On Wed, Mar 17, 2010 at 4:48 PM, Pierre GM wrote: >> > On Mar 17, 2010, at 8:19 AM, Darren Dale wrote: >> >> >> >> I started thinking about a third method called __input_prepare__ th

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-17 Thread Charles R Harris
On Wed, Mar 17, 2010 at 3:13 PM, Darren Dale wrote: > On Wed, Mar 17, 2010 at 4:48 PM, Pierre GM wrote: > > On Mar 17, 2010, at 8:19 AM, Darren Dale wrote: > >> > >> I started thinking about a third method called __input_prepare__ that > >> would be called on the way into the ufunc, which would

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-17 Thread Darren Dale
On Wed, Mar 17, 2010 at 4:48 PM, Pierre GM wrote: > On Mar 17, 2010, at 8:19 AM, Darren Dale wrote: >> >> I started thinking about a third method called __input_prepare__ that >> would be called on the way into the ufunc, which would allow you to >> intercept the input and pass a somehow modified

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-17 Thread Pierre GM
On Mar 17, 2010, at 8:19 AM, Darren Dale wrote: > > I started thinking about a third method called __input_prepare__ that > would be called on the way into the ufunc, which would allow you to > intercept the input and pass a somehow modified copy back to the > ufunc. The total flow would be: > >

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-17 Thread josef . pktd
On Wed, Mar 17, 2010 at 3:12 PM, Christopher Barker wrote: > Eric Firing wrote: >> My motivation for going >> to the C level was speed and control; many ma operations are very slow >> compared to their numpy counterparts, and moving the mask handling to C >> can erase nearly all of this penalty. >

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-17 Thread Christopher Barker
Eric Firing wrote: > My motivation for going > to the C level was speed and control; many ma operations are very slow > compared to their numpy counterparts, and moving the mask handling to C > can erase nearly all of this penalty. really? very cool. I was thinking about this the other day, and

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-17 Thread Eric Firing
Charles R Harris wrote: > > > On Wed, Mar 17, 2010 at 6:19 AM, Darren Dale > wrote: > > On Wed, Mar 17, 2010 at 2:07 AM, Pierre GM > wrote: > > All, > > As you're probably aware, the current test suite for numpy.ma >

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-17 Thread Darren Dale
On Wed, Mar 17, 2010 at 10:45 AM, Charles R Harris wrote: > > > On Wed, Mar 17, 2010 at 6:19 AM, Darren Dale wrote: >> >> On Wed, Mar 17, 2010 at 2:07 AM, Pierre GM wrote: >> > All, >> > As you're probably aware, the current test suite for numpy.ma raises >> > some nagging warnings such as "inva

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-17 Thread Ryan May
On Wed, Mar 17, 2010 at 9:20 AM, Darren Dale wrote: > On Wed, Mar 17, 2010 at 10:11 AM, Ryan May wrote: >> On Wed, Mar 17, 2010 at 7:19 AM, Darren Dale wrote: >>> Is this general enough for your use case? I haven't tried to think >>> about how to change some global state at one point and change

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-17 Thread Bruce Southey
On 03/17/2010 01:07 AM, Pierre GM wrote: > All, > As you're probably aware, the current test suite for numpy.ma raises some > nagging warnings such as "invalid value in ...". These warnings are only > issued when a standard numpy ufunc (eg., np.sqrt) is called on a MaskedArray, > instead of its

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-17 Thread Charles R Harris
On Wed, Mar 17, 2010 at 6:19 AM, Darren Dale wrote: > On Wed, Mar 17, 2010 at 2:07 AM, Pierre GM wrote: > > All, > > As you're probably aware, the current test suite for numpy.ma raises > some nagging warnings such as "invalid value in ...". These warnings are > only issued when a standard numpy

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-17 Thread Darren Dale
On Wed, Mar 17, 2010 at 10:11 AM, Ryan May wrote: > On Wed, Mar 17, 2010 at 7:19 AM, Darren Dale wrote: >> Is this general enough for your use case? I haven't tried to think >> about how to change some global state at one point and change it back >> at another, that seems like a bad idea and diff

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-17 Thread Ryan May
On Wed, Mar 17, 2010 at 7:19 AM, Darren Dale wrote: > Is this general enough for your use case? I haven't tried to think > about how to change some global state at one point and change it back > at another, that seems like a bad idea and difficult to support. Sounds like the textbook use case for

Re: [Numpy-discussion] Warnings in numpy.ma.test()

2010-03-17 Thread Darren Dale
On Wed, Mar 17, 2010 at 2:07 AM, Pierre GM wrote: > All, > As you're probably aware, the current test suite for numpy.ma raises some > nagging warnings such as "invalid value in ...". These warnings are only > issued when a standard numpy ufunc (eg., np.sqrt) is called on a MaskedArray, > inste

[Numpy-discussion] Warnings in numpy.ma.test()

2010-03-16 Thread Pierre GM
All, As you're probably aware, the current test suite for numpy.ma raises some nagging warnings such as "invalid value in ...". These warnings are only issued when a standard numpy ufunc (eg., np.sqrt) is called on a MaskedArray, instead of its numpy.ma (eg., np.ma.sqrt) equivalent. The reason i