Skip to content

Generalize block sparse matricize #163

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
Aug 12, 2025
Merged

Generalize block sparse matricize #163

merged 7 commits into from
Aug 12, 2025

Conversation

mtfishman
Copy link
Member

@mtfishman mtfishman commented Jul 29, 2025

This rewrite block sparse matricize/unmatricize to call matricize/unmatricize blockwise, while before it called out to blockreshape. The previous logic was too limited when the blocks themselves have more structure and we don't want to simply reshape them, for example for Kronecker blocks.

This is breaking because it makes the blocksparse constructor stricter, now you can call blocksparse(d, [2, 3], [2, 3]) or blocksparse(d, blockedrange.(([2, 3], [2, 3]))) but not blocksparse(d, ([2, 3], [2, 3])) or blocksparse(d, blockedrange.(([2, 3], [2, 3]))...). That matches the convention in BlockArrays.jl constructors and avoids ambiguities since an input like blocksparse(d, Base.OneTo(3)) would be ambiguous otherwise (it wouldn't be clear if those should be block lengths or the axis).

@mtfishman mtfishman marked this pull request as draft July 29, 2025 13:27
@mtfishman mtfishman changed the title Generalize block sparse matricize [WIP] Generalize block sparse matricize Jul 29, 2025
Copy link

codecov bot commented Jul 29, 2025

Codecov Report

❌ Patch coverage is 77.77778% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.37%. Comparing base (229248e) to head (a6efc60).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/BlockArraysExtensions/blockrange.jl 16.66% 5 Missing ⚠️
...rProductsExt/BlockSparseArraysTensorProductsExt.jl 0.00% 3 Missing ⚠️
...stractblocksparsearray/abstractblocksparsearray.jl 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #163      +/-   ##
==========================================
- Coverage   75.95%   75.37%   -0.59%     
==========================================
  Files          36       37       +1     
  Lines        2059     2091      +32     
==========================================
+ Hits         1564     1576      +12     
- Misses        495      515      +20     
Flag Coverage Δ
docs 7.18% <4.44%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mtfishman mtfishman changed the title [WIP] Generalize block sparse matricize Generalize block sparse matricize Aug 12, 2025
@mtfishman mtfishman marked this pull request as ready for review August 12, 2025 01:16
@mtfishman mtfishman merged commit a552990 into main Aug 12, 2025
19 of 20 checks passed
@mtfishman mtfishman deleted the mf/generic_matricize branch August 12, 2025 02:56
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.

1 participant