Skip to content

Commit a184141

Browse files
committed
custom printing
1 parent 3dcdd20 commit a184141

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

NDTensors/src/lib/GradedAxes/src/gradedunitrange.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ struct GradedOneTo{T,BlockLasts<:Vector{T}} <: AbstractGradedUnitRange{T,BlockLa
5151
end
5252
end
5353

54+
function Base.show(io::IO, mimetype::MIME"text/plain", g::AbstractGradedUnitRange)
55+
v = blocklabels(g) .=> Int.(blocklengths(g))
56+
println(typeof(g))
57+
return show(io, mimetype, v)
58+
end
59+
5460
# == is just a range comparison that ignores labels. Need dedicated function to check equality.
5561
struct NoLabel end
5662
blocklabels(r::AbstractUnitRange) = Fill(NoLabel(), blocklength(r))

0 commit comments

Comments
 (0)