<br><br><div class="gmail_quote">On Fri, Nov 4, 2011 at 10:33 PM, T J <span dir="ltr"><<a href="mailto:tjhnson@gmail.com">tjhnson@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="gmail_quote"><div class="im">On Fri, Nov 4, 2011 at 8:03 PM, Nathaniel Smith <span dir="ltr"><<a href="mailto:njs@pobox.com" target="_blank">njs@pobox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">


<div>On Fri, Nov 4, 2011 at 7:43 PM, T J <<a href="mailto:tjhnson@gmail.com" target="_blank">tjhnson@gmail.com</a>> wrote:<br>
> On Fri, Nov 4, 2011 at 6:31 PM, Pauli Virtanen <<a href="mailto:pav@iki.fi" target="_blank">pav@iki.fi</a>> wrote:<br>
</div><div>>> An acid test for proposed rules: given two arrays `a` and `b`,<br>
>><br>
>>         a = [1, 2, IGNORED(3), IGNORED(4)]<br>
>>        b = [10, IGNORED(20), 30, IGNORED(40)]<br>
</div>[...]<br>
<div>> (A1)  Does  unmask(a+b) == unmask(b + a) ?<br>
><br>
> Yes.  They both equal:<br>
><br>
>    unmask([11, IGNORED(22), IGNORED(33), IGNORED(44)])<br>
>      =<br>
>    [11, 22, 33, 44]<br>
<br>
</div>Again, I really don't think you're going to be able to sell an API where<br>
  [2] + [IGNORED(20)] == [IGNORED(22)]<br>
I mean, it's not me you have to convince, it's Gary, Pierre, maybe<br>
Benjamin, Lluís, etc. So I could be wrong. But you might want to<br>
figure that out first before making plans based on this...<br></blockquote></div><div><br>But this is how <a href="http://np.ma" target="_blank">np.ma</a> currently does it, except that it doesn't compute the payload---it just calls it IGNORED.   <br>


And it seems that this generalizes the way people want it to:<br><br>>>> z = [2, 4] + [IGNORED(20), 3]<br>>>> z<br>[IGNORED(24), 7]<br>>>> z.sum(skip_ignored=True)   # True could be the default<br>


7<br>>>> z.sum(skip_ignored=False)<br>IGNORED(31)<br><br>I guess I am confused because it seems that you implicitly used this same rule here:<br><br><pre><div class="im">Say we have<br>  >>> a = np.array([1, IGNORED(2), 3])<br>

</div><div class="im">
  >>> b = np.array([10, 20, 30])<br></div><div class="im">(Here's I'm using IGNORED(2) to mean a value that is currently<br>ignored, but if you unmasked it it would have the value 2.)<br><br>Then we have:<br>

<br># non-propagating <b><span>*</span>or<span>*</span></b> propagating, doesn't matter:<br>
</div></pre><div class="im"><blockquote type="cite" style="color:rgb(0, 0, 0)"><blockquote type="cite" style="color:rgb(0, 0, 0)"><blockquote type="cite" style="color:rgb(0, 0, 0)"><pre><span>>>> </span>a + 2<br>


</pre></blockquote></blockquote></blockquote><pre>[3, IGNORED(2), 5]<br></pre><br></div>That is, element-wise, you had to have done:<br><br>    IGNORED(2) + 2 --> IGNORED(2).<br><br>I said it should be equal to IGNORED(4), but the result is still some form of ignore.  Sorry if I am missing the bigger picture at this point....its late and a Fri.<br>


<br></div></div><br></blockquote><div><br>This scheme is actually somewhat intriguing.  Not totally convinced, by intrigued.  Unfortunately, I fell behind in the postings by having dinner... We probably should start a new thread soon with a bunch of this stuff solidified and stated to give others a chance to hop back into the game. Maybe a table of some sort with pros/cons (mathematically speaking, deferring implementation details for later).<br>

<br>I swear, if we can get this to make sense... we should have a Nobel prize or something.<br><br>Ben Root<br><br></div></div>