Skip to content

Commit fd96e6d

Browse files
committed
try out pydata theme
1 parent 315239d commit fd96e6d

File tree

11 files changed

+175
-9
lines changed

11 files changed

+175
-9
lines changed

.github/workflows/docs.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Deploy Sphinx docs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main, master, docs/pydata ]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.10'
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install -e .[dev]
33+
34+
- name: Build Sphinx site
35+
run: sphinx-build -b html docs docs/_site
36+
37+
- name: Upload artifact
38+
uses: actions/upload-pages-artifact@v3
39+
with:
40+
path: docs/_site
41+
42+
deploy:
43+
needs: build
44+
runs-on: ubuntu-latest
45+
environment:
46+
name: github-pages
47+
url: ${{ steps.deployment.outputs.page_url }}
48+
steps:
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4
52+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
```{toctree}
2+
:maxdepth: 1
3+
4+
dataset_base_classes
5+
graph_serialization
6+
networkx_view
7+
```
8+

docs/api_reference/index.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22

33
This section provides detailed documentation for all public APIs in the polygraph package.
44

5-
## Main Modules
5+
```{toctree}
6+
:maxdepth: 2
67
7-
- **[Metrics](metrics/index.md)** - MMD metrics and evaluation functions for graph analysis
8-
- **[Datasets](datasets.md)** - Dataset abstractions and graph storage utilities
9-
- **[Utils](utils/index.md)** - Utility functions including graph descriptors, kernels, and MMD utilities
8+
datasets/index
9+
metrics/mmd
10+
metrics/frechet
11+
metrics/polygraphscore
12+
metrics/interface
13+
utils/index
14+
```

docs/api_reference/utils/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
```{toctree}
2+
:maxdepth: 1
3+
4+
graph_descriptors
5+
graph_kernels
6+
```
7+

docs/conf.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import os
2+
import sys
3+
4+
sys.path.insert(0, os.path.abspath(".."))
5+
6+
7+
project = "PolyGraph"
8+
copyright = "2025, PolyGraph"
9+
author = "PolyGraph contributors"
10+
11+
extensions = [
12+
"myst_parser",
13+
"sphinx.ext.autodoc",
14+
"sphinx.ext.autosummary",
15+
"sphinx.ext.napoleon",
16+
"sphinx.ext.mathjax",
17+
"sphinx_copybutton",
18+
]
19+
20+
autosummary_generate = True
21+
autodoc_typehints = "description"
22+
23+
templates_path = ["_templates"]
24+
exclude_patterns = [
25+
"_build",
26+
"Thumbs.db",
27+
".DS_Store",
28+
]
29+
30+
myst_enable_extensions = [
31+
"dollarmath",
32+
"amsmath",
33+
]
34+
myst_heading_anchors = 3
35+
36+
source_suffix = {
37+
".rst": "restructuredtext",
38+
".md": "markdown",
39+
}
40+
41+
html_theme = "pydata_sphinx_theme"
42+
43+
html_theme_options = {
44+
"show_prev_next": False,
45+
}
46+
47+
html_static_path = ["_static"]
48+

docs/datasets/index.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
We provide a variety of benchmark datasets:
44

5-
- [Synthetic Datasets](small_synthetic.md) - Small datasets of synthetic graphs
6-
- [Procedural Datasets](procedural.md) - Similar to the synthetic graphs above, but procedurally generated. Datasets may be chosen to be larger.
7-
- [Real-World Datasets](real_world_topologies.md) - Graphs found in the real world
5+
```{toctree}
6+
:maxdepth: 2
7+
8+
small_synthetic
9+
procedural
10+
real_world_topologies
11+
```

docs/index.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,20 @@ We provide a few basic tutorials:
3232
- [Basic Usage](tutorials/basic_usage.md) - How to load datasets and compute metrics
3333
- [Metrics Overview](tutorials/metrics_overview.md) - An overview of which metrics are implemented in `polygraph` (MMD, PGS, VUN, Frechet Distance)
3434
- [Custom Datasets](tutorials/custom_datasets.md) - How to build custom datasets and share them
35+
36+
```{toctree}
37+
:maxdepth: 2
38+
:caption: Contents
39+
40+
installation
41+
tutorials/basic_usage
42+
tutorials/metrics_overview
43+
tutorials/custom_datasets
44+
datasets/index
45+
metrics/gaussian_tv_mmd
46+
metrics/pgs5
47+
metrics/rbf_mmd
48+
metrics/vun
49+
utils/index
50+
api_reference/index
51+
```

docs/utils/index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Utilities
2+
3+
```{toctree}
4+
:maxdepth: 1
5+
6+
descriptors
7+
kernels
8+
mmd_utils
9+
```
10+

pixi.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ polygraph = { path = ".", editable = true, extras = ["dev"] }
1212

1313
[tasks]
1414
test = "pytest -n auto -sv --skip-slow ./tests"
15-
docs = "mkdocs build"
15+
docs = "mkdocs build"
16+
docs-sphinx = "sphinx-build -b html docs docs/_build/html"
17+
docs-serve = "sphinx-autobuild --watch polygraph --watch docs -b html docs docs/_build/html --open-browser --port 8000"

pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,14 @@ dev = [
5555
"jinja2",
5656
"seaborn",
5757
"tueplots",
58-
"typer"
58+
"typer",
59+
"sphinx",
60+
"myst-parser",
61+
"pydata-sphinx-theme",
62+
"sphinx-copybutton",
63+
"sphinx-design",
64+
"sphinx-autodoc-typehints",
65+
"sphinx-autobuild"
5966
]
6067
gpu = [
6168
"dgl @ https://data.dgl.ai/wheels/torch-2.4/cu124/dgl-2.4.0%2Bcu124-cp311-cp311-manylinux1_x86_64.whl",

0 commit comments

Comments
 (0)