Skip to content

Recipe to perform select with a mask (or bool) argument. - #251

Merged
eriknw merged 2 commits into
python-graphblas:mainfrom
eriknw:select_mask
May 31, 2022
Merged

eriknw merged 2 commits into
python-graphblas:mainfrom
eriknw:select_mask

Conversation

@eriknw

@eriknw eriknw commented May 31, 2022

Copy link
Copy Markdown
Member

This allows e.g. A.select(B.S) and A.select(C < 5).

This is enhancement (4) in #234.

This does not yet optimize e.g. A.select(A < 4) into the suitable select operation, but such an optimization is possible (and would probably be straightforward-ish).

Also, we'll want to double-check the recipes regarding masks, accum, etc. I think maybe if there is no mask but there is an accumulator, then we shouldn't use replace=True.

@eriknw
eriknw requested a review from jim22k May 31, 2022 03:37
@coveralls

coveralls commented May 31, 2022 •

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.003%) to 99.355% when pulling 27019d9 on eriknw:select_mask into 2b14d7e on python-graphblas:main.

@jim22k jim22k left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@eriknw

eriknw commented May 31, 2022

Copy link
Copy Markdown
Member Author

Thanks for the review (and suggestion) Jim, I think this reads pretty nicely.

I'm finding our custom-expression handling is actually pretty powerful.

Merging!

@eriknw
eriknw merged commit ecfcd0c into python-graphblas:main May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants