Skip to content

Commit 96931f6

Browse files
fix docs (#455)
* fix docs * fix docs * reintroduce tutorials * polishing * mlutils * workflow * fixes * workflow * anouther attempt * try again
1 parent a32fb04 commit 96931f6

30 files changed

+4666
-2548
lines changed

.github/workflows/docs.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@ jobs:
1414
- uses: actions/checkout@v4
1515
- uses: julia-actions/setup-julia@latest
1616
with:
17-
version: '1.9.1'
17+
version: '1.10.4'
1818
- name: Install dependencies
19-
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
19+
run: julia --project=docs/ -e '
20+
using Pkg;
21+
Pkg.develop([PackageSpec(path=pwd()), PackageSpec(path=joinpath(pwd(), "GNNGraphs"))]);
22+
Pkg.instantiate();'
2023
- name: Build and deploy
2124
env:
22-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
23-
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key
24-
run: julia --project=docs/ docs/make.jl
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
26+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
27+
run: julia --project=docs/ docs/make.jl

.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]

GNNlib/Project.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,11 @@ Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
1212
KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77"
1313
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1414
MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54"
15-
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
1615
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
17-
NearestNeighbors = "b8a86587-4115-5ab1-83bc-aa920d37bbce"
1816
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1917
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
2018
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
2119
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
22-
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
2320

2421
[weakdeps]
2522
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
@@ -38,14 +35,11 @@ KrylovKit = "0.6, 0.7"
3835
LinearAlgebra = "1"
3936
MLDatasets = "0.7"
4037
MLUtils = "0.4"
41-
MacroTools = "0.5"
4238
NNlib = "0.9"
43-
NearestNeighbors = "0.4"
4439
Random = "1"
4540
Reexport = "1"
4641
SparseArrays = "1"
4742
Statistics = "1"
48-
StatsBase = "0.34"
4943
cuDNN = "1"
5044
julia = "1.10"
5145

GNNlib/src/GNNlib.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ module GNNlib
22

33
using Statistics: mean
44
using LinearAlgebra, Random
5-
using Base: tail
6-
using MacroTools: @forward
75
using MLUtils
86
using NNlib
97
using NNlib: scatter, gather

Project.toml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,18 @@ authors = ["Carlo Lucibello and contributors"]
44
version = "0.6.19"
55

66
[deps]
7-
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
87
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
98
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
109
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
1110
Functors = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
1211
GNNGraphs = "aed8fd31-079b-4b5a-b342-a13352159b8c"
13-
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
14-
KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77"
1512
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
16-
MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54"
1713
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
14+
MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54"
1815
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
19-
NearestNeighbors = "b8a86587-4115-5ab1-83bc-aa920d37bbce"
2016
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
2117
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
22-
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
2318
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
24-
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
2519

2620
[weakdeps]
2721
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
@@ -30,26 +24,19 @@ CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
3024
GraphNeuralNetworksCUDAExt = "CUDA"
3125

3226
[compat]
33-
Adapt = "3, 4"
3427
CUDA = "4, 5"
3528
ChainRulesCore = "1"
3629
DataStructures = "0.18"
3730
Flux = "0.14"
3831
Functors = "0.4.1"
39-
Graphs = "1.4"
4032
GNNGraphs = "1.0"
41-
KrylovKit = "0.6, 0.7, 0.8"
4233
LinearAlgebra = "1"
43-
MLDatasets = "0.7"
44-
MLUtils = "0.4"
4534
MacroTools = "0.5"
35+
MLUtils = "0.4"
4636
NNlib = "0.9"
47-
NearestNeighbors = "0.4"
4837
Random = "1"
4938
Reexport = "1"
50-
SparseArrays = "1"
5139
Statistics = "1"
52-
StatsBase = "0.34"
5340
cuDNN = "1"
5441
julia = "1.10"
5542

@@ -59,11 +46,13 @@ CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
5946
ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
6047
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
6148
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
49+
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
6250
InlineStrings = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48"
6351
MLDatasets = "eb30cadb-4394-5ae3-aed4-317e484a6458"
52+
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
6453
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
6554
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
6655
cuDNN = "02a925ec-e4fe-4b08-9a7e-0d78e3d38ccd"
6756

6857
[targets]
69-
test = ["Test", "Adapt", "DataFrames", "InlineStrings", "Zygote", "FiniteDifferences", "ChainRulesTestUtils", "MLDatasets", "CUDA", "cuDNN"]
58+
test = ["Test", "Adapt", "DataFrames", "InlineStrings", "SparseArrays", "Graphs", "Zygote", "FiniteDifferences", "ChainRulesTestUtils", "MLDatasets", "CUDA", "cuDNN"]

docs/Project.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
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"
6+
GNNGraphs = "aed8fd31-079b-4b5a-b342-a13352159b8c"
57
GraphNeuralNetworks = "cffab07f-9bc2-4db1-8861-388f63bf7694"
68
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
79
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
810
MLDatasets = "eb30cadb-4394-5ae3-aed4-317e484a6458"
9-
MarkdownLiteral = "736d6165-7244-6769-4267-6b50796e6954"
1011
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
1112
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
1213
Pluto = "c3e4b0f8-55cb-11ea-2926-15256bba5781"
@@ -17,4 +18,4 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1718

1819
[compat]
1920
DemoCards = "0.5.0"
20-
Documenter = "0.27"
21+
Documenter = "1.5"

docs/make.jl

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
1-
using Flux, NNlib, GraphNeuralNetworks, Graphs, SparseArrays
1+
using GraphNeuralNetworks
2+
using GNNGraphs
3+
using Flux
4+
using NNlib
5+
using Graphs
6+
using SparseArrays
27
using Pluto, PlutoStaticHTML # for tutorials
38
using Documenter, DemoCards
9+
using DocumenterInterLinks
410

5-
tutorials, tutorials_cb, tutorial_assets = makedemos("tutorials")
611

12+
tutorials, tutorials_cb, tutorial_assets = makedemos("tutorials")
713
assets = []
814
isnothing(tutorial_assets) || push!(assets, tutorial_assets)
915

16+
interlinks = InterLinks(
17+
"NNlib" => "https://fluxml.ai/NNlib.jl/stable/",
18+
"Graphs" => "https://juliagraphs.org/Graphs.jl/stable/")
19+
20+
1021
DocMeta.setdocmeta!(GraphNeuralNetworks, :DocTestSetup,
1122
:(using GraphNeuralNetworks, Graphs, SparseArrays, NNlib, Flux);
1223
recursive = true)
@@ -15,10 +26,11 @@ prettyurls = get(ENV, "CI", nothing) == "true"
1526
mathengine = MathJax3()
1627

1728
makedocs(;
18-
modules = [GraphNeuralNetworks, NNlib, Flux, Graphs, SparseArrays],
29+
modules = [GraphNeuralNetworks, GNNGraphs],
1930
doctest = false,
2031
clean = true,
21-
format = Documenter.HTML(; mathengine, prettyurls, assets = assets),
32+
plugins = [interlinks],
33+
format = Documenter.HTML(; mathengine, prettyurls, assets = assets, size_threshold=nothing),
2234
sitename = "GraphNeuralNetworks.jl",
2335
pages = ["Home" => "index.md",
2436
"Graphs" => ["gnngraph.md", "heterograph.md", "temporalgraph.md"],

docs/pluto_output/gnn_intro_pluto.md

Lines changed: 15 additions & 15 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)