Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy > 1.5.1

2011-04-13 Thread Mark Wiebe
On Wed, Apr 13, 2011 at 3:34 PM, Mark Wiebe wrote: > On Tue, Apr 12, 2011 at 11:51 AM, Mark Wiebe wrote: > >> >> > here's the rule for a set of arbitrary arrays (not necessarily just 2): >> >> - if all the arrays are scalars, do type promotion on the types as is >> - otherwise, do type promoti

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy > 1.5.1

2011-04-13 Thread Mark Wiebe
On Tue, Apr 12, 2011 at 11:51 AM, Mark Wiebe wrote: > > here's the rule for a set of arbitrary arrays (not necessarily just 2): > > - if all the arrays are scalars, do type promotion on the types as is > - otherwise, do type promotion on min_scalar_type(a) of each array a > > The function min_sc

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy > 1.5.1

2011-04-12 Thread Robert Kern
On Tue, Apr 12, 2011 at 13:17, Charles R Harris wrote: > > > On Tue, Apr 12, 2011 at 11:56 AM, Robert Kern wrote: >> >> On Tue, Apr 12, 2011 at 12:27, Charles R Harris >> wrote: >> >> > IIRC, the behavior with respect to scalars sort of happened in the code >> > on >> > the fly, so this is a goo

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy > 1.5.1

2011-04-12 Thread Robert Kern
On Tue, Apr 12, 2011 at 11:49, Mark Wiebe wrote: > On Tue, Apr 12, 2011 at 9:30 AM, Robert Kern wrote: >> You're missing the key part of the rule that numpy uses: for >> array*scalar cases, when both array and scalar are the same kind (both >> floating point or both integers), then the array dty

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy > 1.5.1

2011-04-12 Thread Mark Wiebe
On Tue, Apr 12, 2011 at 11:17 AM, Charles R Harris < charlesr.har...@gmail.com> wrote: > > > On Tue, Apr 12, 2011 at 11:56 AM, Robert Kern wrote: > >> On Tue, Apr 12, 2011 at 12:27, Charles R Harris >> wrote: >> >> > IIRC, the behavior with respect to scalars sort of happened in the code >> on >>

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy > 1.5.1

2011-04-12 Thread Charles R Harris
On Tue, Apr 12, 2011 at 11:56 AM, Robert Kern wrote: > On Tue, Apr 12, 2011 at 12:27, Charles R Harris > wrote: > > > IIRC, the behavior with respect to scalars sort of happened in the code > on > > the fly, so this is a good discussion to have. We should end up with > > documented rules and tes

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy > 1.5.1

2011-04-12 Thread Robert Kern
On Tue, Apr 12, 2011 at 12:27, Charles R Harris wrote: > IIRC, the behavior with respect to scalars sort of happened in the code on > the fly, so this is a good discussion to have. We should end up with > documented rules and tests to enforce them. I agree with Mark that the tests > have been def

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy > 1.5.1

2011-04-12 Thread Charles R Harris
On Tue, Apr 12, 2011 at 10:20 AM, Mark Wiebe wrote: > On Tue, Apr 12, 2011 at 8:24 AM, Robert Kern wrote: > >> On Mon, Apr 11, 2011 at 23:43, Mark Wiebe wrote: >> > On Mon, Apr 11, 2011 at 8:48 PM, Travis Oliphant < >> oliph...@enthought.com> >> > wrote: >> >> >> It would be good to see a simple

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy > 1.5.1

2011-04-12 Thread Charles R Harris
On Tue, Apr 12, 2011 at 10:49 AM, Mark Wiebe wrote: > On Tue, Apr 12, 2011 at 9:30 AM, Robert Kern wrote: > >> On Tue, Apr 12, 2011 at 11:20, Mark Wiebe wrote: >> > On Tue, Apr 12, 2011 at 8:24 AM, Robert Kern >> wrote: >> >> >> >> On Mon, Apr 11, 2011 at 23:43, Mark Wiebe wrote: >> >> > On Mo

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy > 1.5.1

2011-04-12 Thread Mark Wiebe
On Tue, Apr 12, 2011 at 9:30 AM, Robert Kern wrote: > On Tue, Apr 12, 2011 at 11:20, Mark Wiebe wrote: > > On Tue, Apr 12, 2011 at 8:24 AM, Robert Kern > wrote: > >> > >> On Mon, Apr 11, 2011 at 23:43, Mark Wiebe wrote: > >> > On Mon, Apr 11, 2011 at 8:48 PM, Travis Oliphant > >> > > >> > wro

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy > 1.5.1

2011-04-12 Thread Robert Kern
On Tue, Apr 12, 2011 at 11:20, Mark Wiebe wrote: > On Tue, Apr 12, 2011 at 8:24 AM, Robert Kern wrote: >> >> On Mon, Apr 11, 2011 at 23:43, Mark Wiebe wrote: >> > On Mon, Apr 11, 2011 at 8:48 PM, Travis Oliphant >> > >> > wrote: >> >> >> It would be good to see a simple test case and understand

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy > 1.5.1

2011-04-12 Thread Mark Wiebe
On Tue, Apr 12, 2011 at 8:24 AM, Robert Kern wrote: > On Mon, Apr 11, 2011 at 23:43, Mark Wiebe wrote: > > On Mon, Apr 11, 2011 at 8:48 PM, Travis Oliphant > > > wrote: > > >> It would be good to see a simple test case and understand why the > boolean > >> multiplied by the scalar double is bec

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy > 1.5.1

2011-04-12 Thread Robert Kern
On Mon, Apr 11, 2011 at 23:43, Mark Wiebe wrote: > On Mon, Apr 11, 2011 at 8:48 PM, Travis Oliphant > wrote: >> It would be good to see a simple test case and understand why the boolean >> multiplied by the scalar double is becoming a float16.     In other words, >>  why does >> (1-test)*t >> re

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy > 1.5.1

2011-04-11 Thread Mark Wiebe
On Mon, Apr 11, 2011 at 8:48 PM, Travis Oliphant wrote: > > On Apr 11, 2011, at 3:55 PM, Charles R Harris wrote: > > I agree with Charles. Let's take the needed time and work this through. > This is the sort of thing I was a bit nervous about with the changes made to > the casting rules.Rig

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy > 1.5.1

2011-04-11 Thread Travis Oliphant
On Apr 11, 2011, at 3:55 PM, Charles R Harris wrote: > > > On Mon, Apr 11, 2011 at 2:31 PM, Mark Wiebe wrote: > On Mon, Apr 11, 2011 at 12:37 PM, Robert Kern wrote: > On Mon, Apr 11, 2011 at 13:54, Skipper Seabold wrote: > > All, > > > > We noticed some failing tests for statsmodels between

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy > 1.5.1

2011-04-11 Thread Charles R Harris
On Mon, Apr 11, 2011 at 2:31 PM, Mark Wiebe wrote: > On Mon, Apr 11, 2011 at 12:37 PM, Robert Kern wrote: > >> On Mon, Apr 11, 2011 at 13:54, Skipper Seabold >> wrote: >> > All, >> > >> > We noticed some failing tests for statsmodels between numpy 1.5.1 and >> > numpy >= 1.6.0. These are the ver

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy > 1.5.1

2011-04-11 Thread Mark Wiebe
On Mon, Apr 11, 2011 at 12:37 PM, Robert Kern wrote: > On Mon, Apr 11, 2011 at 13:54, Skipper Seabold > wrote: > > All, > > > > We noticed some failing tests for statsmodels between numpy 1.5.1 and > > numpy >= 1.6.0. These are the versions where I noticed the change. It > > seems that when you

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy > 1.5.1

2011-04-11 Thread Charles R Harris
On Mon, Apr 11, 2011 at 12:54 PM, Skipper Seabold wrote: > All, > > We noticed some failing tests for statsmodels between numpy 1.5.1 and > numpy >= 1.6.0. These are the versions where I noticed the change. It > seems that when you divide a float array and multiply by a boolean > array the answers

Re: [Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy > 1.5.1

2011-04-11 Thread Robert Kern
On Mon, Apr 11, 2011 at 13:54, Skipper Seabold wrote: > All, > > We noticed some failing tests for statsmodels between numpy 1.5.1 and > numpy >= 1.6.0. These are the versions where I noticed the change. It > seems that when you divide a float array and multiply by a boolean > array the answers ar

[Numpy-discussion] Odd numerical difference between Numpy 1.5.1 and Numpy > 1.5.1

2011-04-11 Thread Skipper Seabold
All, We noticed some failing tests for statsmodels between numpy 1.5.1 and numpy >= 1.6.0. These are the versions where I noticed the change. It seems that when you divide a float array and multiply by a boolean array the answers are different (unless the others are also off by some floating point