[Numpy-discussion] MA bug or feature?
pfdubois at gmail.com
Tue Jul 4 16:54:32 CDT 2006
Some things to note:
The mask is copy-on-write. Don't mess with that. You can't just poke values
into an existing mask, it may be shared with other arrays.
I do not agree that there is any 'inconsistency'. It may be someone's
concept of the class that if there is a mask then at least one value is on,
but that was not my design. I believe if you try your ideas you'll find it
slows other people down, if not you.
Perhaps with all of Travis' new machinery, subclassing works. It didn't used
to, and I haven't kept up.
On 7/3/06, Pierre GM <pgmdevlist at mailcan.com> wrote:
> I wonder whether the Mask class you suggest is not a bit overkill. There
> should be enough tools in the existing MA module to do what we want. And I
> don't wanna think about compatibility the number of changes in the MA code
> that'd be required (but I'm lazy)...
> For the sake of consistency and optimization, I still think it could be
> (and cleaner) to make `nomask` the default for a MaskedArray without
> values. That could for example be implemented by forcing `nomask` at the
> creation of the MaskedArray with an extra
> `if mask and not mask.any(): mask=nomask`, or by using Paul's
> make_mask( flag=1) trick.
> Masking some specific values could still be done when mask is nomask with
> intermediary MA.getmaskarray() step.
> On a side note, modifying an existing mask is a delicate matter.
> OK if you use masks as a way to hide existing data, it's more complex when
> initially you have some holes in your dataset...
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion