Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MultilayerGraphs"
uuid = "af984530-d72f-4904-8b81-b992bbbeaf3f"
authors = ["Claudio Moroni <43729990+ClaudMor@users.noreply.github.com>", "Pietro Monticone <38562595+pitmonticone@users.noreply.github.com>"]
version = "1.1.4"
version = "1.1.5"

[deps]
Bijections = "e2ed5e7c-b2de-5872-ae92-c73ca462fb04"
Expand Down Expand Up @@ -30,7 +30,7 @@ Graphs = "1"
IterTools = "1.4"
MetaGraphs = "0.7, 0.8"
OMEinsum = "0.8, 0.9"
PrettyTables = "2.2, 3"
PrettyTables = "3"
SimpleTraits = "0.9"
SimpleValueGraphs = "0.4"
SimpleWeightedGraphs = "1.2"
Expand Down
24 changes: 11 additions & 13 deletions src/abstractmultilayergraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1230,27 +1230,25 @@ function to_string(x::AbstractMultilayerGraph)

layers_names = name.(x.layers)
layers_underlying_graphs = typeof.(graph.(x.layers))

layers_table = pretty_table(
String,
hcat(layers_names, layers_underlying_graphs);
title="### LAYERS",
header=(["NAME", "UNDERLYING GRAPH"]),
column_labels=(["NAME", "UNDERLYING GRAPH"]),
alignment=:c,
header_alignment=:c,
header_crayon=crayon"yellow bold",
hlines=:all,
column_label_alignment=:c,
style=TextTableStyle(; first_line_column_label=crayon"yellow bold"),
table_format=TextTableFormat(; @text__all_horizontal_lines()),
)

interlayers_names = name.(values(x.interlayers))
interlayers_underlying_graphs = typeof.(graph.(values(x.interlayers)))
interlayer_layer_1s = getproperty.(values(x.interlayers), Ref(:layer_1))
interlayer_layer_2s = getproperty.(values(x.interlayers), Ref(:layer_2))
interlayer_tranfers =
getproperty.(values(x.interlayers), Ref(:transfer_vertex_metadata))
interlayer_tranfers = getproperty.(
values(x.interlayers), Ref(:transfer_vertex_metadata)
)

interlayers_table = pretty_table(
String,
hcat(
interlayers_names,
interlayer_layer_1s,
Expand All @@ -1259,13 +1257,13 @@ function to_string(x::AbstractMultilayerGraph)
interlayer_tranfers,
);
title="### INTERLAYERS",
header=([
column_labels=([
"NAME", "LAYER 1", "LAYER 2", "UNDERLYING GRAPH", "TRANSFER VERTEX METADATA"
]),
alignment=:c,
header_alignment=:c,
header_crayon=crayon"yellow bold",
hlines=:all,
column_label_alignment=:c,
style=TextTableStyle(; first_line_column_label=crayon"yellow bold"),
table_format=TextTableFormat(; @text__all_horizontal_lines()),
)

return """
Expand Down
4 changes: 4 additions & 0 deletions test/directed.jl
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,7 @@ for layer in all_layers_d
end
end
end

@testset "Printing MultilayerDiGraph" begin
@test_nowarn @show multilayergraph
end
4 changes: 4 additions & 0 deletions test/undirected.jl
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,7 @@ for layer in all_layers_u
end
end
end

@testset "Printing MultilayerGraph" begin
@test_nowarn @show multilayergraph
end
Loading