On Wed, Jun 29, 2011 at 2:40 PM, Lluís <
xscript@gmx.net> wrote:
> I'm for the option of having a single API when you want to have NA
> elements, regardless of whether it's using masks or bit patterns.
I understand the desire to avoid having two different APIS...
[snip]
> My concern is now about how to set the "skipna" in a "comfortable" way,
> so that I don't have to set it again and again as ufunc arguments:
>
>>>> a
> array([NA, 2, 3])
>>>> b
> array([1, 2, NA])
>>>> a + b
> array([NA, 2, NA])
>>>> a.flags.skipna=True
>>>> b.flags.skipna=True
>>>> a + b
> array([1, 4, 3])
...But... now you're introducing two different kinds of arrays with
different APIs again? Ones where .skipna==True, and ones where
.skipna==False?
I know that this way it's not keyed on the underlying storage format,
but if we support both bit patterns and mask arrays at the
implementation level, then the only way to make them have identical
APIs is if we completely disallow unmasking, and shared masks, and so
forth.
The right set of these conditions has been in the NEP from the beginning. Unmasking without value assignment is disallowed - the only way to "see behind the mask" or to share masks is with views. My impression is than more people are concerned with sharing the same data between different masks, something also supported through views.