Skip to content

Commit 83ed729

Browse files
InterdisciplinaryPhysicsTeampitmonticoneClaudMor
committed
Update docstrings
Co-Authored-By: Pietro Monticone <[email protected]> Co-Authored-By: Claudio Moroni <[email protected]>
1 parent cfc6779 commit 83ed729

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

docs/src/API.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ has_edge( subgraph::AbstractSubGraph, s::MultilayerVertex, d::MultilayerVertex)
115115
ne(subgraph::AbstractSubGraph)
116116
edges(subgraph::S) where {T,U,S<:AbstractSubGraph{T,U}}
117117
add_edge!( subgraph::S, me::E) where {T,U<:Real,S<:AbstractSubGraph{T,U},E<:MultilayerEdge{ <: Union{U, Nothing}}}
118+
add_edge!(layer::Layer, src::MultilayerVertex, dst::MultilayerVertex, args...; kwargs...)
119+
add_edge!(interlayer::Interlayer, src::MultilayerVertex, dst::MultilayerVertex, args...; kwargs...)
118120
rem_edge!(subgraph::AbstractSubGraph, src::MultilayerVertex, dst::MultilayerVertex)
119121
rem_edge!(subgraph::AbstractSubGraph, me::MultilayerEdge)
120122
get_metadata(subgraph::AbstractSubGraph, bare_mv::MultilayerVertex)

docs/src/index.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,9 @@ interlayer_sg_swg_vertices = mv_vertices(interlayer_sg_swg)
401401
MV(Node("node_3"), :layer_swg, NamedTuple())
402402
```
403403

404-
The `vertices` command would return an internal representation of the `MultilayerVertex`s. This method, together with others, serves to make `MultilayerGraphs.jl` compatible with the Graphs.jl ecosystem, but it is not meant to be called by the end user. It is, anyway, thought to be used by developers who wish to interface their packages with `MultilayerGraphs.jl` just as with other packages of the `Graphs.jl` ecosystem: a developer-oriented guide will be compiled if there is the need.
404+
The [`vertices(subgraph::AbstractSubGraph)`](@ref) command would return an internal representation of the `MultilayerVertex`s. This method, together with others, serves to make `MultilayerGraphs.jl` compatible with the Graphs.jl ecosystem, but it is not meant to be called by the end user. It is, anyway, thought to be used by developers who wish to interface their packages with `MultilayerGraphs.jl` just as with other packages of the `Graphs.jl` ecosystem: as said above, a developer-oriented guide will be compiled if there is the need, although docstrings are already completed.
405405

406-
In the [API](@ref) page the intended usage of all methods ([End-User](@ref) or [Developer](@ref)) is highlighted.
407-
408-
To add a vertex, simply use [`add_vertex!(layer::Layer, mv::MultilayerVertex)`](@ref). Let us define a vertex with metadata to add. Since nodes may not be represented more than once in layers, we have to define a new node to:
406+
To add a vertex, simply use [`add_vertex!(layer::Layer, mv::MultilayerVertex)`](@ref). Let us define a vertex with metadata to add. Since nodes may not be represented more than once in layers, we have to define a new node too:
409407

410408
```julia
411409
new_node = Node("missing_node")

src/subgraphs/interlayer.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,12 @@ Graphs.has_vertex(interlayer::Interlayer, mv::MultilayerVertex) = get_bare_mv(mv
504504

505505

506506
"""
507+
add_edge!(interlayer::Interlayer, src::MultilayerVertex, dst::MultilayerVertex, args...; kwargs...)
508+
509+
Add edge from vertex `src` to vertex `dst` to Interlayer `interlayer`.Returns true if succeeds, but will fail (return false) if `src` and `dst` belong to the same layer, since interlayers are always bipartite. This method supports the uniform and transparent interfaces. See the [Edges](@ref edges_tut_subg) section of the Tutorial.
507510
"""
508-
function Graphs.add_edge!(interlayer::In, src::MultilayerVertex, dst::MultilayerVertex, args...; kwargs...) where { In <: Interlayer}
511+
function Graphs.add_edge!(interlayer::Interlayer, src::MultilayerVertex, dst::MultilayerVertex, args...; kwargs...)
512+
509513
src_bare = get_bare_mv(src)
510514
dst_bare = get_bare_mv(dst)
511515
!has_vertex(interlayer, src) && throw( ErrorException( "Vertex $(src) does not belong to the interlayer."))

src/subgraphs/layer.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,9 @@ Graphs.rem_vertex!(layer::L, v::T) where {T, L <: Layer{T}} = rem_vertex!(layer.
295295
"""
296296
add_edge!(layer::L, src::MultilayerVertex, dst::MultilayerVertex, args...; kwargs...) where {L <: Layer}
297297
298-
Add edge from vertex `src` to vertex `dst` to layer `layer`. This method supports the uniform and transparent interfaces. See the [Edges](@ref) section of the Tutorial.
298+
Add edge from vertex `src` to vertex `dst` to layer `layer`. Returns true if succeeds. This method supports the uniform and transparent interfaces. See the [Edges](@ref edges_tut_subg) section of the Tutorial.
299299
"""
300-
function Graphs.add_edge!(layer::L, src::MultilayerVertex, dst::MultilayerVertex, args...; kwargs...) where {L <: Layer}
300+
function Graphs.add_edge!(layer::Layer, src::MultilayerVertex, dst::MultilayerVertex, args...; kwargs...)
301301
# Check if the vertices exist
302302
!has_vertex(layer, src) && throw( ErrorException( "Vertex $(src) does not belong to the layer."))
303303
!has_vertex(layer, dst) && throw( ErrorException( "Vertex $(dst) does not belong to the layer."))

0 commit comments

Comments
 (0)