-
Notifications
You must be signed in to change notification settings - Fork 2
Fix splitdims(::BlockSparseArrays) #52
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #52 +/- ##
==========================================
+ Coverage 75.09% 75.11% +0.02%
==========================================
Files 30 30
Lines 1108 1109 +1
==========================================
+ Hits 832 833 +1
Misses 276 276
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
A few comments:
|
ext/BlockSparseArraysTensorAlgebraExt/BlockSparseArraysTensorAlgebraExt.jl
Outdated
Show resolved
Hide resolved
Thanks for investigating this and finding a fix! I guess basically it was using the inverse of the correct permutation? That would explain why it didn't come up yet, since for simpler permutations the permutation and its inverse are the same.
I think it could be reasonable to make functionality like:
part of the public interface of GradedUnitRanges.jl, since sorting by sector and merging common sectors is a pretty common operation. However, maybe they should be renamed to:
to make it clearer that the sorting/merging is done by sector. I don't think there is a need for
I think that makes sense, that should make the logic clearer.
Agreed.
Agreed, I see a test of BlockSparseArrays.jl/test/test_gradedunitrangesext.jl Lines 89 to 110 in 711dc43
|
It was using permuted axes to read the input array, instead of reading with no permutation, then permute to write. It does not show put for trivial permutation indeed. |
Looks good to me, thanks! Can you bump the version so we can register it after merging? |
Fixes #50
Non blocksorted axes were used to index an array whose axes are blocksorted. Therefore the intermediary arrays carries invalid blocks. This is a quickfix that returns the correct result, but the code can be improved.