Re: [Numpy-discussion] NA-mask interactions with existing C code

2012-05-11 Thread Gael Varoquaux
On Fri, May 11, 2012 at 09:59:16AM -0500, Travis Oliphant wrote: > > Is there a advantage for users by making it a subclass? Nobody is saying > > you couldn't 'inherit' the struct (make the ndmask struct be castable to > > a PyArrayObject*) even if that is not declared in the Python type object.

Re: [Numpy-discussion] NA-mask interactions with existing C code

2012-05-11 Thread Jim Bosch
On 05/11/2012 01:36 AM, Travis Oliphant wrote: >>> >>> I guess this mixture of Python-API and C-API is different from the way >>> the API tries to protect incorrect access. From the Python API, it. >>> should let everything through, because it's for Python code to use. From >>> the C API, it should

Re: [Numpy-discussion] NA-mask interactions with existing C code

2012-05-11 Thread Travis Oliphant
>> >> See my post in the other thread for my proposal to add a flag that allows >> users to switch between the Python side default being ndarray's or ndmasked, >> but they are different types at the C-level.The proposal so far does not >> specify whether or not ndarray or ndmasked is a subc

Re: [Numpy-discussion] NA-mask interactions with existing C code

2012-05-10 Thread Dag Sverre Seljebotn
On 05/11/2012 07:36 AM, Travis Oliphant wrote: >>> >>> I guess this mixture of Python-API and C-API is different from the way >>> the API tries to protect incorrect access. From the Python API, it. >>> should let everything through, because it's for Python code to use. From >>> the C API, it should

Re: [Numpy-discussion] NA-mask interactions with existing C code

2012-05-10 Thread Travis Oliphant
>> >> I guess this mixture of Python-API and C-API is different from the way >> the API tries to protect incorrect access. From the Python API, it. >> should let everything through, because it's for Python code to use. From >> the C API, it should default to not letting things through, because >>

Re: [Numpy-discussion] NA-mask interactions with existing C code

2012-05-10 Thread Dag Sverre Seljebotn
Dag Sverre Seljebotn wrote: >On 05/11/2012 01:06 AM, Mark Wiebe wrote: >> On Thu, May 10, 2012 at 5:47 PM, Dag Sverre Seljebotn >> mailto:d.s.seljeb...@astro.uio.no>> >wrote: >> >> On 05/11/2012 12:28 AM, Mark Wiebe wrote: >> > I did some searching for typical Cython and C code which >

Re: [Numpy-discussion] NA-mask interactions with existing C code

2012-05-10 Thread Dag Sverre Seljebotn
Dag Sverre Seljebotn wrote: >On 05/11/2012 01:06 AM, Mark Wiebe wrote: >> On Thu, May 10, 2012 at 5:47 PM, Dag Sverre Seljebotn >> mailto:d.s.seljeb...@astro.uio.no>> >wrote: >> >> On 05/11/2012 12:28 AM, Mark Wiebe wrote: >> > I did some searching for typical Cython and C code which >

Re: [Numpy-discussion] NA-mask interactions with existing C code

2012-05-10 Thread Dag Sverre Seljebotn
On 05/11/2012 01:06 AM, Mark Wiebe wrote: > On Thu, May 10, 2012 at 5:47 PM, Dag Sverre Seljebotn > mailto:d.s.seljeb...@astro.uio.no>> wrote: > > On 05/11/2012 12:28 AM, Mark Wiebe wrote: > > I did some searching for typical Cython and C code which accesses > numpy > > arrays, an

Re: [Numpy-discussion] NA-mask interactions with existing C code

2012-05-10 Thread Mark Wiebe
On Thu, May 10, 2012 at 5:47 PM, Dag Sverre Seljebotn < d.s.seljeb...@astro.uio.no> wrote: > On 05/11/2012 12:28 AM, Mark Wiebe wrote: > > I did some searching for typical Cython and C code which accesses numpy > > arrays, and added a section to the NEP describing how they behave in the > > curren

Re: [Numpy-discussion] NA-mask interactions with existing C code

2012-05-10 Thread Dag Sverre Seljebotn
On 05/11/2012 12:47 AM, Dag Sverre Seljebotn wrote: > On 05/11/2012 12:28 AM, Mark Wiebe wrote: >> I did some searching for typical Cython and C code which accesses numpy >> arrays, and added a section to the NEP describing how they behave in the >> current implementation. Cython code which uses ei

Re: [Numpy-discussion] NA-mask interactions with existing C code

2012-05-10 Thread Dag Sverre Seljebotn
On 05/11/2012 12:28 AM, Mark Wiebe wrote: > I did some searching for typical Cython and C code which accesses numpy > arrays, and added a section to the NEP describing how they behave in the > current implementation. Cython code which uses either straight Python > access or the buffer protocol is f

[Numpy-discussion] NA-mask interactions with existing C code

2012-05-10 Thread Mark Wiebe
I did some searching for typical Cython and C code which accesses numpy arrays, and added a section to the NEP describing how they behave in the current implementation. Cython code which uses either straight Python access or the buffer protocol is fine (after a bugfix in numpy, it wasn't failing cu