Skip to content

Commit 3e38ddb

Browse files
committed
Fixing modelList printing
1 parent af81844 commit 3e38ddb

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/component_models/ModelList.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,9 +469,10 @@ function convert_vars!(mapped_vars::Dict{String,Dict{Symbol,Any}}, type_promotio
469469
end
470470
end
471471

472-
function Base.show(io::IO, ::MIME"text/plain", t::ModelList)
473-
print(io, dep(t))
474-
print(io, status(t))
472+
function Base.show(io::IO, m::MIME"text/plain", t::ModelList)
473+
show(io, m, dep(t))
474+
println(io, "")
475+
show(io, m, status(t))
475476
end
476477

477478
# Short form printing (e.g. inside another object)

src/dependencies/dependency_graph.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ AbstractTrees.printnode(io::IO, node::SoftDependencyNode{T}) where {T} = print(i
6565
Base.show(io::IO, t::AbstractDependencyNode) = AbstractTrees.print_tree(io, t)
6666
Base.length(t::AbstractDependencyNode) = length(collect(AbstractTrees.PreOrderDFS(t)))
6767

68-
function Base.show(io::IO, t::DependencyGraph{Dict{Pair{String,Symbol},PlantSimEngine.SoftDependencyNode}})
68+
# Long form printing
69+
function Base.show(io::IO, ::MIME"text/plain", t::DependencyGraph)
6970
# If the graph is cyclic, we print the cycle because we can't print indefinitely:
7071
iscyclic, cycle_vec = is_graph_cyclic(t; warn=false, full_stack=true)
7172
if iscyclic
7273
print(io, "⚠ Cyclic dependency graph: \n $(print_cycle(cycle_vec))")
7374
return nothing
7475
else
7576
draw_dependency_graph(io, t)
76-
print(io, "The dependency graph is acyclic.")
7777
end
7878
end
7979

src/dependencies/printing.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function draw_dependency_graph(
22
io,
3-
graphs::DependencyGraph{Dict{Pair{String,Symbol},PlantSimEngine.SoftDependencyNode}};
3+
graphs::DependencyGraph;
44
title="Dependency graph",
55
title_style::String="#FFA726 italic",
66
guides_style::String="#42A5F5",

0 commit comments

Comments
 (0)