Re: [Numpy-discussion] C++ Example

2012-03-03 Thread David Cournapeau
On Sat, Mar 3, 2012 at 8:07 AM, Luis Pedro Coelho wrote: > Hi, > > I sort of missed the big C++ discussion, but I'd like to give some examples of > how writing code can become much simpler if you are based on C++. This is from > my mahotas package, which has a thin C++ wrapper around numpy's C API

Re: [Numpy-discussion] Floating point "close" function?

2012-03-03 Thread Joe Kington
On Sat, Mar 3, 2012 at 12:50 PM, Olivier Delalleau wrote: > >> Would it be helpful if I went ahead and submitted a pull request with the >> function in my original question called "isclose" (along with a complete >> docstring and a few tests)? >> >> One note: >> At the moment, it deliberately com

Re: [Numpy-discussion] Missing data again

2012-03-03 Thread Skipper Seabold
On Sat, Mar 3, 2012 at 4:46 PM, Mark Wiebe wrote: > On Sat, Mar 3, 2012 at 12:30 PM, Travis Oliphant >> >>        * the reduction operations need to default to "skipna" --- this is >> the most common use case which has been re-inforced again to me today by a >> new user to Python who is using ma

Re: [Numpy-discussion] Missing data again

2012-03-03 Thread Travis Oliphant
> > Mind, Mark only had a few weeks to write code. I think the unfinished state > is a direct function of that. > > I have heard from several users that they will *not use the missing data* in > NumPy as currently implemented, and I can now see why.For better or for > worse, my approach t

Re: [Numpy-discussion] Missing data again

2012-03-03 Thread Charles R Harris
On Sat, Mar 3, 2012 at 1:30 PM, Travis Oliphant wrote: > Hi all, > > I've been thinking a lot about the masked array implementation lately. > I finally had the time to look hard at what has been done and now am of the > opinion that I do not think that 1.7 can be released with the current state >

Re: [Numpy-discussion] Missing data again

2012-03-03 Thread Ralf Gommers
On Sat, Mar 3, 2012 at 9:30 PM, Travis Oliphant wrote: > Hi all, > > I've been thinking a lot about the masked array implementation lately. > I finally had the time to look hard at what has been done and now am of the > opinion that I do not think that 1.7 can be released with the current state >

Re: [Numpy-discussion] Missing data again

2012-03-03 Thread Mark Wiebe
On Sat, Mar 3, 2012 at 12:30 PM, Travis Oliphant wrote: > > > First of all, I want to be clear that I think there is much great work > that has been done in the current missing data code. There are some nice > features in the where clause of the ufunc and the machinery for the > iterator that

[Numpy-discussion] Missing data again

2012-03-03 Thread Travis Oliphant
Hi all, I've been thinking a lot about the masked array implementation lately. I finally had the time to look hard at what has been done and now am of the opinion that I do not think that 1.7 can be released with the current state of the masked array implementation *unless* it is clearly m

Re: [Numpy-discussion] Floating point "close" function?

2012-03-03 Thread Olivier Delalleau
Le 3 mars 2012 13:07, Joe Kington a écrit : > > > On Sat, Mar 3, 2012 at 9:26 AM, Robert Kern wrote: > >> On Sat, Mar 3, 2012 at 15:22, Benjamin Root wrote: >> > >> > >> > On Saturday, March 3, 2012, Robert Kern wrote: >> >> On Sat, Mar 3, 2012 at 14:31, Ralf Gommers < >> ralf.gomm...@googlema

Re: [Numpy-discussion] Floating point "close" function?

2012-03-03 Thread Joe Kington
On Sat, Mar 3, 2012 at 9:26 AM, Robert Kern wrote: > On Sat, Mar 3, 2012 at 15:22, Benjamin Root wrote: > > > > > > On Saturday, March 3, 2012, Robert Kern wrote: > >> On Sat, Mar 3, 2012 at 14:31, Ralf Gommers > > >> wrote: > >>> > >>> > >>> On Sat, Mar 3, 2012 at 3:05 PM, Robert Kern > >>>

Re: [Numpy-discussion] Floating point "close" function?

2012-03-03 Thread Joe Kington
On Sat, Mar 3, 2012 at 10:06 AM, Olivier Delalleau wrote: > Le 3 mars 2012 11:03, Robert Kern a écrit : > >> On Sat, Mar 3, 2012 at 15:51, Olivier Delalleau wrote: >> > Le 3 mars 2012 10:27, Robert Kern a écrit : >> >> >> >> On Sat, Mar 3, 2012 at 14:34, Robert Kern >> wrote: >> >> > On Sat,

Re: [Numpy-discussion] Floating point "close" function?

2012-03-03 Thread Robert Kern
On Sat, Mar 3, 2012 at 16:06, Olivier Delalleau wrote: > Le 3 mars 2012 11:03, Robert Kern a écrit : >> >> On Sat, Mar 3, 2012 at 15:51, Olivier Delalleau wrote: >> > Le 3 mars 2012 10:27, Robert Kern a écrit : >> >> >> >> On Sat, Mar 3, 2012 at 14:34, Robert Kern >> >> wrote: >> >> > On Sat,

[Numpy-discussion] C++ Example

2012-03-03 Thread Luis Pedro Coelho
Hi, I sort of missed the big C++ discussion, but I'd like to give some examples of how writing code can become much simpler if you are based on C++. This is from my mahotas package, which has a thin C++ wrapper around numpy's C API https://github.com/luispedro/mahotas/blob/master/mahotas/_morph.c

Re: [Numpy-discussion] Floating point "close" function?

2012-03-03 Thread Olivier Delalleau
Le 3 mars 2012 11:03, Robert Kern a écrit : > On Sat, Mar 3, 2012 at 15:51, Olivier Delalleau wrote: > > Le 3 mars 2012 10:27, Robert Kern a écrit : > >> > >> On Sat, Mar 3, 2012 at 14:34, Robert Kern > wrote: > >> > On Sat, Mar 3, 2012 at 14:31, Ralf Gommers < > ralf.gomm...@googlemail.com> >

Re: [Numpy-discussion] Floating point "close" function?

2012-03-03 Thread Robert Kern
On Sat, Mar 3, 2012 at 15:51, Olivier Delalleau wrote: > Le 3 mars 2012 10:27, Robert Kern a écrit : >> >> On Sat, Mar 3, 2012 at 14:34, Robert Kern wrote: >> > On Sat, Mar 3, 2012 at 14:31, Ralf Gommers >> > wrote: >> >> >> Because this is also bad: >> > np. >> >> Display all 561 possibili

Re: [Numpy-discussion] Floating point "close" function?

2012-03-03 Thread Olivier Delalleau
Le 3 mars 2012 10:27, Robert Kern a écrit : > On Sat, Mar 3, 2012 at 14:34, Robert Kern wrote: > > On Sat, Mar 3, 2012 at 14:31, Ralf Gommers > wrote: > > >> Because this is also bad: > > np. > >> Display all 561 possibilities? (y or n) > > > > Not as bad as overloading np.allclose(x,y,retu

Re: [Numpy-discussion] Floating point "close" function?

2012-03-03 Thread Robert Kern
On Sat, Mar 3, 2012 at 14:34, Robert Kern wrote: > On Sat, Mar 3, 2012 at 14:31, Ralf Gommers > wrote: >> Because this is also bad: > np. >> Display all 561 possibilities? (y or n) > > Not as bad as overloading np.allclose(x,y,return_array=True). Or > deprecating np.allclose() in favor of n

Re: [Numpy-discussion] Floating point "close" function?

2012-03-03 Thread Robert Kern
On Sat, Mar 3, 2012 at 15:22, Benjamin Root wrote: > > > On Saturday, March 3, 2012, Robert Kern wrote: >> On Sat, Mar 3, 2012 at 14:31, Ralf Gommers >> wrote: >>> >>> >>> On Sat, Mar 3, 2012 at 3:05 PM, Robert Kern >>> wrote: On Sat, Mar 3, 2012 at 13:59, Ralf Gommers wrote: >>

Re: [Numpy-discussion] Floating point "close" function?

2012-03-03 Thread Benjamin Root
On Saturday, March 3, 2012, Robert Kern wrote: > On Sat, Mar 3, 2012 at 14:31, Ralf Gommers wrote: >> >> >> On Sat, Mar 3, 2012 at 3:05 PM, Robert Kern wrote: >>> >>> On Sat, Mar 3, 2012 at 13:59, Ralf Gommers >>> wrote: >>> > >>> > >>> > On Thu, Mar 1, 2012 at 11:44 PM, Joe Kington wrote: >>>

Re: [Numpy-discussion] Floating point "close" function?

2012-03-03 Thread Robert Kern
On Sat, Mar 3, 2012 at 14:31, Ralf Gommers wrote: > > > On Sat, Mar 3, 2012 at 3:05 PM, Robert Kern wrote: >> >> On Sat, Mar 3, 2012 at 13:59, Ralf Gommers >> wrote: >> > >> > >> > On Thu, Mar 1, 2012 at 11:44 PM, Joe Kington wrote: >> >> >> >> Is there a numpy function for testing floating poi

Re: [Numpy-discussion] Floating point "close" function?

2012-03-03 Thread Ralf Gommers
On Sat, Mar 3, 2012 at 3:05 PM, Robert Kern wrote: > On Sat, Mar 3, 2012 at 13:59, Ralf Gommers > wrote: > > > > > > On Thu, Mar 1, 2012 at 11:44 PM, Joe Kington wrote: > >> > >> Is there a numpy function for testing floating point equality that > returns > >> a boolean array? > >> > >> I'm awa

Re: [Numpy-discussion] Floating point "close" function?

2012-03-03 Thread Robert Kern
On Sat, Mar 3, 2012 at 13:59, Ralf Gommers wrote: > > > On Thu, Mar 1, 2012 at 11:44 PM, Joe Kington wrote: >> >> Is there a numpy function for testing floating point equality that returns >> a boolean array? >> >> I'm aware of np.allclose, but I need a boolean array.  Properly handling >> NaN's

Re: [Numpy-discussion] Floating point "close" function?

2012-03-03 Thread Ralf Gommers
On Thu, Mar 1, 2012 at 11:44 PM, Joe Kington wrote: > Is there a numpy function for testing floating point equality that returns > a boolean array? > > I'm aware of np.allclose, but I need a boolean array. Properly handling > NaN's and Inf's (as allclose does) would be a nice bonus. > > I wrote