-
Notifications
You must be signed in to change notification settings - Fork 26
Add functionality to create a lazy masked array where equal to a given value #181
Conversation
0eb7dda to
079b013
Compare
079b013 to
29059a5
Compare
I don't know enough to be sure about this, but with an eye to future addtions I'm wondering if a two-step solution would be more flexible : That is, provide a two-argument constructor that combines a data-array with a mask-array, treating them both as independent biggus calculations. Where this The actual implementation would be basically much as already given in @djkirkham existing proposal. The benefit is, it's then dead simple to provide similar new operators such as Does anyone think that is a good idea ? |
|
It seems to me that one problem with a general masked array class is that if the mask it based on the underlying array then when the data is loaded it must be loaded twice - once for the data and once for the mask. Is there a way around it other than implementing special cases like this one? Is it even a serious problem? |
Ooh, good point ! I tend to forget that biggus is not like a language with lazy evaluation : they tend to avoid re-calculation. I do know we haven't bothered to avoid some duplicate evaluations in the StaGE configurations, as it was thought a minor problem : But I think that is mostly for orographies, where they are smaller (lower-dimensional) than the other data they are combined with. I'm not sure what I think about the practicality of this now - it depends on intended usage. |
|
i'm looking to cut a biggus release today. On that basis, this either goes in as is, or it waits for further implementation. My view is that this is useful, and that if a more flexible implementation arrives later, then this can become a call to that whilst maintaining the API call. On that Basis, my vote is for merge @pp-mo @djkirkham please may you indicate whether you agree or disagree with me on this? |
!agree! 👍 |
|
@marq Sounds sensible, I agree. |
|
I'm concerned about the results of this change: Is there a reason you didn't implement |
|
Good spot, but I don't think it's a bug introduced by this change. Rather, it's a problem with |
This addition is designed to mimic the NumPy function
numpy.ma.masked_equal()