Skip to content

Commit b4d4e29

Browse files
committed
Pretty printing of BArray
1 parent 16f3993 commit b4d4e29

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [master branch]
9+
10+
### Fixed
11+
12+
- Improved printing of `BVector`.
13+
814
## [0.5.12] - 2025-06-09
915

1016
### Fixed

src/block_arrays.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,13 @@ function Base.show(io::IO,k::MIME"text/plain",data::BArray)
120120
tcb =Tuple(cb)
121121
b = map(i->"$i, ",collect(tcb))
122122
b[end] = string(tcb[end])
123-
println(io,"$(t) Block($(join(b))) = $(blocks(data)[cb])")
123+
bi = blocks(data)[cb]
124+
si = if isa(bi,PVector) || isa(bi,PSparseMatrix)
125+
"$(bi)"
126+
else
127+
"$(typeof(bi))(…)"
128+
end
129+
println(io,"$(t) Block($(join(b))) = $(si)")
124130
end
125131
end
126132
function Base.show(io::IO,data::BArray)

0 commit comments

Comments
 (0)