Skip to content

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
@codecov
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.

2 participants