Skip to content

Conversation

@mtfishman
Copy link
Member

@mtfishman mtfishman commented Jan 12, 2025

Followup to ITensor/SparseArraysBase.jl#13, also relies on ITensor/SparseArraysBase.jl#14. With this PR block sparse arrays now print like this:

julia> using BlockSparseArrays: BlockSparseArray

julia> a = BlockSparseArray{Float64}([2, 2], [2, 2])
2×2-blocked 4×4 BlockSparseArray{Float64, 2, Matrix{Float64}, SparseArraysBase.SparseArrayDOK{Matrix{Float64}, 2, BlockSparseArrays.GetUnstoredBlock{Tuple{BlockArrays.BlockedOneTo{Int64, Vector{Int64}}, BlockArrays.BlockedOneTo{Int64, Vector{Int64}}}}}, Tuple{BlockArrays.BlockedOneTo{Int64, Vector{Int64}}, BlockArrays.BlockedOneTo{Int64, Vector{Int64}}}}:
     
     
 ──────┼──────
     
     

julia> a[1, 2] = 12
12

julia> a
2×2-blocked 4×4 BlockSparseArray{Float64, 2, Matrix{Float64}, SparseArraysBase.SparseArrayDOK{Matrix{Float64}, 2, BlockSparseArrays.GetUnstoredBlock{Tuple{BlockArrays.BlockedOneTo{Int64, Vector{Int64}}, BlockArrays.BlockedOneTo{Int64, Vector{Int64}}}}}, Tuple{BlockArrays.BlockedOneTo{Int64, Vector{Int64}}, BlockArrays.BlockedOneTo{Int64, Vector{Int64}}}}:
 0.0  12.0  
 0.0   0.0  
 ───────────┼──────
         
         

while before unstored values were printed as zeros, i.e. 0.0.

@codecov
Copy link

codecov bot commented Jan 12, 2025

Codecov Report

Attention: Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.

Project coverage is 26.98%. Comparing base (6019b92) to head (79c770a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...locksparsearray/wrappedabstractblocksparsearray.jl 0.00% 20 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #22      +/-   ##
==========================================
- Coverage   27.61%   26.98%   -0.63%     
==========================================
  Files          26       26              
  Lines         862      882      +20     
==========================================
  Hits          238      238              
- Misses        624      644      +20     
Flag Coverage Δ
docs 26.90% <0.00%> (-0.63%) ⬇️

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.

@mtfishman mtfishman merged commit e128b18 into main Jan 12, 2025
10 of 12 checks passed
@mtfishman mtfishman deleted the show branch January 12, 2025 17:04
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