Skip to content

Commit ef6adee

Browse files
author
Alexey Stukalov
committed
show(::Sem): respect existing :compact key
1 parent 2ddadf0 commit ef6adee

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • src/frontend/specification

src/frontend/specification/Sem.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,11 +612,14 @@ _subtype_info(::Sem) = ""
612612
_subtype_info(::SemFiniteDiff) = " : Finite Difference Approximation"
613613

614614
function Base.show(io::IO, sem::AbstractSem)
615+
# if not specified, use compact printing for larger models
616+
if !haskey(io, :compact) && length(loss_terms(sem)) >= 5
617+
io = IOContext(io, :compact => true)
618+
end
615619
print(io, "Structural Equation Model")
616620
print(io, _subtype_info(sem))
617621
print("\n")
618622
print(io, "- Loss Functions \n")
619-
io = length(loss_terms(sem)) >= 5 ? IOContext(io, :compact => true) : io
620623
for term in loss_terms(sem)
621624
print(io, " > ")
622625
print(io, term)

0 commit comments

Comments
 (0)