Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-23 Thread Luis Pedro Coelho
On one of my papers, we put up the code online. Years afterwards, I still get emails every six months or so because the version of the code which was used for the paper now returns the wrong result! The problem is that it was written for the old histogram and, although I have a new version of the

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-23 Thread Nathaniel Smith
On Wed, May 23, 2012 at 10:53 PM, Travis Oliphant wrote: > To be clear, I'm not opposed to the change, and it looks like we should go > forward. > > In my mind it's not about developers vs. users as satisfying users is the > whole point.   The purpose of NumPy is not to make its developers happy

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-23 Thread Travis Oliphant
To be clear, I'm not opposed to the change, and it looks like we should go forward. In my mind it's not about developers vs. users as satisfying users is the whole point. The purpose of NumPy is not to make its developers happy :-). But, users also want there to *be* developers on NumPy

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-23 Thread Olivier Delalleau
2012/5/23 Nathaniel Smith > On Wed, May 23, 2012 at 6:29 PM, Travis Oliphant > wrote: > > Then are you suggesting that we need to back out the changes to the > casting > > rules as well, because this will also cause code to stop working. This > is > > part of my point. We are not being consi

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-23 Thread Nathaniel Smith
On Wed, May 23, 2012 at 6:29 PM, Travis Oliphant wrote: > Then are you suggesting that we need to back out the changes to the casting > rules as well, because this will also cause code to stop working.   This is > part of my point.   We are not being consistently cautious. I never understood exac

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-23 Thread Dag Sverre Seljebotn
On 05/23/2012 10:00 PM, Dag Sverre Seljebotn wrote: > On 05/23/2012 07:29 PM, Travis Oliphant wrote: >> >> On May 23, 2012, at 8:02 AM, Olivier Delalleau wrote: >> >>> 2012/5/23 Nathaniel Smithmailto:n...@pobox.com>> >>> >>> On Wed, May 23, 2012 at 6:06 AM, Travis Oliphant >>> mailto:tra.

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-23 Thread Dag Sverre Seljebotn
On 05/23/2012 07:29 PM, Travis Oliphant wrote: > > On May 23, 2012, at 8:02 AM, Olivier Delalleau wrote: > >> 2012/5/23 Nathaniel Smith mailto:n...@pobox.com>> >> >> On Wed, May 23, 2012 at 6:06 AM, Travis Oliphant >> mailto:tra...@continuum.io>> wrote: >> > I just realized that the pul

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-23 Thread Frédéric Bastien
On Wed, May 23, 2012 at 1:29 PM, Travis Oliphant wrote: > > Then are you suggesting that we need to back out the changes to the casting > rules as well, because this will also cause code to stop working.   This is > part of my point.   We are not being consistently cautious. The casting change ha

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-23 Thread Olivier Delalleau
2012/5/23 Travis Oliphant > > On May 23, 2012, at 8:02 AM, Olivier Delalleau wrote: > > 2012/5/23 Nathaniel Smith > >> On Wed, May 23, 2012 at 6:06 AM, Travis Oliphant >> wrote: >> > I just realized that the pull request doesn't do what I thought it did >> which >> > is just add the flag to war

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-23 Thread Travis Oliphant
On May 23, 2012, at 8:02 AM, Olivier Delalleau wrote: > 2012/5/23 Nathaniel Smith > On Wed, May 23, 2012 at 6:06 AM, Travis Oliphant wrote: > > I just realized that the pull request doesn't do what I thought it did which > > is just add the flag to warn users who are writing to an array that is

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-23 Thread Nathaniel Smith
On Wed, May 23, 2012 at 2:11 PM, Frédéric Bastien wrote: > +1 > > Don't forget that many user always update to each version. So they > will skip many version. This is especially true for people that rely > on the distribution package that skip many version when they update. > So this is not just a

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-23 Thread Frédéric Bastien
+1 Don't forget that many user always update to each version. So they will skip many version. This is especially true for people that rely on the distribution package that skip many version when they update. So this is not just a question of how many version we warn/err, but also how many times we

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-23 Thread Olivier Delalleau
2012/5/23 Nathaniel Smith > On Wed, May 23, 2012 at 6:06 AM, Travis Oliphant > wrote: > > I just realized that the pull request doesn't do what I thought it did > which > > is just add the flag to warn users who are writing to an array that is a > > view when it used to be a copy. It's more

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-23 Thread Nathaniel Smith
On Wed, May 23, 2012 at 6:06 AM, Travis Oliphant wrote: > I just realized that the pull request doesn't do what I thought it did which > is just add the flag to warn users who are writing to an array that is a > view when it used to be a copy.     It's more cautious and also "copies" the > data fo

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-22 Thread Travis Oliphant
I just realized that the pull request doesn't do what I thought it did which is just add the flag to warn users who are writing to an array that is a view when it used to be a copy. It's more cautious and also "copies" the data for 1.7. Is this really a necessary step? I guess it depen

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-16 Thread Fernando Perez
On Fri, May 11, 2012 at 4:54 PM, Nathaniel Smith wrote: > I > have lying around my homedir that it would generally be a free speed > win Don't forget the case where the copy semantics may actually provide an *improvement* in performance by allowing a potentially large array to get deallocated if

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-16 Thread Fernando Perez
On Wed, May 16, 2012 at 7:10 AM, Nathaniel Smith wrote: > I tried checking this before, actually, but can't figure out how to > build scipy against a copy of numpy that is installed in either a > virtualenv or just on PYTHONPATH. (Basically, I just don't want to > install some random development n

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-16 Thread Travis Oliphant
This Pull Request looks like a good idea to me as well. -Travis On May 16, 2012, at 3:10 PM, Ralf Gommers wrote: > > > On Wed, May 16, 2012 at 3:55 PM, Nathaniel Smith wrote: > On Tue, May 15, 2012 at 2:49 PM, Frédéric Bastien wrote: > > Hi, > > > > In fact, I would arg to never change

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-16 Thread Travis Oliphant
On May 13, 2012, at 3:11 AM, Nathaniel Smith wrote: > On Sun, May 13, 2012 at 3:28 AM, Travis Oliphant wrote: >> Another approach would be to introduce a method: >> >> a.diag(copy=False) >> >> and leave a.diagonal() alone. Then, a.diagonal() could be deprecated over >> 2-3 releases. > > This

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-16 Thread Ralf Gommers
On Wed, May 16, 2012 at 3:55 PM, Nathaniel Smith wrote: > On Tue, May 15, 2012 at 2:49 PM, Frédéric Bastien wrote: > > Hi, > > > > In fact, I would arg to never change the current behavior, but add the > > flag for people that want to use it. > > > > Why? > > > > 1) There is probably >10k script

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-16 Thread Nathaniel Smith
On Wed, May 16, 2012 at 3:04 PM, Benjamin Root wrote: > > > On Wed, May 16, 2012 at 9:55 AM, Nathaniel Smith wrote: >> >> On Tue, May 15, 2012 at 2:49 PM, Frédéric Bastien wrote: >> > Hi, >> > >> > In fact, I would arg to never change the current behavior, but add the >> > flag for people that w

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-16 Thread Robert Kern
On Wed, May 16, 2012 at 3:10 PM, Nathaniel Smith wrote: > On Wed, May 16, 2012 at 3:04 PM, Benjamin Root wrote: >> Just as a sanity check, do the scipy tests run without producing any such >> messages? > > I tried checking this before, actually, but can't figure out how to > build scipy against

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-16 Thread Nathaniel Smith
On Wed, May 16, 2012 at 3:04 PM, Benjamin Root wrote: > > > On Wed, May 16, 2012 at 9:55 AM, Nathaniel Smith wrote: >> >> On Tue, May 15, 2012 at 2:49 PM, Frédéric Bastien wrote: >> > Hi, >> > >> > In fact, I would arg to never change the current behavior, but add the >> > flag for people that w

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-16 Thread Benjamin Root
On Wed, May 16, 2012 at 9:55 AM, Nathaniel Smith wrote: > On Tue, May 15, 2012 at 2:49 PM, Frédéric Bastien wrote: > > Hi, > > > > In fact, I would arg to never change the current behavior, but add the > > flag for people that want to use it. > > > > Why? > > > > 1) There is probably >10k script

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-16 Thread Nathaniel Smith
On Tue, May 15, 2012 at 2:49 PM, Frédéric Bastien wrote: > Hi, > > In fact, I would arg to never change the current behavior, but add the > flag for people that want to use it. > > Why? > > 1) There is probably >10k script that use it that will need to be > checked for correctness. There won't be

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-15 Thread Frédéric Bastien
Hi, In fact, I would arg to never change the current behavior, but add the flag for people that want to use it. Why? 1) There is probably >10k script that use it that will need to be checked for correctness. There won't be easy to see crash or error that allow user to see it. 2) This is a globa

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-13 Thread Nathaniel Smith
On Sun, May 13, 2012 at 3:28 AM, Travis Oliphant wrote: > Another approach would be to introduce a method: > > a.diag(copy=False) > > and leave a.diagonal() alone.  Then, a.diagonal() could be deprecated over > 2-3 releases. This would be a good idea if we didn't already have both np.diagonal(a)

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-13 Thread Sebastian Haase
+1 On Sun, May 13, 2012 at 4:28 AM, Travis Oliphant wrote: > Another approach would be to introduce a method: > > a.diag(copy=False) > > and leave a.diagonal() alone.  Then, a.diagonal() could be deprecated over > 2-3 releases. > > -Travis > > > On May 12, 2012, at 8:31 AM, Ralf Gommers wrote: >

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-12 Thread Benjamin Root
On Saturday, May 12, 2012, Travis Oliphant wrote: > Another approach would be to introduce a method: > > a.diag(copy=False) > > and leave a.diagonal() alone. Then, a.diagonal() could be deprecated over > 2-3 releases. > > -Travis > +1 Ben Root > ___

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-12 Thread Travis Oliphant
Another approach would be to introduce a method: a.diag(copy=False) and leave a.diagonal() alone. Then, a.diagonal() could be deprecated over 2-3 releases. -Travis On May 12, 2012, at 8:31 AM, Ralf Gommers wrote: > > > On Sat, May 12, 2012 at 1:54 AM, Nathaniel Smith wrote: > On Fri, M

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-12 Thread Ralf Gommers
On Sat, May 12, 2012 at 1:54 AM, Nathaniel Smith wrote: > On Fri, May 11, 2012 at 9:26 PM, T J wrote: > > On Fri, May 11, 2012 at 1:12 PM, Mark Wiebe wrote: > >> > >> On Fri, May 11, 2012 at 2:18 PM, Pauli Virtanen wrote: > >>> > >>> 11.05.2012 17:54, Frédéric Bastien kirjoitti: > >>> > In The

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-11 Thread Nathaniel Smith
On Fri, May 11, 2012 at 9:26 PM, T J wrote: > On Fri, May 11, 2012 at 1:12 PM, Mark Wiebe wrote: >> >> On Fri, May 11, 2012 at 2:18 PM, Pauli Virtanen wrote: >>> >>> 11.05.2012 17:54, Frédéric Bastien kirjoitti: >>> > In Theano we use a view, but that is not relevant as it is the >>> > compiler

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-11 Thread T J
On Fri, May 11, 2012 at 1:12 PM, Mark Wiebe wrote: > On Fri, May 11, 2012 at 2:18 PM, Pauli Virtanen wrote: > >> 11.05.2012 17:54, Frédéric Bastien kirjoitti: >> > In Theano we use a view, but that is not relevant as it is the >> > compiler that tell what is inplace. So this is invisible to the

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-11 Thread Mark Wiebe
On Fri, May 11, 2012 at 2:18 PM, Pauli Virtanen wrote: > 11.05.2012 17:54, Frédéric Bastien kirjoitti: > > In Theano we use a view, but that is not relevant as it is the > > compiler that tell what is inplace. So this is invisible to the user. > > > > What about a parameter to diagonal() that def

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-11 Thread Travis Oliphant
On May 11, 2012, at 2:18 PM, Pauli Virtanen wrote: > 11.05.2012 17:54, Frédéric Bastien kirjoitti: >> In Theano we use a view, but that is not relevant as it is the >> compiler that tell what is inplace. So this is invisible to the user. >> >> What about a parameter to diagonal() that default to

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-11 Thread Pauli Virtanen
11.05.2012 17:54, Frédéric Bastien kirjoitti: > In Theano we use a view, but that is not relevant as it is the > compiler that tell what is inplace. So this is invisible to the user. > > What about a parameter to diagonal() that default to return a view not > writable as you said. The user can the

Re: [Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-11 Thread Frédéric Bastien
In Theano we use a view, but that is not relevant as it is the compiler that tell what is inplace. So this is invisible to the user. What about a parameter to diagonal() that default to return a view not writable as you said. The user can then choose what it want and this don't break the inferface

[Numpy-discussion] Should arr.diagonal() return a copy or a view? (1.7 compatibility issue)

2012-05-11 Thread Nathaniel Smith
I've been trying to sort through the changes that landed in master from the missingdata branch to figure out how to separate out changes related to NA support from those that aren't, and noticed that one of them should probably be flagged to the list. Traditionally, arr.diagonal() and np.diagonal(a