GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||
GeezerVison is showing github.com — Computation between scalars by eriknw · Pull Request #358 · python-graphblas/python-graphblas Conversation
Member
Closes #199. This is almost ready. It turns out we had most of the machinery already to support computation between scalars. I need to finish I discovered that A good wayto review this may be to check it out locally and try it out.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
eriknw
marked this pull request as draft
|
There was an error while loading. Please reload this page.
|
coverage: 99.468% (+0.9%) from 98.605% |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This is ready for review if anybody wants to take a look. I plan to merge this PR in a week or so if there's no feedback. I think a useful way to review this would be to try it out and compare to how you expect computation between scalars to behave. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for looking @jim22k! There's one thing I almost forgot: docstrings! I will add docstrings to the new methods on Scalar before I merge. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@jim22k, there's one more edge case for Scalar computation that I want to bring attention to.
All other scalar dunder methods (such as What should we do for infix and prefix operators for scalars? Should they always return GrB_Vector_eWiseAdd_BinaryOp((GrB_Vector)s, NULL, GrB_PLUS_FP64, GrB_PLUS_FP64, (GrB_Vector)t, (GrB_Vector)u, NULL); Also note that In summary, this PR currently matches old behavior to be backwards compatible, and otherwise infix methods return expressions to match with Vector and Matrix. This may be surprising at times, so we should consider being backwards incompatible. I want to come to consensus on this before merging. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Here's my current position regarding the previous comment:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The changes ( If for some reason we wanted to change the behavior of They also aren't locked out of doing element-wise equality. They would just have to use the non-infix notation, which makes it explicitly clear what is being asked for (i.e. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Perfect, thanks so much @jim22k for the careful consideration. I agree with everything you said, so sounds like we're in agreement! Now I just need to add those docstrings... |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This is in 🎉 🚀 🎉 ! This ended up being a bigger PR than I expected, but it makes a lot of improvements, and operations with scalars seems pretty nice. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
btw, one of the misc things added in this PR is running Pylint sometimes in CI. It is only informational--it doesn't fail the CI job. Pylint is actually how I learned awkward 2 is out and we needed to update (another misc update done in this PR), so I think it can actually be a useful check. I'm tempted to allow it to fail PRs, but let's do a "dry run" for now to see how it goes. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Computation between scalars
There was an error while loading. Please reload this page.