498498Substitutions (subs, deps) = Substitutions (subs, deps, nothing )
499499
500500Base. nameof (sys:: AbstractSystem ) = getfield (sys, :name )
501+ description (sys:: AbstractSystem ) = has_description (sys) ? get_description (sys) : " "
501502
502503# Deprecated
503504function independent_variable (sys:: AbstractSystem )
@@ -1895,7 +1896,7 @@ function Base.show(io::IO, mime::MIME"text/plain", sys::AbstractSystem; hint = t
18951896 rows = first (displaysize (io)) ÷ 5 # then allocate ≈1/5 of display height to each list
18961897
18971898 # Print name and description
1898- desc = get_description (sys)
1899+ desc = description (sys)
18991900 printstyled (io, " Model " , nameof (sys), " :" ; bold)
19001901 ! isempty (desc) && print (io, " " , desc)
19011902
@@ -1909,7 +1910,7 @@ function Base.show(io::IO, mime::MIME"text/plain", sys::AbstractSystem; hint = t
19091910 sub = subs[i]
19101911 name = String (nameof (sub))
19111912 print (io, " \n " , name)
1912- desc = get_description (sub)
1913+ desc = description (sub)
19131914 if ! isempty (desc)
19141915 maxlen = displaysize (io)[2 ] - length (name) - 6 # remaining length of line
19151916 if limit && length (desc) > maxlen
@@ -2913,7 +2914,7 @@ end
29132914function AbstractTrees. printnode (
29142915 io:: IO , sys:: AbstractSystem ; describe = false , bold = false )
29152916 printstyled (io, nameof (sys); bold)
2916- describe && ! isempty (get_description (sys)) && print (io, " : " , get_description (sys))
2917+ describe && ! isempty (description (sys)) && print (io, " : " , description (sys))
29172918end
29182919"""
29192920 hierarchy(sys::AbstractSystem; describe = false, bold = describe, kwargs...)
@@ -3006,7 +3007,7 @@ function extend(sys::AbstractSystem, basesys::AbstractSystem; name::Symbol = nam
30063007 cevs = union (get_continuous_events (basesys), get_continuous_events (sys))
30073008 devs = union (get_discrete_events (basesys), get_discrete_events (sys))
30083009 defs = merge (get_defaults (basesys), get_defaults (sys)) # prefer `sys`
3009- desc = join (filter (desc -> ! isempty (desc), get_description .([sys, basesys])), " " ) # concatenate non-empty descriptions with space
3010+ desc = join (filter (desc -> ! isempty (desc), description .([sys, basesys])), " " ) # concatenate non-empty descriptions with space
30103011 meta = union_nothing (get_metadata (basesys), get_metadata (sys))
30113012 syss = union (get_systems (basesys), get_systems (sys))
30123013 args = length (ivs) == 0 ? (eqs, sts, ps) : (eqs, ivs[1 ], sts, ps)
0 commit comments