Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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/spaces/gradedspace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ end
Base.summary(io::IO, V::GradedSpace) = print(io, type_repr(typeof(V)))

function Base.show(io::IO, V::GradedSpace)
opn = (get(io, :typeinfo, Any)::DataType == typeof(V) ? "" : type_repr(typeof(V)))
opn = (get(io, :typeinfo, Any)::Type == typeof(V) ? "" : type_repr(typeof(V)))
Comment thread
lkdvos marked this conversation as resolved.
opn *= "("
if isdual(V)
cls = ")'"
Expand Down
16 changes: 11 additions & 5 deletions src/tensors/abstracttensor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -645,18 +645,24 @@ end

# Human-readable:
function Base.show(io::IO, ::MIME"text/plain", t::AbstractTensorMap)
# 1) show summary: typically d₁×d₂×… ← d₃×d₄×… $(typeof(t)):
# 1) show summary: typically d₁×d₂×… ← d₃×d₄×… $(typeof(t))
summary(io, t)
println(io, ":")

# case without `\n`:
if get(io, :compact, true)
print(io, "(…, ")
show(io, mime, space(t))
print(io, ')')
return nothing
end

# case with `\n`
# 2) show spaces
# println(io, " space(t):")
println(io, ':')
println(io, " codomain: ", codomain(t))
println(io, " domain: ", domain(t))

# 3) [optional]: show data
get(io, :compact, true) && return nothing
ioc = IOContext(io, :typeinfo => sectortype(t))
println(io, "\n\n blocks: ")
show_blocks(io, MIME"text/plain"(), blocks(t))
return nothing
Expand Down
Loading