Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-10 Thread Sturla Molden
Chris Barker wrote: > Well, splitting it off is a good idea, seeing as how it hasn't gotten much > love. But if the rest of numpy does not work well with it, then it becomes > even less useful. PEP 3118 takes care of that. Sturla ___ NumPy-Discussi

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-10 Thread Ralf Gommers
On Tue, Feb 10, 2015 at 5:40 PM, Chris Barker wrote: > > On Tue, Feb 10, 2015 at 12:28 AM, Todd wrote: > >> >> So maybe the better way would be not to add warnings to braodcasting >> operations, >> >> but to overhaul the matrix class >> >> to make it more attractive for numerical linear algebra(

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-10 Thread Chris Barker
On Tue, Feb 10, 2015 at 12:28 AM, Todd wrote: > >> So maybe the better way would be not to add warnings to braodcasting > operations, > >> but to overhaul the matrix class > >> to make it more attractive for numerical linear algebra(?) > > What about splitting it off into a scikit, or at least

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-10 Thread Todd
On Feb 10, 2015 1:03 AM, "cjw" wrote: > > > On 09-Feb-15 2:34 AM, Stefan Reiterer wrote: >> >> Ok that are indeed some good reasons to keep the status quo, especially since >> performance is crucial for numpy. >> It's a dillemma: Using the matrix class for linear algebra would be the correct >> wa

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-10 Thread Sturla Molden
Chris Barker wrote: > The strongest use-case seems to be > for teaching that involves linear algebra concepts, not real production > code. Not really. SymPy is a better teaching tool. Some find A*B easier to read than dot(A,B). But with the @ operator in Python 3.5 it does not have a usecase a

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-09 Thread Chris Barker
ebruar 2015 um 23:52 Uhr > *Von:* "Nathaniel Smith" > *An:* "Discussion of Numerical Python" > > *Betreff:* Re: [Numpy-discussion] Silent Broadcasting considered harmful > > On 8 Feb 2015 13:04, "Stefan Reiterer" > wrote: > > > > So I

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-09 Thread cjw
mith" *An:* "Discussion of Numerical Python" *Betreff:* Re: [Numpy-discussion] Silent Broadcasting considered harmful On 8 Feb 2015 13:04, "Stefan Reiterer" wrote: > > So I suggest that the best would be to throw warnings when arrays get Broadcasted like > Octave do

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-09 Thread Sturla Molden
Chris Barker wrote: > Do you realize that: > > arr = np.ones((5,)) > > ar2 = arr * 5 > > is broadcasting, too? Perhaps we should only warn for a subset of broadcastings? E.g. avoid the warning on scalar times array. I prefer we don't warn about this though, because it might be interpreted a

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-09 Thread Chris Barker
On Sun, Feb 8, 2015 at 2:17 PM, Stefan Reiterer wrote: > Till now the only way out of the misery > is to make proper unit tests, > That's the only way out of the misery of software bugs in general -- nothing special here ;-) Python is a dynamically typed language -- EVERYTHING could do someth

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-09 Thread R Schumacher
Montag, 09. Februar 2015 um 00:24 Uhr Von: "R Schumacher" An: "Discussion of Numerical Python" Betreff: Re: [Numpy-discussion] Silent Broadcasting considered harmful At 02:47 PM 2/8/2015, Simon Wood wrote: >Not quite the same. This is not so much about language semanti

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-09 Thread Stefan Reiterer
that discussion.   -Stefan Gesendet: Montag, 09. Februar 2015 um 09:51 Uhr Von: "Nathaniel Smith" An: "Discussion of Numerical Python" Betreff: Re: [Numpy-discussion] Silent Broadcasting considered harmful On 8 Feb 2015 23:34, "Stefan Reiterer" <dom...@gmx.n

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-09 Thread Nathaniel Smith
On 8 Feb 2015 23:34, "Stefan Reiterer" wrote: > > Ok that are indeed some good reasons to keep the status quo, especially since performance is crucial for numpy. > > It's a dillemma: Using the matrix class for linear algebra would be the correct way for such thing, > but the matrix API is not that

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-09 Thread Sturla Molden
On 09/02/15 08:34, Stefan Reiterer wrote: > So maybe the better way would be not to add warnings to braodcasting > operations, but to overhaul the matrix class > to make it more attractive for numerical linear algebra(?) I think you underestimate the amount of programming this would take. Take a

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Stefan Reiterer
Gesendet: Montag, 09. Februar 2015 um 00:24 Uhr Von: "R Schumacher" An: "Discussion of Numerical Python" Betreff: Re: [Numpy-discussion] Silent Broadcasting considered harmful At 02:47 PM 2/8/2015, Simon Wood wrote: >Not quite the same. This is not so much about la

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Stefan Reiterer
endet: Sonntag, 08. Februar 2015 um 23:52 Uhr Von: "Nathaniel Smith" An: "Discussion of Numerical Python" Betreff: Re: [Numpy-discussion] Silent Broadcasting considered harmful On 8 Feb 2015 13:04, "Stefan Reiterer" <dom...@gmx.net> wrote: > > So I sugges

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Sturla Molden
On 08/02/15 23:17, Stefan Reiterer wrote: > Actually I use numpy for several years now, and I love it. > The reason that I think silent broadcasting of sums is bad > comes simply from the fact, that I had more trouble with it, than it > helped me. In Fortran 90, broadcasting allows us to write co

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Sturla Molden
Simon Wood wrote: > Not quite the same. This is not so much about language semantics as > mathematical definitions. You (the Numpy community) have decided to > overload certain mathematical operators to act in a way that is not > consistent with linear algebra teachings. We have overloaded the o

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Sturla Molden
Matthew Brett wrote: > I agree. I knew about broadcasting as soon as I started using numpy, > so I can honestly say this has never surprised me. Fortran 90 has broadcasting too. NumPy's broadcasting was inspired by Fortran 90, which was the lingua franca of scientific computing in the 1990s. Li

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread josef.pktd
On Sun, Feb 8, 2015 at 7:12 PM, Eric Firing wrote: > On 2015/02/08 12:43 PM, josef.p...@gmail.com wrote: > >> >> For me the main behavior I had to adjust to was loosing a dimension in >> any reduce operation, mean, sum, ... >> >> if x is 2d >> x - x.mean(1) >> we loose a dimension, and it doesn't

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Eric Firing
On 2015/02/08 12:43 PM, josef.p...@gmail.com wrote: > > For me the main behavior I had to adjust to was loosing a dimension in > any reduce operation, mean, sum, ... > > if x is 2d > x - x.mean(1) > we loose a dimension, and it doesn't broadcast in the right direction Though you can use: x_demea

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Eelco Hoogendoorn
low it, but >> they >> >>> warn about it's usage. >> >>> This has indeed it's merits. >> >>> Gesendet: Sonntag, 08. Februar 2015 um 22:17 Uhr >> >>> Von: "Charles R Harris" >> >>> An: "Disc

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread R Schumacher
At 02:47 PM 2/8/2015, Simon Wood wrote: >Not quite the same. This is not so much about language semantics as >mathematical definitions. You (the Numpy community) have decided to >overload certain mathematical operators to act in a way that is not >consistent with linear algebra teachings. This c

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread cjw
On 08-Feb-15 5:47 PM, Nathaniel Smith wrote: On 8 Feb 2015 13:39, "Simon Wood" wrote: I find the broadcasting aspect of Numpy a turn off. If I go to add a 1x3 vector to a 3x1 vector, I want the program to warn me or error out. I

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Nathaniel Smith
On 8 Feb 2015 13:04, "Stefan Reiterer" wrote: > > So I suggest that the best would be to throw warnings when arrays get Broadcasted like > Octave do. Python warnings can be catched and handled, that would be a great benefit. > > Another idea would to provide warning levels for braodcasting, e.g >

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Simon Wood
r matrix languages also allow it, but > they > >>> warn about it's usage. > >>> This has indeed it's merits. > >>> Gesendet: Sonntag, 08. Februar 2015 um 22:17 Uhr > >>> Von: "Charles R Harris" > >>> An: "Discus

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Nathaniel Smith
On 8 Feb 2015 13:39, "Simon Wood" wrote: > > I find the broadcasting aspect of Numpy a turn off. If I go to add a 1x3 vector to a 3x1 vector, I want the program to warn me or error out. I don't want it to do something under the covers that has no mathematical basis or definition. Also, Octave may

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread josef.pktd
ntag, 08. Februar 2015 um 22:56 Uhr > Von: "Matthew Brett" > > An: "Discussion of Numerical Python" > Betreff: Re: [Numpy-discussion] Silent Broadcasting considered harmful > Hi, > > On Sun, Feb 8, 2015 at 1:39 PM, Simon Wood wrote: >> >> >&

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread josef.pktd
#x27;s merits. >>> Gesendet: Sonntag, 08. Februar 2015 um 22:17 Uhr >>> Von: "Charles R Harris" >>> An: "Discussion of Numerical Python" >>> Betreff: Re: [Numpy-discussion] Silent Broadcasting considered harmful >>> >>> &g

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Stefan Reiterer
bruar 2015 um 22:56 Uhr Von: "Matthew Brett" An: "Discussion of Numerical Python" Betreff: Re: [Numpy-discussion] Silent Broadcasting considered harmful Hi, On Sun, Feb 8, 2015 at 1:39 PM, Simon Wood wrote: > > > On Sun, Feb 8, 2015 at 4:24 PM, Stefan Reiterer wrote:

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Benjamin Root
Februar 2015 um 22:17 Uhr >> *Von:* "Charles R Harris" >> *An:* "Discussion of Numerical Python" >> *Betreff:* Re: [Numpy-discussion] Silent Broadcasting considered harmful >> >> >> On Sun, Feb 8, 2015 at 2:14 PM, Stefan Reiterer wrot

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Eelco Hoogendoorn
This. (nd)arrays are a far more widespread concept than linear algebraic operations. If you want LA semantics, use the matrix subclass. Or don't, since simply sticking to the much more pervasive and general ndarray semantics is usually simpler and less confusing. On Sun, Feb 8, 2015 at 10:54 PM, W

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Matthew Brett
n why I suggested a warning level >>> as an alternative. >>> Setting no warnings as default would avoid breaking existing code. >>> Gesendet: Sonntag, 08. Februar 2015 um 22:08 Uhr >>> Von: "Eelco Hoogendoorn" >>> An: "Discussion of Numeri

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Warren Focke
On Sun, 8 Feb 2015, Stefan Reiterer wrote: > And as already mentioned: other matrix languages also allow it, but they warn > about it's usage. > This has indeed it's merits. numpy isn't a matrix language. They're arrays. Storing numbers that you are thinking of as a vector in an array doesn't t

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Simon Wood
s also allow it, but they > warn about it's usage. > This has indeed it's merits. > *Gesendet:* Sonntag, 08. Februar 2015 um 22:17 Uhr > *Von:* "Charles R Harris" > *An:* "Discussion of Numerical Python" > *Betreff:* Re: [Numpy-discussion] Silent Bro

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Matthew Brett
s also allow it, but they > warn about it's usage. > This has indeed it's merits. > Gesendet: Sonntag, 08. Februar 2015 um 22:17 Uhr > Von: "Charles R Harris" > An: "Discussion of Numerical Python" > Betreff: Re: [Numpy-discussion] Silent Broadcasting

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Stefan Reiterer
merits. Gesendet: Sonntag, 08. Februar 2015 um 22:17 Uhr Von: "Charles R Harris" An: "Discussion of Numerical Python" Betreff: Re: [Numpy-discussion] Silent Broadcasting considered harmful     On Sun, Feb 8, 2015 at 2:14 PM, Stefan Reiterer <dom...@gmx.net> wrote:

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Charles R Harris
08 Uhr > *Von:* "Eelco Hoogendoorn" > *An:* "Discussion of Numerical Python" > *Betreff:* Re: [Numpy-discussion] Silent Broadcasting considered harmful > > I personally use Octave and/or Numpy for several years now and never > ever needed braodcasting. > B

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread josef.pktd
On Sun, Feb 8, 2015 at 4:08 PM, Eelco Hoogendoorn wrote: >> I personally use Octave and/or Numpy for several years now and never ever >> needed braodcasting. > But since it is still there there will be many users who need it, there will > be some use for it. > > Uhm, yeah, there is some use for i

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Stefan Reiterer
hon" Betreff: Re: [Numpy-discussion] Silent Broadcasting considered harmful > I personally use Octave and/or Numpy  for several years now and never ever needed braodcasting. But since it is still there there will be many users who need it, there will be some use for it.   Uhm, yeah, the

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Eelco Hoogendoorn
> I personally use Octave and/or Numpy for several years now and never ever needed braodcasting. But since it is still there there will be many users who need it, there will be some use for it. Uhm, yeah, there is some use for it. Im all for explicit over implicit, but personally current broadcas

[Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Stefan Reiterer
Hi!   As shortly discussed on github: https://github.com/numpy/numpy/issues/5541   I personally think that silent Broadcasting is not a good thing. I had recently a lot of trouble with row and column vectors which got bradcastet toghether altough it was  more annoying than useful, especially