-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Masked arrays #127
Comments
Not much plans. It's needed for sure. We need an implementation that is easy to optimize well, at least for the common cases. One question that arises for example, in the API is it the arrays or the operations on them that should be masked? Also mentioned in #120 |
This is a good question. I guess it is more explicit if the operations are masked. This way it is always clear that masked cells are not really empty/non-existent. Additionally it may lead to more generic code e.g. write a histogram generator for Masked arrays are more intuitive then masked operations. The result of a I think i like the idea of masked operations and they should work well for my use-cases (raster data). But there may be other opinions and use-cases. |
Hi @bluss . Is this feature still relevant? If yes, then I can work on POC of either of both approaches (masked arrays or masked operations). |
+1 I think masked indexing (along with arrays-as-indices and/or where/nonzero) is an important step toward being able to transparently port readable scalar code to use ndarrays. |
What is the status of masked arrays in nadarray? I am interested in taking a stab at it. |
@bluss @jturner314 @LukeMathWalker I've created a draft of the potential masked array implementation #849 . Could you please take a look and see if it makes any sense and if I should continue moving in this direction? Thanks a lot. |
Numpy supports masked arrays which is very useful for many use-cases. Are there any plans how a similar feature could be implemented for rust-ndarray?
My current idea would be to build a decorator which wraps an array and contains an additional mask object:
struct MaskedArray<A, M>{ array: A, mask: M, }
The mask itself should be a trait (and/or enum?) to handle the following cases:
The problem with this approach is that there is currently no array trait which is needed for the decorator pattern.
The text was updated successfully, but these errors were encountered: