Skip to content

Commit

Permalink
Limit number of subsystems shown
Browse files Browse the repository at this point in the history
  • Loading branch information
hersle committed Oct 18, 2024
1 parent df309ce commit e8a8729
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/systems/abstractsystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1896,8 +1896,10 @@ function Base.show(io::IO, mime::MIME"text/plain", sys::AbstractSystem; bold = t
# Print subsystems
subs = sys.systems
nsubs = length(subs)
nsubs > 0 && printstyled(io, "\nSubsystems ($(nsubs)): "; bold)
for sub in subs
nrows = min(nsubs, limit ? rows : nsubs)
nrows > 0 && printstyled(io, "\nSubsystems ($(nsubs)): "; bold)
for i in 1:nrows
sub = subs[i]
name = String(nameof(sub))
print(io, "\n ", name)
desc = get_description(sub)
Expand All @@ -1909,6 +1911,8 @@ function Base.show(io::IO, mime::MIME"text/plain", sys::AbstractSystem; bold = t
print(io, ": ", desc)
end
end
limited = nrows < nsubs
limited && print(io, "\n") # too many variables to print

# Print equations
eqs = equations(sys)
Expand Down Expand Up @@ -1952,7 +1956,7 @@ function Base.show(io::IO, mime::MIME"text/plain", sys::AbstractSystem; bold = t
print(io, ": ", desc)
end
end
limited = nrows < length(vars)
limited = nrows < nvars
limited && print(io, "\n") # too many variables to print
end

Expand Down

0 comments on commit e8a8729

Please sign in to comment.