Re: [Numpy-discussion] linspace handling of extra return

2015-01-14 Thread Chris Barker
On Tue, Jan 13, 2015 at 6:02 PM, Benjamin Root wrote: > So, raise a ValueError when it used to return (mostly) correct results? > my understanding is that it was NOT returning mostly correct results, it was returning completely different results for those special values: a 2-tuple in most cases,

Re: [Numpy-discussion] linspace handling of extra return

2015-01-14 Thread Charles R Harris
On Tue, Jan 13, 2015 at 7:02 PM, Benjamin Root wrote: > So, raise a ValueError when it used to return (mostly) correct results? > For some reason, I don't think people would appreciate that. > > Ben Root > On Jan 13, 2015 5:59 PM, "Chris Barker" wrote: > >> On Tue, Jan 13, 2015 at 7:23 AM, Benja

Re: [Numpy-discussion] linspace handling of extra return

2015-01-13 Thread Benjamin Root
So, raise a ValueError when it used to return (mostly) correct results? For some reason, I don't think people would appreciate that. Ben Root On Jan 13, 2015 5:59 PM, "Chris Barker" wrote: > On Tue, Jan 13, 2015 at 7:23 AM, Benjamin Root wrote: > >> Oh, wow. I never noticed that before. Yeah, i

Re: [Numpy-discussion] linspace handling of extra return

2015-01-13 Thread Chris Barker
On Tue, Jan 13, 2015 at 7:23 AM, Benjamin Root wrote: > Oh, wow. I never noticed that before. Yeah, if I state that retstep=True, > then I am coding my handling to expect two values to be returned, not 1. I > think it should be nan, but I could also agree with zero. It should > definitely remain

Re: [Numpy-discussion] linspace handling of extra return

2015-01-13 Thread Jaime Fernández del Río
On Tue, Jan 13, 2015 at 7:23 AM, Benjamin Root wrote: > Oh, wow. I never noticed that before. Yeah, if I state that retstep=True, > then I am coding my handling to expect two values to be returned, not 1. I > think it should be nan, but I could also agree with zero. It should > definitely remain

Re: [Numpy-discussion] linspace handling of extra return

2015-01-13 Thread Benjamin Root
Oh, wow. I never noticed that before. Yeah, if I state that retstep=True, then I am coding my handling to expect two values to be returned, not 1. I think it should be nan, but I could also agree with zero. It should definitely remain a float value, though. Cheers! Ben Root On Tue, Jan 13, 2015 a

[Numpy-discussion] linspace handling of extra return

2015-01-13 Thread Jaime Fernández del Río
While working on something else, I realized that linspace is not handling requests for returning the sampling spacing consistently: >>> np.linspace(0, 1, 3, retstep=True) (array([ 0. , 0.5, 1. ]), 0.5) >>> np.linspace(0, 1, 1, retstep=True) array([ 0.]) >>> np.linspace(0, 1, 0, retstep=True) arr