Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add x.reposition to "shift" values around. #215

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

Merged
merged 7 commits into from
Apr 18, 2022

Conversation

eriknw
Copy link
Member

@eriknw eriknw commented Apr 16, 2022

Fixes #180

@jim22k and @ParticularMiner I think this is what we discussed. Please take a look.

This is our first "unofficial" method on Matrix objects directly (Vector already had inner and outer). I think it's justified: although simple, it would be easy to get wrong or do poorly. It's also useful enough, and we have a good name and arguments for it.

@coveralls
Copy link

coveralls commented Apr 16, 2022

Pull Request Test Coverage Report for Build 2175710934

  • 94 of 94 (100.0%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.003%) to 99.696%

Totals Coverage Status
Change from base Build 2175418394: -0.003%
Covered Lines: 15244
Relevant Lines: 15273

💛 - Coveralls

@eriknw
Copy link
Member Author

eriknw commented Apr 16, 2022

I modified x.reposition to return an expression. I think this is better, because it lets us use the same patterns as elsewhere and efficiently applies masks, accumulators, etc.

In general, I think custom recipes that we add should return expressions and not objects if there's a reasonable way to do so. Recipes that rely heavily on Numba such as M.ss.compactify_rowwise don't need to return expressions.

Hmm, I think I might be able to use the conventions added in this PR to make broadcasting vectors across matrices even better for ewise_add and ewise_union when there are masks. Also, better reprs.

eriknw added 3 commits April 16, 2022 21:40
Also, don't report missing coverage on things that will be super-hard to cover.
This will help us be less annoyed when trying to keep other parts covered.
@eriknw eriknw mentioned this pull request Apr 18, 2022
@eriknw eriknw merged commit 7b7bb06 into python-graphblas:main Apr 18, 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.

Add pad/shift/translate
3 participants