Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-09-13 Thread Darren Dale
On Sat, Jul 25, 2009 at 8:33 PM, Darren Dale wrote: > On Thu, Jul 23, 2009 at 12:54 PM, Darren Dale wrote: >> On Tue, Jul 21, 2009 at 10:11 AM, Darren Dale wrote: >>> On Tue, Jul 21, 2009 at 7:44 AM, Darren Dale wrote: 2009/7/20 Stéfan van der Walt : > Hi Chuck > > 2009/7/17 Charl

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-07-25 Thread Darren Dale
On Thu, Jul 23, 2009 at 12:54 PM, Darren Dale wrote: > On Tue, Jul 21, 2009 at 10:11 AM, Darren Dale wrote: >> On Tue, Jul 21, 2009 at 7:44 AM, Darren Dale wrote: >>> 2009/7/20 Stéfan van der Walt : Hi Chuck 2009/7/17 Charles R Harris : > PyObject* PyTuple_GetItem(PyObject *p, Py

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-07-23 Thread Darren Dale
On Tue, Jul 21, 2009 at 10:11 AM, Darren Dale wrote: > On Tue, Jul 21, 2009 at 7:44 AM, Darren Dale wrote: >> 2009/7/20 Stéfan van der Walt : >>> Hi Chuck >>> >>> 2009/7/17 Charles R Harris : PyObject* PyTuple_GetItem(PyObject *p, Py_ssize_t pos) Return value: Borrowed reference. Ret

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-07-21 Thread Robert Kern
On Tue, Jul 21, 2009 at 09:11, Darren Dale wrote: > (off topic: it would be nice if numpy had a mechanism in place for > merge requests and code reviews. I've been following bzr-dev for a > while now and their development model is pretty impressive.) You can use Rietveld. numpy is already a regist

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-07-21 Thread Darren Dale
On Tue, Jul 21, 2009 at 7:44 AM, Darren Dale wrote: > 2009/7/20 Stéfan van der Walt : >> Hi Chuck >> >> 2009/7/17 Charles R Harris : >>> PyObject* PyTuple_GetItem(PyObject *p, Py_ssize_t pos) >>> Return value: Borrowed reference. >>> Return the object at position pos in the tuple pointed to by p. I

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-07-21 Thread Darren Dale
2009/7/20 Stéfan van der Walt : > Hi Chuck > > 2009/7/17 Charles R Harris : >> PyObject* PyTuple_GetItem(PyObject *p, Py_ssize_t pos) >> Return value: Borrowed reference. >> Return the object at position pos in the tuple pointed to by p. If pos is >> out of bounds, return NULL and sets an IndexErro

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-07-20 Thread Stéfan van der Walt
Hi Chuck 2009/7/17 Charles R Harris : > PyObject* PyTuple_GetItem(PyObject *p, Py_ssize_t pos) > Return value: Borrowed reference. > Return the object at position pos in the tuple pointed to by p. If pos is > out of bounds, return NULL and sets an IndexError exception. It's a borrowed > reference

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-07-17 Thread Charles R Harris
On Fri, Jul 17, 2009 at 9:44 AM, Darren Dale wrote: > On Fri, Jul 17, 2009 at 10:03 AM, Darren Dale wrote: > >> On Mon, Jul 13, 2009 at 7:12 PM, Darren Dale wrote: >> >>> 2009/7/13 Stéfan van der Walt >>> Hi Darren 2009/7/13 Darren Dale : > I've put together a first cut at

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-07-17 Thread Darren Dale
On Fri, Jul 17, 2009 at 10:03 AM, Darren Dale wrote: > On Mon, Jul 13, 2009 at 7:12 PM, Darren Dale wrote: > >> 2009/7/13 Stéfan van der Walt >> >>> Hi Darren >>> >>> 2009/7/13 Darren Dale : >>> > I've put together a first cut at implementing __array_prepare__, which >>> > appears to work, and

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-07-17 Thread Darren Dale
On Mon, Jul 13, 2009 at 7:12 PM, Darren Dale wrote: > 2009/7/13 Stéfan van der Walt > >> Hi Darren >> >> 2009/7/13 Darren Dale : >> > I've put together a first cut at implementing __array_prepare__, which >> > appears to work, and I would like to request feedback. Here is an >> overview >> > of

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-07-13 Thread Darren Dale
2009/7/13 Stéfan van der Walt > Hi Darren > > 2009/7/13 Darren Dale : > > I've put together a first cut at implementing __array_prepare__, which > > appears to work, and I would like to request feedback. Here is an > overview > > of the approach: > > This is pretty neat! Do you have a quick snip

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-07-13 Thread Stéfan van der Walt
Hi Darren 2009/7/13 Darren Dale : > I've put together a first cut at implementing __array_prepare__, which > appears to work, and I would like to request feedback. Here is an overview > of the approach: This is pretty neat! Do you have a quick snippet at hand illustrating its use? Regards Stéfa

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-07-13 Thread Darren Dale
I've put together a first cut at implementing __array_prepare__, which appears to work, and I would like to request feedback. Here is an overview of the approach: Once the ufunc machinery has created the output arrays, it is time to offer subclasses a chance to initialize the output arrays and det

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-06-24 Thread Darren Dale
On Wed, Jun 24, 2009 at 4:08 PM, Charles R Harris wrote: > On Wed, Jun 24, 2009 at 1:49 PM, Darren Dale wrote: > > On Wed, Jun 24, 2009 at 3:37 PM, Charles R Harris > > wrote: > >> > >> On Wed, Jun 24, 2009 at 8:52 AM, Darren Dale wrote: > >> > On Wed, Jun 24, 2009 at 9:42 AM, Charles R Harris >

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-06-24 Thread Charles R Harris
On Wed, Jun 24, 2009 at 1:49 PM, Darren Dale wrote: > On Wed, Jun 24, 2009 at 3:37 PM, Charles R Harris > wrote: >> >> On Wed, Jun 24, 2009 at 8:52 AM, Darren Dale wrote: >> > On Wed, Jun 24, 2009 at 9:42 AM, Charles R Harris >> > wrote: >> >> >> >> On Wed, Jun 24, 2009 at 7:08 AM, Darren Dale wr

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-06-24 Thread Darren Dale
On Wed, Jun 24, 2009 at 3:37 PM, Charles R Harris wrote: > On Wed, Jun 24, 2009 at 8:52 AM, Darren Dale wrote: > > On Wed, Jun 24, 2009 at 9:42 AM, Charles R Harris > > wrote: > >> > >> On Wed, Jun 24, 2009 at 7:08 AM, Darren Dale wrote: > >> > On Wed, May 27, 2009 at 11:30 AM, Darren Dale > >>

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-06-24 Thread Charles R Harris
On Wed, Jun 24, 2009 at 8:52 AM, Darren Dale wrote: > On Wed, Jun 24, 2009 at 9:42 AM, Charles R Harris > wrote: >> >> On Wed, Jun 24, 2009 at 7:08 AM, Darren Dale wrote: >> > On Wed, May 27, 2009 at 11:30 AM, Darren Dale >> > wrote: >> >> >> >> Now that numpy-1.3 has been released, I was hoping

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-06-24 Thread Darren Dale
On Wed, Jun 24, 2009 at 9:42 AM, Charles R Harris wrote: > On Wed, Jun 24, 2009 at 7:08 AM, Darren Dale wrote: > > On Wed, May 27, 2009 at 11:30 AM, Darren Dale > wrote: > >> > >> Now that numpy-1.3 has been released, I was hoping I could engage the > >> numpy developers and community concerning

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-06-24 Thread Charles R Harris
On Wed, Jun 24, 2009 at 7:08 AM, Darren Dale wrote: > On Wed, May 27, 2009 at 11:30 AM, Darren Dale wrote: >> >> Now that numpy-1.3 has been released, I was hoping I could engage the >> numpy developers and community concerning my suggestion to improve the ufunc >> wrapping mechanism. Currently, u

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-06-24 Thread Darren Dale
On Wed, May 27, 2009 at 11:30 AM, Darren Dale wrote: > Now that numpy-1.3 has been released, I was hoping I could engage the numpy > developers and community concerning my suggestion to improve the ufunc > wrapping mechanism. Currently, ufuncs call, on the way out, the > __array_wrap__ method of

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-05-27 Thread Darren Dale
Now that numpy-1.3 has been released, I was hoping I could engage the numpy developers and community concerning my suggestion to improve the ufunc wrapping mechanism. Currently, ufuncs call, on the way out, the __array_wrap__ method of the input array with the highest __array_priority__. There are

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-03-15 Thread Darren Dale
Hi Travis, On Mon, Mar 9, 2009 at 6:08 PM, Travis E. Oliphant wrote: > Darren Dale wrote: > > On Mon, Mar 9, 2009 at 9:50 AM, Darren Dale > > wrote: > > > > I spent some time over the weekend fixing a few bugs in numpy that > > were exposed when attempting to u

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-03-09 Thread Travis E. Oliphant
Darren Dale wrote: > On Mon, Mar 9, 2009 at 9:50 AM, Darren Dale > wrote: > > I spent some time over the weekend fixing a few bugs in numpy that > were exposed when attempting to use ufuncs with ndarray > subclasses. It got me thinking that, with relatively l

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-03-09 Thread Darren Dale
On Mon, Mar 9, 2009 at 9:50 AM, Darren Dale wrote: > I spent some time over the weekend fixing a few bugs in numpy that were > exposed when attempting to use ufuncs with ndarray subclasses. It got me > thinking that, with relatively little work, numpy's functions could be made > to be more genera

[Numpy-discussion] suggestion for generalizing numpy functions

2009-03-09 Thread Darren Dale
I spent some time over the weekend fixing a few bugs in numpy that were exposed when attempting to use ufuncs with ndarray subclasses. It got me thinking that, with relatively little work, numpy's functions could be made to be more general. For example, the numpy.ma module redefines many of the sta