Closed jnytra closed 1 year ago
This would definitely be a useful adaptor 👍
I'm not sure about the name "compress" though... is there precedent for this name in other languages/libraries?
I did small research:
select
but instead of bool mask uses indices.Thanks for doing the research 🙂. The Python version seems like what we want I think.
I'm still not 100% convinced about the name but I definitely like the idea of the adaptor.
I'm on vacation at the moment but I'll have a look at it when I get back unless you fancy working on it!
It's fine, there's no need to rush. Enjoy your holiday.
I've got an implementation in #85 (which I've tentatively called select_by
, because I don't like the name compress
very much). Unfortunately it looks like an unrelated Github Actions update has broken the CI, so I'll have to fix that first.
Finally merged as flux::mask()
, woo!
In this issue, I suggest adding
compress
sequence adaptor.Compress adaptor filters elements from the input sequence, returning only those that have a corresponding element in selectors that evaluates to true. Stops when either the input sequence or selectors sequences has been exhausted. Roughly equivalent to: