<br><br><div class="gmail_quote">On Thu, Nov 3, 2011 at 9:28 AM, Lluís <span dir="ltr"><<a href="mailto:xscript@gmx.net">xscript@gmx.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">Nathaniel Smith writes:<br>
<br>
> 4) There is consensus that whatever approach is taken, there should be<br>
> a quick and convenient way to identify values that are MISSING,<br>
> IGNORED, or both. (E.g., functions is_MISSING, is_IGNORED,<br>
> is_MISSING_or_IGNORED, or some equivalent.)<br>
<br>
</div>Well, maybe it's too low level, but I'd rather decouple the two concepts into<br>
two orthogonal properties that can be composed:<br>
<br>
* Destructiveness: whether the previous data value is lost whenever you assign a<br>
  "special" value.<br>
<br>
* Propagation: whether any of these "special" values is propagated or just<br>
  skipped when performing computations.<br>
<br>
I think we can all agree on the definition of these two properties (where<br>
bit-patters are destructive and masks are non-destructive), so I'd say that the<br>
first discussion is establishing whether to expose them as separate properties<br>
or just expose specific combinations of them:<br>
<br>
* MISSING: destructive + propagating<br>
* IGNORED: non-destructive + non-propagating<br>
<br>
For example, it makes sense to me to have non-destructive + propagating.<br>
<br></blockquote><div><br>This is sort of how it is currently implemented.  By default, NA propagates, but it is possible to override these defaults on an operation-by-operation basis using the skipna kwarg, and a subclassed array could implement a __ufunc_wrap__() to default the skipna kwarg to True.<br>

 </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
If we take this road, then the next points to discuss should probably be how<br>
these combinations are expressed:<br>
<br>
* At the array level: all special values behave the same in a specific array,<br>
  given its properties (e.g., all of them are destructive+propagating).<br>
<br>
* At the value level: each special value conveys a specific combination of the<br>
  aforementioned properties (e.g., assigning A is destructive+propagating and<br>
  assigning B is non-destructive+non-propagating).<br>
<br>
* Hybrid: e.g., all special values are destructive, but propagation depends on<br>
  the specific special value.<br>
<br>
I think this last decision is crucial, as it will have a direct impact on<br>
performance, numpy code maintainability and 3rd party interface simplicity.<br>
<br></blockquote><div><br>This is actually a very good point, and plays directly on the types of implementations that can be done.  Currently, Mark's implementation is the first one. The others are not possible with the current design.<br>

<br>Ben Root<br><br></div></div>