Re: [Numpy-discussion] A Cython apply_along_axis function

2010-12-10 Thread Keith Goodman
On Wed, Dec 1, 2010 at 6:07 PM, Keith Goodman wrote: > On Wed, Dec 1, 2010 at 5:53 PM, David wrote: > >> On 12/02/2010 04:47 AM, Keith Goodman wrote: >>> It's hard to write Cython code that can handle all dtypes and >>> arbitrary number of dimensions. The former is typically dealt with >>> using

Re: [Numpy-discussion] A Cython apply_along_axis function

2010-12-03 Thread Sturla Molden
> It's hard to write Cython code that can handle all dtypes and > arbitrary number of dimensions. The former is typically dealt with > using templates, but what do people do about the latter? There are number of ways to do it. NumPy's C API has an iterator that returns an axis on demand. Mine just

Re: [Numpy-discussion] A Cython apply_along_axis function

2010-12-03 Thread Sturla Molden
> if ndim == 1: > stride = a.strides[0] // itemsize # convert stride bytes --> items Oh, did I really do this in selectmodule.pyx? :( That is clearly an error. I don't have time to fix it now. Sturla ___ NumPy-Discussion mailing list Num

Re: [Numpy-discussion] A Cython apply_along_axis function

2010-12-02 Thread Dag Sverre Seljebotn
On 12/02/2010 08:17 AM, Robert Bradshaw wrote: > On Wed, Dec 1, 2010 at 6:09 PM, John Salvatier > wrote: > >> On Wed, Dec 1, 2010 at 6:07 PM, Keith Goodman wrote: >> >>> On Wed, Dec 1, 2010 at 5:53 PM, David wrote: >>> >>> On 12/02/2010 04:47 AM, Keith Goodman wrote:

Re: [Numpy-discussion] A Cython apply_along_axis function

2010-12-01 Thread Robert Bradshaw
On Wed, Dec 1, 2010 at 6:09 PM, John Salvatier wrote: > On Wed, Dec 1, 2010 at 6:07 PM, Keith Goodman wrote: >> >> On Wed, Dec 1, 2010 at 5:53 PM, David wrote: >> >> > On 12/02/2010 04:47 AM, Keith Goodman wrote: >> >> It's hard to write Cython code that can handle all dtypes and >> >> arbitrary

Re: [Numpy-discussion] A Cython apply_along_axis function

2010-12-01 Thread John Salvatier
On Wed, Dec 1, 2010 at 6:07 PM, Keith Goodman wrote: > On Wed, Dec 1, 2010 at 5:53 PM, David wrote: > > > On 12/02/2010 04:47 AM, Keith Goodman wrote: > >> It's hard to write Cython code that can handle all dtypes and > >> arbitrary number of dimensions. The former is typically dealt with > >> u

Re: [Numpy-discussion] A Cython apply_along_axis function

2010-12-01 Thread Keith Goodman
On Wed, Dec 1, 2010 at 5:53 PM, David wrote: > On 12/02/2010 04:47 AM, Keith Goodman wrote: >> It's hard to write Cython code that can handle all dtypes and >> arbitrary number of dimensions. The former is typically dealt with >> using templates, but what do people do about the latter? > > The on

Re: [Numpy-discussion] A Cython apply_along_axis function

2010-12-01 Thread David
Hi Keith, On 12/02/2010 04:47 AM, Keith Goodman wrote: > It's hard to write Cython code that can handle all dtypes and > arbitrary number of dimensions. The former is typically dealt with > using templates, but what do people do about the latter? The only way that I know to do that systematically

Re: [Numpy-discussion] A Cython apply_along_axis function

2010-12-01 Thread Dag Sverre Seljebotn
On 12/01/2010 08:47 PM, Keith Goodman wrote: > It's hard to write Cython code that can handle all dtypes and > arbitrary number of dimensions. The former is typically dealt with > using templates, but what do people do about the latter? > What you typically do is to use the C-level iterator AP

[Numpy-discussion] A Cython apply_along_axis function

2010-12-01 Thread Keith Goodman
It's hard to write Cython code that can handle all dtypes and arbitrary number of dimensions. The former is typically dealt with using templates, but what do people do about the latter? I'm trying to take baby steps towards writing an apply_along_axis function that takes as input a cython function