Skip to content

Commit 6f7a64a

Browse files
fix docs
1 parent 3ab7bf6 commit 6f7a64a

File tree

8 files changed

+50
-71
lines changed

8 files changed

+50
-71
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ Manifest.toml
88
/docs/build/
99
.vscode
1010
LocalPreferences.toml
11-
.DS_Store
11+
.DS_Store
12+
docs/src/democards/gridtheme.css

GNNGraphs/src/operators.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# 2 or more args graph operators
2+
""""
3+
intersect(g1::GNNGraph, g2::GNNGraph)
4+
5+
Intersect two graphs by keeping only the common edges.
6+
"""
27
function Base.intersect(g1::GNNGraph, g2::GNNGraph)
38
@assert g1.num_nodes == g2.num_nodes
49
@assert graph_type_symbol(g1) == graph_type_symbol(g2)

GNNGraphs/src/query.jl

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,17 @@ Graphs.ne(g::GNNGraph) = g.num_edges
8989
Graphs.has_vertex(g::GNNGraph, i::Int) = 1 <= i <= g.num_nodes
9090
Graphs.vertices(g::GNNGraph) = 1:(g.num_nodes)
9191

92-
function Graphs.neighbors(g::GNNGraph, i; dir = :out)
92+
93+
"""
94+
neighbors(g::GNNGraph, i::Integer; dir=:out)
95+
96+
Return the neighbors of node `i` in the graph `g`.
97+
If `dir=:out`, return the neighbors through outgoing edges.
98+
If `dir=:in`, return the neighbors through incoming edges.
99+
100+
See also [`outneighbors`](@ref Graphs.outneighbors), [`inneighbors`](@ref Graphs.inneighbors).
101+
"""
102+
function Graphs.neighbors(g::GNNGraph, i::Integer; dir::Symbol = :out)
93103
@assert dir (:in, :out)
94104
if dir == :out
95105
outneighbors(g, i)
@@ -98,6 +108,13 @@ function Graphs.neighbors(g::GNNGraph, i; dir = :out)
98108
end
99109
end
100110

111+
"""
112+
outneighbors(g::GNNGraph, i::Integer)
113+
114+
Return the neighbors of node `i` in the graph `g` through outgoing edges.
115+
116+
See also [`neighbors`](@ref Graphs.neighbors) and [`inneighbors`](@ref Graphs.inneighbors).
117+
"""
101118
function Graphs.outneighbors(g::GNNGraph{<:COO_T}, i::Integer)
102119
s, t = edge_index(g)
103120
return t[s .== i]
@@ -108,6 +125,13 @@ function Graphs.outneighbors(g::GNNGraph{<:ADJMAT_T}, i::Integer)
108125
return findall(!=(0), A[i, :])
109126
end
110127

128+
"""
129+
inneighbors(g::GNNGraph, i::Integer)
130+
131+
Return the neighbors of node `i` in the graph `g` through incoming edges.
132+
133+
See also [`neighbors`](@ref Graphs.neighbors) and [`outneighbors`](@ref Graphs.outneighbors).
134+
"""
111135
function Graphs.inneighbors(g::GNNGraph{<:COO_T}, i::Integer)
112136
s, t = edge_index(g)
113137
return s[t .== i]

docs/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[deps]
22
DemoCards = "311a05b2-6137-4a5a-b473-18580a3d38b5"
33
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
4+
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
45
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
56
GNNGraphs = "aed8fd31-079b-4b5a-b342-a13352159b8c"
67
GraphNeuralNetworks = "cffab07f-9bc2-4db1-8861-388f63bf7694"

docs/make.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@ using Flux, NNlib, GraphNeuralNetworks, Graphs, SparseArrays
22
using GNNGraphs
33
using Pluto, PlutoStaticHTML # for tutorials
44
using Documenter, DemoCards
5+
using DocumenterInterLinks
56

6-
# tutorials, tutorials_cb, tutorial_assets = makedemos("tutorials")
7+
#
78

9+
# tutorials, tutorials_cb, tutorial_assets = makedemos("tutorials")
810
assets = []
911
# isnothing(tutorial_assets) || push!(assets, tutorial_assets)
1012

13+
interlinks = InterLinks(
14+
"NNlib" => "https://fluxml.ai/NNlib.jl/stable/",
15+
"Graphs" => "https://juliagraphs.org/Graphs.jl/stable/")
16+
17+
1118
DocMeta.setdocmeta!(GraphNeuralNetworks, :DocTestSetup,
1219
:(using GraphNeuralNetworks, Graphs, SparseArrays, NNlib, Flux);
1320
recursive = true)
@@ -19,6 +26,7 @@ makedocs(;
1926
modules = [GraphNeuralNetworks, GNNGraphs],
2027
doctest = false,
2128
clean = true,
29+
plugins = [interlinks],
2230
format = Documenter.HTML(; mathengine, prettyurls, assets = assets),
2331
sitename = "GraphNeuralNetworks.jl",
2432
pages = ["Home" => "index.md",

docs/src/api/gnngraph.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Pages = ["gnngraph.md"]
2121

2222
```@docs
2323
GNNGraph
24+
Base.copy
2425
```
2526

2627
## DataStore
@@ -40,8 +41,8 @@ Private = false
4041
```
4142

4243
```@docs
43-
Graphs.outneighbors
44-
Graphs.inneighbors
44+
Graphs.neighbors
45+
Graphs.has_edge
4546
```
4647

4748
## Transform

docs/src/api/utils.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,9 @@ GraphNeuralNetworks.softmax_edge_neighbors
3333

3434
### NNlib
3535

36-
Primitive functions implemented in NNlib.jl.
36+
Primitive functions implemented in NNlib.jl:
3737

38-
```@docs
39-
NNlib.gather!
40-
NNlib.gather
41-
NNlib.scatter!
42-
NNlib.scatter
43-
```
38+
- [`gather!`](https://fluxml.ai/NNlib.jl/stable/reference/#NNlib.gather!)
39+
- [`gather`](https://fluxml.ai/NNlib.jl/stable/reference/#NNlib.gather)
40+
- [`scatter!`](https://fluxml.ai/NNlib.jl/stable/reference/#NNlib.scatter!)
41+
- [`scatter`](https://fluxml.ai/NNlib.jl/stable/reference/#NNlib.scatter)

docs/src/democards/gridtheme.css

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)