Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/tensors/blockiterator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function show_blocks(io, mime::MIME"text/plain", iter; maytruncate::Bool = true)
numlinesleft, numcols = get(io, :displaysize, displaysize(io))::Tuple{Int, Int}
numlinesleft -= 2 # lines of headers have already been subtracted, but not the 2 spare lines for old and new prompts
minlinesperblock = 7 # aim to have at least this many lines per printed block (= 5 lines for the actual matrix)
minnumberofblocks = min(3, length(iter)) # aim to show at least this many blocks
minnumberofblocks = clamp(length(iter), 1, 3) # aim to show at least this many blocks
truncateblocks = sum(cb -> min(size(cb[2], 1) + 2, minlinesperblock), iter; init = 0) > numlinesleft
maxnumlinesperblock = max(div(numlinesleft - 2 * truncateblocks, minnumberofblocks), minlinesperblock)
# aim to show at least minnumberofblocks, but not if this means that there would be less than minlinesperblock
Expand Down
3 changes: 2 additions & 1 deletion test/tensors/tensors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,9 @@ end
for V in (ℂ^2, Z2Space(0 => 2, 1 => 2), SU2Space(0 => 2, 1 => 2))
t1 = ones(Float32, V ⊗ V, V)
t2 = randn(ComplexF64, V ⊗ V ⊗ V)
t3 = randn(Float64, zero(V), zero(V))
# test unlimited output
for t in (t1, t2, t1', t2')
for t in (t1, t2, t1', t2', t3)
output = IOBuffer()
summary(output, t)
print(output, ":\n codomain: ")
Expand Down
Loading