Skip to content

Commit f1a4ef2

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

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

docs/src/API.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ rem_edge!(mg::MultilayerDiGraph, src::MultilayerVertex, dst::MultilayerVertex)
222222
get_metadata(mg::AbstractMultilayerGraph, mv::MultilayerVertex)
223223
get_metadata(mg::AbstractMultilayerGraph, src::MultilayerVertex, dst::MultilayerVertex)
224224
get_weight(mg::AbstractMultilayerGraph, src::MultilayerVertex, dst::MultilayerVertex)
225+
set_weight!(mg::M, src::MultilayerVertex, dst::MultilayerVertex, weight::U) where { T,U, M <: AbstractMultilayerUGraph{T,U}}
226+
set_weight!(mg::M, src::MultilayerVertex, dst::MultilayerVertex, weight::U) where { T,U, M <: AbstractMultilayerDiGraph{T,U}}
225227
is_directed(mg::AbstractMultilayerUGraph)
226228
is_directed(m::M) where { M <: Type{ <: AbstractMultilayerUGraph}}
227229
is_directed(mg::AbstractMultilayerDiGraph)

docs/src/index.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const multilayervertices_meta = [MV(node, ("I'm node $(node.id)",)) for node in
9797
MV(Node("node_7"), :nothing, ("I'm node node_7",))
9898
```
9999

100-
This conversion is done since it is logical to add vertices to a graph, not nodes, and also for consistency reasons with the ecosystem.
100+
This conversion from `Node`s to `MultilayerVertex`s is performed since it is logical to add vertices to a graph, not nodes, and also for consistency reasons with the ecosystem.
101101

102102
Printing a `MultilayerVertex` returns:
103103

@@ -108,7 +108,7 @@ multilayervertices_meta[1]
108108
MV(Node("node_1"), :nothing, ("I'm node node_1",))
109109
```
110110

111-
Where `MV` is an alias for `MultilayerVertex`. The first field is the `Node` being represented (accessible via the [`node`](@ref) function), the second the (name of) the layer the vertex is represented in ((accessible via the [`layer`](@ref) function), here it is set to `nothing`, since these vertices are yet to be assigned), and the metadata associated to the vertex ((accessible via the [`metadata`](@ref) function), no metadata are currently represented via an empty `NamedTuple`). `MultilayerVertex` metadata can be represented via a `Tuple` or a `NamedTuple` (see below for examples). For a complete list of methods applicable to `MultilayerVertices`, plese refer to the [Vertices](@ref vertices_eu) of the API.
111+
Where `MV` is an alias for `MultilayerVertex`. The first field is the `Node` being represented (accessible via the [`node`](@ref) function), the second the (name of) the layer the vertex is represented in (accessible via the [`layer`](@ref) function, here it is set to `nothing`, since these vertices are yet to be assigned), and the metadata associated to the vertex (accessible via the [`metadata`](@ref) function, no metadata are currently represented via an empty `NamedTuple`). `MultilayerVertex` metadata can be represented via a `Tuple` or a `NamedTuple` (see below for examples). For a complete list of methods applicable to `MultilayerVertices`, plese refer to the [Vertices](@ref vertices_eu) of the API.
112112

113113
### Layers
114114

@@ -128,7 +128,7 @@ Layer(
128128
)
129129
```
130130

131-
A `Layer` is considered "weighted" if its underlying graph (`null_graph` argument) has been given the `IsWeighted` trait (traits throughout this package are implemented via [SimpleTraits.jl](https://github.com/mauro3/SimpleTraits.jl), just like Graphs.jl does). Since one may at any moment add a new weighted `Layer` to a `MultilayerGraph` (see below for details), the latter is always considered a "weighted graph", so it is given the `IsWeighted` trait. Thus, all `Layer`s and `Interlayer`s (collectively named "subgraphs" hereafter) must specify their `weighttype` as the last argument of their constructor, so the user may debug their weight matrices immediately after construction. As better specified below, all subgraphs that are meant to be part of the same `MultilayerGraph` must have the same `weighttype`.
131+
A `Layer` is considered "weighted" if its underlying graph (`null_graph` argument) has been given the `IsWeighted` trait (traits throughout this package are implemented via [SimpleTraits.jl](https://github.com/mauro3/SimpleTraits.jl), just like Graphs.jl does). Since one may at any moment add a new weighted `Layer` to a `MultilayerGraph` (see below for details), the latter is always considered a "weighted graph", so it is given the `IsWeighted` trait. Thus, all `Layer`s and `Interlayer`s (collectively named "subgraphs" hereafter) must specify their `weighttype` as the last argument of their constructor, so the user may debug their weight matrices ([`weights(subgraph::AbstractSubGraph)`](@ref)) immediately after construction. As better specified below, all subgraphs that are meant to be part of the same `MultilayerGraph` must have the same `weighttype`.
132132

133133
Before instantiating `Layer`s, we define an utility function to ease randomization:
134134

@@ -456,7 +456,6 @@ get_metadata(layer_mg, MV(new_node))
456456

457457
By design, one may not add nor remove vertices to `Interlayer`s.
458458

459-
A complete list of methods relating to subgraphs can be found [here](@ref subgraphs_eu).
460459

461460
### [Edges](@ref edges_tut_subg)
462461

@@ -599,6 +598,8 @@ The edge may be removed via
599598
rem_edge!(layer_swg, src_w, dst_w)
600599
```
601600

601+
A complete list of methods relating to subgraphs can be found [here](@ref subgraphs_eu).
602+
602603
### Multilayer Graphs
603604

604605
Given all the `Layer`s and the `Interlayer`s, let's instantiate a multilayer graph as follows:
@@ -613,7 +614,7 @@ multilayergraph = MultilayerGraph( layers,
613614

614615
**Keep in mind that `Multilayer(Di)Graph` only supports uniform and standard interface for both `add_vertex!` and `add_edge!`.**
615616

616-
As already stated, a `MultilayerGraph` is an object made of `Layer`s and `Interlayer`s whose collections of vertices each represents a subset of the set of nodes, here being `nodes`.
617+
As already stated, a `MultilayerGraph` is an object made of `Layer`s and `Interlayer`s whose collections of vertices each represents a subset of the set of nodes, here being the variable `nodes`.
617618

618619
*Adding* a `Node` to a `MultilayerGraph` will enable its `Layer`s (and thus its `Interlayer`s) to represent it i.e. you will be able to add `MultilayerVertex`s that represent that `Node` to the multilayer graph.
619620

@@ -685,7 +686,7 @@ true
685686

686687
#### Modifying edge weight and metadata and vertex metadata
687688

688-
One may modify the weight of the edge of a multilayer graph via the `set_weight!` function. The call will succeed only if the edge that is acted upon exists and belongs to a weighted subgraph:
689+
One may modify the weight of the edge of a multilayer graph via the [`set_weight!`](@ref) function. The call will succeed only if the edge that is acted upon exists and belongs to a weighted subgraph:
689690

690691

691692
```julia

0 commit comments

Comments
 (0)