Skip to content

Commit b823555

Browse files
InterdisciplinaryPhysicsTeampitmonticoneClaudMor
committed
Implment simpler layer constructors
TODO: - write tests - implement a version of those constructors that takes a list of nodes as `vertices` and a list of 2-tuples of `MultilayerVertex`s as `edge_list`. Co-Authored-By: Pietro Monticone <38562595+pitmonticone@users.noreply.github.com> Co-Authored-By: Claudio Moroni <43729990+ClaudMor@users.noreply.github.com>
1 parent 80f6716 commit b823555

File tree

5 files changed

+1088
-126
lines changed

5 files changed

+1088
-126
lines changed

docs/src/API.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ mv_outneighbors(subgraph::AbstractSubGraph, mv::MultilayerVertex)
112112
mv_neighbors(subgraph::AbstractSubGraph, mv::MultilayerVertex)
113113
has_edge(subgraph::AbstractSubGraph,me::MultilayerEdge)
114114
has_edge( subgraph::AbstractSubGraph, s::MultilayerVertex, d::MultilayerVertex)
115+
has_edge( layer::Layer, s::MultilayerVertex{nothing}, d::MultilayerVertex{nothing})
115116
ne(subgraph::AbstractSubGraph)
116117
edges(subgraph::S) where {T,U,S<:AbstractSubGraph{T,U}}
117118
add_edge!( subgraph::S, me::E) where {T,U<:Real,S<:AbstractSubGraph{T,U},E<:MultilayerEdge{ <: Union{U, Nothing}}}

src/MultilayerGraphs.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ export
7575
AbstractLayer,
7676
Layer,
7777
simple_layer,
78+
simple_dilayer,
79+
simple_weighted_layer,
80+
simple_weighted_dilayer,
81+
metadigraph_layer,
82+
layer_valgraph,
83+
layer_valoutdigraph,
84+
layer_valdigraph,
85+
meta_layer,
7886
has_node,
7987
add_vertex!,
8088
rem_vertex!,

src/graphs_extensions/metagraphs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function _add_edge!(
6363
) where {T<:Integer,W<:Union{<:Real,Nothing}}
6464
(isnothing(weight) || weight == 1.0) ||
6565
@warn "Trying to add a weighted edge to an unweighted graph of type $(typeof(g)). Weight $weight will be ignored."
66-
return add_edge!(g, src, dst, Dict(key => value for (key, value) in pairs(metadata)))
66+
return add_edge!(g, src, dst, Dict(Symbol(pair.first) => pair.second for pair in pairs(metadata) )) #Symbol(string(key)) => value for (key, value) in pairs(metadata)
6767
end
6868

6969
function _get_edge_weight(

0 commit comments

Comments
 (0)