Re: [Numpy-discussion] New patch for new mgrid / ogrid functionality

2008-09-24 Thread David Kaplan
Hi, On Tue, 2008-09-23 at 20:54 -0500, [EMAIL PROTECTED] wrote: On Tue, Sep 23, 2008 at 09:39:53AM +0200, David Kaplan wrote: I would note that there is nothing in the API breakage that prevents doing what Gael mentions. The only change is that: X = mgrid[0:4, 0:4, 0:4] would be

Re: [Numpy-discussion] New patch for new mgrid / ogrid functionality

2008-09-24 Thread Robert Kern
On Wed, Sep 24, 2008 at 02:57, David Kaplan [EMAIL PROTECTED] wrote: Hi, On Tue, 2008-09-23 at 20:54 -0500, [EMAIL PROTECTED] wrote: On Tue, Sep 23, 2008 at 09:39:53AM +0200, David Kaplan wrote: I would note that there is nothing in the API breakage that prevents doing what Gael mentions.

Re: [Numpy-discussion] New patch for new mgrid / ogrid functionality

2008-09-24 Thread Gael Varoquaux
On Wed, Sep 24, 2008 at 09:57:13AM +0200, David Kaplan wrote: X = asarray( mgrid[ 0:4, 0:4, 0:4 ] ) Doesn't this force a data copy? I am not sure if this forces a copy (asarray shouldn't for arrays, unlike array, but I am not sure what it does for lists that can trivially become

Re: [Numpy-discussion] New patch for new mgrid / ogrid functionality

2008-09-23 Thread David Kaplan
Hi, I would note that there is nothing in the API breakage that prevents doing what Gael mentions. The only change is that: X = mgrid[0:4, 0:4, 0:4] would be replaced with: X = asarray( mgrid[ 0:4, 0:4, 0:4 ] ) On the other hand, not making this change makes for a strange and ugly

Re: [Numpy-discussion] New patch for new mgrid / ogrid functionality

2008-09-23 Thread Robert Kern
On Tue, Sep 23, 2008 at 02:39, David Kaplan [EMAIL PROTECTED] wrote: Hi, I would note that there is nothing in the API breakage that prevents doing what Gael mentions. The only change is that: X = mgrid[0:4, 0:4, 0:4] would be replaced with: X = asarray( mgrid[ 0:4, 0:4, 0:4 ] ) On

Re: [Numpy-discussion] New patch for new mgrid / ogrid functionality

2008-09-23 Thread Stéfan van der Walt
2008/9/23 Robert Kern [EMAIL PROTECTED]: The only time it would need to return a list is with the new functionality. So expose the new functionality with a different object instead of cramming it into an existing object with an incompatible API. That's a great way to fix the problem: if we

Re: [Numpy-discussion] New patch for new mgrid / ogrid functionality

2008-09-23 Thread Gael Varoquaux
On Tue, Sep 23, 2008 at 09:39:53AM +0200, David Kaplan wrote: I would note that there is nothing in the API breakage that prevents doing what Gael mentions. The only change is that: X = mgrid[0:4, 0:4, 0:4] would be replaced with: X = asarray( mgrid[ 0:4, 0:4, 0:4 ] ) Doesn't this

Re: [Numpy-discussion] New patch for new mgrid / ogrid functionality

2008-09-23 Thread Gael Varoquaux
On Tue, Sep 23, 2008 at 07:41:17PM +0200, Stéfan van der Walt wrote: That's a great way to fix the problem: if we call it `grid`, we can turn it into a function and accept the more generic arguments, whilst having keywords to choose between open and meshed grids. If you make it a function you

Re: [Numpy-discussion] New patch for new mgrid / ogrid functionality

2008-09-22 Thread Gael Varoquaux
On Mon, Sep 22, 2008 at 09:40:42AM +0200, Stéfan van der Walt wrote: 2008/9/19 David M. Kaplan [EMAIL PROTECTED]: My 2 cents - I personally think the version that always returns a list will ultimately be more transparent and cause fewer problems than the newer version. In either case, the

Re: [Numpy-discussion] New patch for new mgrid / ogrid functionality

2008-09-22 Thread Robert Kern
On Mon, Sep 22, 2008 at 03:53, Gael Varoquaux [EMAIL PROTECTED] wrote: On Mon, Sep 22, 2008 at 09:40:42AM +0200, Stéfan van der Walt wrote: 2008/9/19 David M. Kaplan [EMAIL PROTECTED]: My 2 cents - I personally think the version that always returns a list will ultimately be more transparent

[Numpy-discussion] New patch for new mgrid / ogrid functionality

2008-09-19 Thread David M. Kaplan
Hi all, Attached is a newer version of my patch that adds new mgrid / ogrid functionality for working with arrays in addition to slices. In fact, I have attached two versions of the patch: index_tricks.patch, that is just the last version of the patch I sent, and index_tricks.new.patch, that has