Re: [Numpy-discussion] step paramter for linspace

2013-03-04 Thread Chris Barker - NOAA Federal
On Mar 1, 2013, at 8:39 AM, Henry Gomersall wrote: > On Fri, 2013-03-01 at 17:29 > Actually, I buy this could be useful. Yes, it could. How about a "farange", designed for floating point values -- I imagine someone smarter than me about for could write one that would guarantee that end-point w

Re: [Numpy-discussion] step paramter for linspace

2013-03-01 Thread Henry Gomersall
On Fri, 2013-03-01 at 17:29 +0100, Sebastian Berg wrote: > At this time it seems there is more sentiment against it and that is > fine with me. I thought it might be useful for some who normally want > the linspace behavior, but do not want to worry about the right num in > some cases. Someone who

Re: [Numpy-discussion] step paramter for linspace

2013-03-01 Thread Sebastian Berg
On Fri, 2013-03-01 at 10:49 -0500, Alan G Isaac wrote: > One motivation of this thread was that > adding a step parameter to linspace might make > things easier for beginners. > > I claim this thread has put the lie to that, > starting with the initial post. So what is the > persuasive case for t

Re: [Numpy-discussion] step paramter for linspace

2013-03-01 Thread Alan G Isaac
One motivation of this thread was that adding a step parameter to linspace might make things easier for beginners. I claim this thread has put the lie to that, starting with the initial post. So what is the persuasive case for the change? Imo, the current situation is good: use arange if you wan

Re: [Numpy-discussion] step paramter for linspace

2013-03-01 Thread Sebastian Berg
On Fri, 2013-03-01 at 15:07 +, Henry Gomersall wrote: > On Fri, 2013-03-01 at 10:01 -0500, Alan G Isaac wrote: > > On 3/1/2013 9:32 AM, Henry Gomersall wrote: > > > there should be an equivalent for floats that > > > unambiguously returns a range for the half open interval > > > > > > If I've

Re: [Numpy-discussion] step paramter for linspace

2013-03-01 Thread Henry Gomersall
On Fri, 2013-03-01 at 10:01 -0500, Alan G Isaac wrote: > On 3/1/2013 9:32 AM, Henry Gomersall wrote: > > there should be an equivalent for floats that > > unambiguously returns a range for the half open interval > > > If I've understood you: > start + stepsize*np.arange(nsteps) yes, except that

Re: [Numpy-discussion] step paramter for linspace

2013-03-01 Thread Alan G Isaac
On 3/1/2013 9:32 AM, Henry Gomersall wrote: > there should be an equivalent for floats that > unambiguously returns a range for the half open interval If I've understood you: start + stepsize*np.arange(nsteps) fwiw, Alan Isaac ___ NumPy-Discussion mai

Re: [Numpy-discussion] step paramter for linspace

2013-03-01 Thread Sebastian Berg
On Fri, 2013-03-01 at 13:34 +, Nathaniel Smith wrote: > On Fri, Mar 1, 2013 at 12:33 PM, Henry Gomersall wrote: > > On Fri, 2013-03-01 at 13:25 +0100, Sebastian Berg wrote: > >> there has been a request on the issue tracker for a step parameter to > >> linspace. This is of course tricky with t

Re: [Numpy-discussion] step paramter for linspace

2013-03-01 Thread Henry Gomersall
On Fri, 2013-03-01 at 14:32 +, Henry Gomersall wrote: > I'll assert then that there should be an equivalent for floats that > unambiguously returns a range for the half open interval. IMO this is > more useful than a hacky version of linspace. And, no, I haven't thought carefully about how to

Re: [Numpy-discussion] step paramter for linspace

2013-03-01 Thread Henry Gomersall
On Fri, 2013-03-01 at 09:24 -0500, Warren Weckesser wrote: > > In my jet-lag addled state, i can't see when this out[-1] > stop > case > > will occur, but I can take it as true. It does seem to be > problematic > > though. > > > Here you go: > > In [32]: end = 2.2 > > In [33]: x = arange(0.1, e

Re: [Numpy-discussion] step paramter for linspace

2013-03-01 Thread Warren Weckesser
On 3/1/13, Henry Gomersall wrote: > On Fri, 2013-03-01 at 13:34 +, Nathaniel Smith wrote: >> > My usual hack to deal with the numerical bounds issue is to >> add/subtract >> > half the step. >> >> Right. Which is exactly the sort of annoying, content-free code that a >> library is supposed to

Re: [Numpy-discussion] step paramter for linspace

2013-03-01 Thread Henry Gomersall
On Fri, 2013-03-01 at 13:34 +, Nathaniel Smith wrote: > > My usual hack to deal with the numerical bounds issue is to > add/subtract > > half the step. > > Right. Which is exactly the sort of annoying, content-free code that a > library is supposed to handle for you, so you can save mental ene

Re: [Numpy-discussion] step paramter for linspace

2013-03-01 Thread Nathaniel Smith
On Fri, Mar 1, 2013 at 12:33 PM, Henry Gomersall wrote: > On Fri, 2013-03-01 at 13:25 +0100, Sebastian Berg wrote: >> there has been a request on the issue tracker for a step parameter to >> linspace. This is of course tricky with the imprecision of floating >> point numbers. > > How is that diffe

Re: [Numpy-discussion] step paramter for linspace

2013-03-01 Thread Sebastian Berg
On Fri, 2013-03-01 at 13:44 +0100, Sebastian Berg wrote: > On Fri, 2013-03-01 at 12:33 +, Henry Gomersall wrote: > > On Fri, 2013-03-01 at 13:25 +0100, Sebastian Berg wrote: > > > there has been a request on the issue tracker for a step parameter to > > > linspace. This is of course tricky with

Re: [Numpy-discussion] step paramter for linspace

2013-03-01 Thread Sebastian Berg
On Fri, 2013-03-01 at 12:33 +, Henry Gomersall wrote: > On Fri, 2013-03-01 at 13:25 +0100, Sebastian Berg wrote: > > there has been a request on the issue tracker for a step parameter to > > linspace. This is of course tricky with the imprecision of floating > > point numbers. > > How is that

Re: [Numpy-discussion] step paramter for linspace

2013-03-01 Thread Henry Gomersall
On Fri, 2013-03-01 at 13:25 +0100, Sebastian Berg wrote: > there has been a request on the issue tracker for a step parameter to > linspace. This is of course tricky with the imprecision of floating > point numbers. How is that different to arange? Either you specify the number of points with lins

[Numpy-discussion] step paramter for linspace

2013-03-01 Thread Sebastian Berg
Hi, there has been a request on the issue tracker for a step parameter to linspace. This is of course tricky with the imprecision of floating point numbers. As a trade off, I was thinking of a step parameter that is used to calculate the integer number of steps. However to be certain that it neve