Skip to content

Commit

Permalink
Documentation with MultiDocumenter.jl (#508)
Browse files Browse the repository at this point in the history
* New docs

* Update

* Actions

* Fix branch

* Fix

* Change path

* Tentative

* Fix

* Some checks

* Add Graphs interlink

* FIx

* ok

* fix?

* update julia version

* Change  a bit

* dev GNNGraphs

* Fix path

* Test

* Add envs

* Rewrite GraphNeuralNetwork part

* Fix typo

* Remove old docs

* Test branch docs

* Other test

* Another test

* Test

* New test

* Back to prevous path

* Back to git error

* As Datatoolkit

* Change name

* remove

* Locally works

* Test push in branch

* Add check

* Change repo

* Test GNNGraphs deploy

* Fix spaces

* Fix workflows

* Remove https from repo paths

* Fix datasets

* Fixes

* Remove git ignore

* Test url

* Back to previous urls and update yml

* Fix

* test yml

* Later

* Fix L

* Test as multi

* Update gitignore

* Test orphan branch

* Add git config

* Add checks

* Stash

* drop stash useless

* Force checkout

* Add restore

* Check what is deleting

* Other check to understand

* It was deleting docs

* Fix typo

* Fix name

* Cleaner

* Clean to be merge in master

* Fix branch switch to master
  • Loading branch information
aurorarossi authored Nov 4, 2024
1 parent 15055d8 commit 9d982be
Show file tree
Hide file tree
Showing 56 changed files with 1,146 additions and 249 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/docs.yml

This file was deleted.

113 changes: 113 additions & 0 deletions .github/workflows/multidocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: MultiDocumentation

on:
push:
branches:
- master
tags: '*'
pull_request:

jobs:
build_multidocs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1.10.5'
- uses: julia-actions/cache@v2

- name: Set up
run: git config --global init.defaultBranch master

# Build GNNGraphs docs
- name: Install dependencies for GNNGraphs
run:
julia --project=GNNGraphs/docs/ -e '
using Pkg;
Pkg.develop(PackageSpec(path=joinpath(pwd(), "GNNGraphs")));
Pkg.instantiate();'
- name: Build GNNGraphs docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
run: julia --project=GNNGraphs/docs/ GNNGraphs/docs/make.jl

# Build GNNlib docs
- name: Install dependencies for GNNlib
run: julia --project=GNNlib/docs/ -e 'using Pkg; Pkg.instantiate();'
- name: Build GNNlib docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
run: julia --project=GNNlib/docs/ GNNlib/docs/make.jl

# Build GNNLux docs
- name: Install dependencies for GNNLux
run: julia --project=GNNLux/docs/ -e '
using Pkg;
Pkg.develop(PackageSpec(path=joinpath(pwd(), "GNNLux")));
Pkg.instantiate();'
- name: Build GNNLux docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
run: julia --project=GNNLux/docs/ GNNLux/docs/make.jl

# Build GraphNeuralNetworks docs
- name: Install dependencies for GraphNeuralNetworks
run: julia --project=GraphNeuralNetworks/docs/ -e '
using Pkg;
Pkg.develop(PackageSpec(path=joinpath(pwd(), "GraphNeuralNetworks")));
Pkg.instantiate();'
- name: Build GraphNeuralNetworks docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
run: julia --project=GraphNeuralNetworks/docs/ GraphNeuralNetworks/docs/make.jl

# Build multidocs
- name: Install dependencies for main docs
run: julia --project=GraphNeuralNetworks/docs/ -e '
using Pkg;
Pkg.develop(PackageSpec(path=joinpath(pwd(), "GraphNeuralNetworks")));
Pkg.instantiate();'
- name: Build main docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
run: julia --project=GraphNeuralNetworks/docs/make.jl

# Build tutorials
- name: Install dependencies for tutorials
run: julia --project=tutorials/docs/ -e 'using Pkg; Pkg.instantiate();'
- name: Build tutorials
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
run: julia --project=tutorials/docs/ tutorials/docs/make.jl

# Build and deploy multidocs
- name: Install dependencies for multidocs
run: julia --project=docs/ -e '
using Pkg;
Pkg.develop([PackageSpec(path=joinpath(pwd(), "GraphNeuralNetworks")),
PackageSpec(path=joinpath(pwd(), "GNNGraphs")),
PackageSpec(path=joinpath(pwd(), "GNNlib")),
PackageSpec(path=joinpath(pwd(), "GNNLux"))]);
Pkg.instantiate();'
- name: Check if objects.inv exists for GraphNeuralNetworks
run: |
if [ -f GraphNeuralNetworks/docs/build/objects.inv ]; then
echo "GraphNeuralNetworks: objects.inv exists."
else
echo "GraphNeuralNetworks: objects.inv does not exist!" && exit 1
fi
- name: Build and deploy multidocs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
julia --project=docs/ docs/make-multi.jl
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
*.swp
*.swo
Manifest.toml
/docs/build/
.vscode
LocalPreferences.toml
.DS_Store
docs/src/democards/gridtheme.css
test.jl
test.jl
docs/build
GNNGraphs/docs/build
GNNlib/docs/build
GNNLux/docs/build
GraphNeuralNetworks/docs/build
tutorials/docs/build
6 changes: 6 additions & 0 deletions GNNGraphs/docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
GNNGraphs = "aed8fd31-079b-4b5a-b342-a13352159b8c"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
32 changes: 32 additions & 0 deletions GNNGraphs/docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Documenter
using DocumenterInterLinks
using GNNGraphs
import Graphs
using Graphs: induced_subgraph

assets=[]
prettyurls = get(ENV, "CI", nothing) == "true"
mathengine = MathJax3()


makedocs(;
modules = [GNNGraphs],
doctest = false,
clean = true,
format = Documenter.HTML(; mathengine, prettyurls, assets = assets, size_threshold=nothing),
sitename = "GNNGraphs.jl",
pages = ["Home" => "index.md",
"Graphs" => ["gnngraph.md", "heterograph.md", "temporalgraph.md"],
"Datasets" => "datasets.md",
"API Reference" => [
"GNNGraph" => "api/gnngraph.md",
"GNNHeteroGraph" => "api/heterograph.md",
"TemporalSnapshotsGNNGraph" => "api/temporalgraph.md",
],
]
)

deploydocs(;repo = "github.com/JuliaGraphs/GraphNeuralNetworks.jl.git",
devbranch = "master",
push_preview = true,
dirname = "GNNGraphs")
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CurrentModule = GNNGraphs

# GNNGraph

Documentation page for the graph type `GNNGraph` provided by GraphNeuralNetworks.jl and related methods.
Documentation page for the graph type `GNNGraph` provided by GNNGraphs.jl and related methods.

Besides the methods documented here, one can rely on the large set of functionalities
given by [Graphs.jl](https://github.com/JuliaGraphs/Graphs.jl) thanks to the fact
Expand Down
17 changes: 17 additions & 0 deletions GNNGraphs/docs/src/api/heterograph.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Heterogeneous Graphs


## GNNHeteroGraph
Documentation page for the type `GNNHeteroGraph` representing heterogeneous graphs, where nodes and edges can have different types.


```@autodocs
Modules = [GNNGraphs]
Pages = ["gnnheterograph.jl"]
Private = false
```

```@docs
Graphs.has_edge(::GNNHeteroGraph, ::Tuple{Symbol, Symbol, Symbol}, ::Integer, ::Integer)
```

File renamed without changes.
10 changes: 10 additions & 0 deletions GNNGraphs/docs/src/datasets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Datasets

GNNGraphs.jl doesn't come with its own datasets, but leverages those available in the Julia (and non-Julia) ecosystem. In particular, the [examples in the GraphNeuralNetworks.jl repository](https://github.com/JuliaGraphs/GraphNeuralNetworks.jl/tree/master/examples) make use of the [MLDatasets.jl](https://github.com/JuliaML/MLDatasets.jl) package. There you will find common graph datasets such as Cora, PubMed, Citeseer, TUDataset and [many others](https://juliaml.github.io/MLDatasets.jl/dev/datasets/graphs/).
For graphs with static structures and temporal features, datasets such as METRLA, PEMSBAY, ChickenPox, and WindMillEnergy are available. For graphs featuring both temporal structures and temporal features, the TemporalBrains dataset is suitable.

GraphNeuralNetworks.jl provides the [`mldataset2gnngraph`](@ref) method for interfacing with MLDatasets.jl.

```@docs
mldataset2gnngraph
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Working with GNNGraph
# Static Graphs

The fundamental graph type in GraphNeuralNetworks.jl is the [`GNNGraph`](@ref).
The fundamental graph type in GNNGraphs.jl is the [`GNNGraph`](@ref).
A GNNGraph `g` is a directed graph with nodes labeled from 1 to `g.num_nodes`.
The underlying implementation allows for efficient application of graph neural network
operators, gpu movement, and storage of node/edge/graph related feature arrays.
Expand All @@ -12,7 +12,7 @@ therefore it supports most functionality from that library.
A GNNGraph can be created from several different data sources encoding the graph topology:

```julia
using GraphNeuralNetworks, Graphs, SparseArrays
using GNNGraphs, Graphs, SparseArrays


# Construct a GNNGraph from from a Graphs.jl's graph
Expand Down Expand Up @@ -124,7 +124,7 @@ g′.e
## Edge weights

It is common to denote scalar edge features as edge weights. The `GNNGraph` has specific support
for edge weights: they can be stored as part of internal representations of the graph (COO or adjacency matrix). Some graph convolutional layers, most notably the [`GCNConv`](@ref), can use the edge weights to perform weighted sums over the nodes' neighborhoods.
for edge weights: they can be stored as part of internal representations of the graph (COO or adjacency matrix). Some graph convolutional layers, most notably the `GCNConv`, can use the edge weights to perform weighted sums over the nodes' neighborhoods.

```julia
julia> source = [1, 1, 2, 2, 3, 3];
Expand Down Expand Up @@ -233,7 +233,7 @@ Moreover, a `GNNGraph` can be easily constructed from a `Graphs.Graph` or a `Gra
```julia
julia> import Graphs

julia> using GraphNeuralNetworks
julia> using GNNGraphs

# A Graphs.jl undirected graph
julia> gu = Graphs.erdos_renyi(10, 20)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Relations such as `:rate` or `:like` can connect nodes of different types. We ca

Different node/edge types can store different groups of features
and this makes heterographs a very flexible modeling tools
and data containers. In GraphNeuralNetworks.jl heterographs are implemented in
and data containers. In GNNGraphs.jl heterographs are implemented in
the type [`GNNHeteroGraph`](@ref).


Expand Down Expand Up @@ -137,4 +137,4 @@ end

## Graph convolutions on heterographs

See [`HeteroGraphConv`](@ref) for how to perform convolutions on heterogeneous graphs.
See `HeteroGraphConv` for how to perform convolutions on heterogeneous graphs.
15 changes: 15 additions & 0 deletions GNNGraphs/docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# GNNGraphs.jl

GNNGraphs.jl is a package that provides graph data structures and helper functions specifically designed for working with graph neural networks. This package allows to store not only the graph structure, but also features associated with nodes, edges, and the graph itself. It is the core foundation for the GNNlib, GraphNeuralNetworks, and GNNLux packages.

It supports three types of graphs:

- **Static graph** is the basic graph type represented by [`GNNGraph`](@ref), where each node and edge can have associated features. This type of graph is used in typical graph neural network applications, where neural networks operate on both the structure of the graph and the features stored in it. It can be used to represent a graph where the structure does not change over time, but the features of the nodes and edges can change over time.

- **Heterogeneous graph** is a graph that supports multiple types of nodes and edges, and is represented by [`GNNHeteroGraph`](@ref). Each type can have its own properties and relationships. This is useful in scenarios with different entities and interactions, such as in citation graphs or multi-relational data.

- **Temporal graph** is a graph that changes over time, and is represented by [`TemporalSnapshotsGNNGraph`](@ref). Edges and features can change dynamically. This type of graph is useful for applications that involve tracking time-dependent relationships, such as social networks.



This package depends on the package [Graphs.jl] (https://github.com/JuliaGraphs/Graphs.jl).
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Temporal Graphs

Temporal Graphs are graphs with time varying topologies and node features. In GraphNeuralNetworks.jl temporal graphs with fixed number of nodes over time are supported by the [`TemporalSnapshotsGNNGraph`](@ref) type.
Temporal Graphs are graphs with time varying topologies and features. In GNNGraphs.jl, temporal graphs with fixed number of nodes over time are supported by the [`TemporalSnapshotsGNNGraph`](@ref) type.

## Creating a TemporalSnapshotsGNNGraph

Expand Down Expand Up @@ -91,7 +91,7 @@ GNNGraph:
```

## Data Features
A temporal graph can stode global feautre for the entire time series in the `tgdata` filed.
A temporal graph can store global feature for the entire time series in the `tgdata` filed.
Also, each snapshot can store node, edge, and graph features in the `ndata`, `edata`, and `gdata` fields, respectively.

```jldoctest
Expand Down Expand Up @@ -126,10 +126,10 @@ julia> [g.x for g in tg.snapshots]; # same vector as above, now accessing

## Graph convolutions on TemporalSnapshotsGNNGraph

A graph convolutional layer can be applied to each snapshot independently, in the next example we apply a `GINConv` layer to each snapshot of a `TemporalSnapshotsGNNGraph`. The list of compatible graph convolution layers can be found [here](api/conv.md).
A graph convolutional layer can be applied to each snapshot independently, in the next example we apply a `GINConv` layer to each snapshot of a `TemporalSnapshotsGNNGraph`.

```jldoctest
julia> using GraphNeuralNetworks, Flux
julia> using GNNGraphs, Flux
julia> snapshots = [rand_graph(10, 20; ndata = rand(3, 10)), rand_graph(10, 14; ndata = rand(3, 10))];
Expand Down
5 changes: 5 additions & 0 deletions GNNLux/docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
GNNLux = "e8545f4d-a905-48ac-a8c4-ca114b98986d"
GNNlib = "a6a84749-d869-43f8-aacc-be26a1996e48"
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
28 changes: 28 additions & 0 deletions GNNLux/docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Documenter
using GNNlib
using GNNLux



assets=[]
prettyurls = get(ENV, "CI", nothing) == "true"
mathengine = MathJax3()


makedocs(;
modules = [GNNLux],
doctest = false,
clean = true,
format = Documenter.HTML(; mathengine, prettyurls, assets = assets, size_threshold=nothing),
sitename = "GNNLux.jl",
pages = ["Home" => "index.md",
"Basic" => "api/basic.md"],
)




deploydocs(;repo = "github.com/JuliaGraphs/GraphNeuralNetworks.jl.git",
devbranch = "master",
push_preview = true,
dirname = "GNNLux")
8 changes: 8 additions & 0 deletions GNNLux/docs/src/api/basic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
```@meta
CurrentModule = GNNLux
```

## GNNLayer
```@docs
GNNLux.GNNLayer
```
5 changes: 5 additions & 0 deletions GNNLux/docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# GNNLux.jl

GNNLux.jl is a work-in-progress package that implements stateless graph convolutional layers, fully compatible with the [Lux.jl](https://lux.csail.mit.edu/stable/) machine learning framework. It is built on top of the GNNGraphs.jl, GNNlib.jl, and Lux.jl packages.

The full documentation will be available soon.
Loading

0 comments on commit 9d982be

Please sign in to comment.