Re: [Numpy-discussion] better error message possible?

2012-06-07 Thread Travis Vaught
On Jun 7, 2012, at 4:32 AM, Paul Anton Letnes wrote: > > On 7. juni 2012, at 10:30, Thouis (Ray) Jones wrote: > >> I've opened a PR at https://github.com/numpy/numpy/pull/296 for discussion. >> >> A typical result >> > np.zeros((3,3))[[1,2,3]] >> Traceback (most recent call last): >> File

Re: [Numpy-discussion] better error message possible?

2012-06-07 Thread Thouis (Ray) Jones
On Thu, Jun 7, 2012 at 11:44 AM, Dave Hirschfeld wrote: > Paul Anton Letnes gmail.com> writes: > >> I would prefer: >> IndexError: index 3 is out of bounds for axis 0: [-3,2] >> as I find the 3) notation a bit weird - after all, indices are not floats, so > 2.999 or 2.3 doesn't make sense as >> a

Re: [Numpy-discussion] better error message possible?

2012-06-07 Thread Dave Hirschfeld
Paul Anton Letnes gmail.com> writes: > I would prefer: > IndexError: index 3 is out of bounds for axis 0: [-3,2] > as I find the 3) notation a bit weird - after all, indices are not floats, so 2.999 or 2.3 doesn't make sense as > an index. > > An alternative is to not refer to negative indices

Re: [Numpy-discussion] better error message possible?

2012-06-07 Thread Paul Anton Letnes
On 7. juni 2012, at 10:30, Thouis (Ray) Jones wrote: > I've opened a PR at https://github.com/numpy/numpy/pull/296 for discussion. > > A typical result > np.zeros((3,3))[[1,2,3]] > Traceback (most recent call last): > File "", line 1, in > IndexError: index 3 is out of bounds for axis 0:

Re: [Numpy-discussion] better error message possible?

2012-06-07 Thread Thouis (Ray) Jones
I've opened a PR at https://github.com/numpy/numpy/pull/296 for discussion. A typical result >>> np.zeros((3,3))[[1,2,3]] Traceback (most recent call last): File "", line 1, in IndexError: index 3 is out of bounds for axis 0: [-3,3) Ray Jones ___ Nu

Re: [Numpy-discussion] better error message possible?

2012-06-05 Thread Thouis Jones
On Tue, Jun 5, 2012 at 12:15 PM, Thouis Jones wrote: > On Mon, Jun 4, 2012 at 11:49 PM, Nathaniel Smith wrote: >> On Mon, Jun 4, 2012 at 10:00 PM, Thouis (Ray) Jones wrote: >>> On Mon, Jun 4, 2012 at 4:27 PM, Thouis (Ray) Jones wrote: I could look into this.  There are only ~10 places the

Re: [Numpy-discussion] better error message possible?

2012-06-05 Thread Thouis Jones
On Mon, Jun 4, 2012 at 11:49 PM, Nathaniel Smith wrote: > On Mon, Jun 4, 2012 at 10:00 PM, Thouis (Ray) Jones wrote: >> On Mon, Jun 4, 2012 at 4:27 PM, Thouis (Ray) Jones wrote: >>> I could look into this.  There are only ~10 places the code generates >>> this error, so it should be a pretty min

Re: [Numpy-discussion] better error message possible?

2012-06-04 Thread Nathaniel Smith
On Mon, Jun 4, 2012 at 10:00 PM, Thouis (Ray) Jones wrote: > On Mon, Jun 4, 2012 at 4:27 PM, Thouis (Ray) Jones wrote: >> I could look into this.  There are only ~10 places the code generates >> this error, so it should be a pretty minor change. > > My initial estimate was low, but not overly so.

Re: [Numpy-discussion] better error message possible?

2012-06-04 Thread Thouis (Ray) Jones
On Mon, Jun 4, 2012 at 4:27 PM, Thouis (Ray) Jones wrote: > On Fri, Jun 1, 2012 at 6:56 PM, Chris Withers wrote: >> On 01/06/2012 16:39, Benjamin Root wrote: >>> >>> >>>      > >>> import numpy >>>      > >>> numpy.zeros(10)[-123] >>>      > Traceback (most recent call last): >>>      >   File ""

Re: [Numpy-discussion] better error message possible?

2012-06-04 Thread Paul Anton Letnes
On 4. juni 2012, at 16:27, Thouis (Ray) Jones wrote: > On Fri, Jun 1, 2012 at 6:56 PM, Chris Withers wrote: >> On 01/06/2012 16:39, Benjamin Root wrote: >>> >>> >>> > >>> import numpy >>> > >>> numpy.zeros(10)[-123] >>> > Traceback (most recent call last): >>> > File "",

Re: [Numpy-discussion] better error message possible?

2012-06-04 Thread Thouis (Ray) Jones
On Fri, Jun 1, 2012 at 6:56 PM, Chris Withers wrote: > On 01/06/2012 16:39, Benjamin Root wrote: >> >> >>      > >>> import numpy >>      > >>> numpy.zeros(10)[-123] >>      > Traceback (most recent call last): >>      >   File "", line 1, in >>      > IndexError: index out of bounds >>      > >>

Re: [Numpy-discussion] better error message possible?

2012-06-03 Thread Charles R Harris
On Fri, Jun 1, 2012 at 10:56 AM, Chris Withers wrote: > On 01/06/2012 16:39, Benjamin Root wrote: > > > > > > > >>> import numpy > > > >>> numpy.zeros(10)[-123] > > > Traceback (most recent call last): > > > File "", line 1, in > > > IndexError: index out of bounds > >

Re: [Numpy-discussion] better error message possible?

2012-06-01 Thread Chris Withers
On 01/06/2012 16:39, Benjamin Root wrote: > > > > >>> import numpy > > >>> numpy.zeros(10)[-123] > > Traceback (most recent call last): > > File "", line 1, in > > IndexError: index out of bounds > > > > ...could say this: > > > > >>> numpy.zeros(10)[

Re: [Numpy-discussion] better error message possible?

2012-06-01 Thread Chris Barker
>> On Fri, Jun 1, 2012 at 10:46 AM, Chris Withers >> > Any reason why this: >> > >> >  >>> import numpy >> >  >>> numpy.zeros(10)[-123] >> > Traceback (most recent call last): >> >   File "", line 1, in >> > IndexError: index out of bounds >> > >> > ...could say this: >> > >> >  >>> numpy.zeros(

Re: [Numpy-discussion] better error message possible?

2012-06-01 Thread Benjamin Root
On Fri, Jun 1, 2012 at 9:14 AM, Nathaniel Smith wrote: > On Fri, Jun 1, 2012 at 10:46 AM, Chris Withers > wrote: > > Hi All, > > > > Any reason why this: > > > > >>> import numpy > > >>> numpy.zeros(10)[-123] > > Traceback (most recent call last): > > File "", line 1, in > > IndexError: ind

Re: [Numpy-discussion] better error message possible?

2012-06-01 Thread Nathaniel Smith
On Fri, Jun 1, 2012 at 10:46 AM, Chris Withers wrote: > Hi All, > > Any reason why this: > >  >>> import numpy >  >>> numpy.zeros(10)[-123] > Traceback (most recent call last): >   File "", line 1, in > IndexError: index out of bounds > > ...could say this: > >  >>> numpy.zeros(10)[-123] > Traceb

[Numpy-discussion] better error message possible?

2012-06-01 Thread Chris Withers
Hi All, Any reason why this: >>> import numpy >>> numpy.zeros(10)[-123] Traceback (most recent call last): File "", line 1, in IndexError: index out of bounds ...could say this: >>> numpy.zeros(10)[-123] Traceback (most recent call last): File "", line 1, in IndexError: -123 is out o