Skip to content

Commit

Permalink
simpler display
Browse files Browse the repository at this point in the history
  • Loading branch information
ogauthe committed Nov 1, 2024
1 parent 5c36967 commit de6080b
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions NDTensors/src/lib/GradedAxes/src/gradedunitrange.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,13 @@ struct GradedOneTo{T,BlockLasts<:Vector{T}} <: AbstractGradedUnitRange{T,BlockLa
end

function Base.show(io::IO, mimetype::MIME"text/plain", g::AbstractGradedUnitRange)
v = map(blocks(g)) do b
label(b) => unlabel(first(b)):unlabel(last(b))
end
v = map(b -> label(b) => unlabel(b), blocks(g))
println(io, typeof(g))
return print(join(repr.(v), '\n'))
return print(io, join(repr.(v), '\n'))
end

function Base.show(io::IO, g::AbstractGradedUnitRange)
v = map(blocks(g)) do b
label(b) => unlabel(first(b)):unlabel(last(b))
end
v = map(b -> label(b) => unlabel(b), blocks(g))
return print(io, nameof(typeof(g)), '[', join(repr.(v), ", "), ']')
end

Expand Down

0 comments on commit de6080b

Please sign in to comment.