Skip to content

Commit ac8fc88

Browse files
padix-keyyusuf1759tjduignaOleinikovasV
authored
Revamp documentation (#25)
* feat: create new documentation skeleton * refactor: adjust style * feat: generate table reference from TSV files * refactor: migrate content of original README to new docs * lint: apply formatting * feat: use notebooks in tutorials * feat: add api usage examples to api.md * feat: add dataset.md * chore: update dataset.md * refactor: restructure dataset tutorial * refactor: refactor dataset tutorial and reference * refactor: remove temporary code * fix: adapt CI to new documentation build * lint: ruff format * lint: fix newline at end of file * fix: typo * fix: adopt Sphinx table style * fix: use correct plinder.__version__ * chore: comment out plinder API card * chore: update dataset.md * chore: fix local merge conflict * minor edits to dataset tutorial * fix: temporary fix for card layout --------- Co-authored-by: yusuf1759 <mr.adeshina.yusuf@gmail.com> Co-authored-by: Thomas Duignan <thomas.j.duignan@gmail.com> Co-authored-by: OleinikovasV <v.oleinikovas@gmail.com>
1 parent 7f4a57a commit ac8fc88

File tree

29 files changed

+1079
-678
lines changed

29 files changed

+1079
-678
lines changed

.github/workflows/docs.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,21 @@ jobs:
3232
cache-downloads: true
3333
cache-environment: true
3434
post-cleanup: all
35+
- name: Get version bump
36+
id: get-tag
37+
run: echo "bump=$(python flows/docker.py bump)" >> $GITHUB_OUTPUT
3538
- name: Build docs
3639
shell: bash -el {0}
3740
id: build
3841
run: |
3942
which python
4043
python -m pip install six
4144
python -m pip install '.[docs]'
42-
pushd docs && bash build.sh && popd
45+
sphinx-build docs build/docs
4346
- name: Upload build artifact
4447
uses: actions/upload-pages-artifact@v3
4548
with:
46-
path: docs/build/html/
49+
path: build/docs
4750
- name: Deploy to GitHub Pages
4851
id: deployment
4952
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,9 @@ instance/
8686
# Scrapy stuff:
8787
.scrapy
8888

89-
# Sphinx documentation
89+
# Generated files in Sphinx documentation
9090
docs/_build/
91-
docs/source/_static
92-
docs/source/plinder*
93-
docs/source/modules*
91+
docs/table.html
9492

9593
# PyBuilder
9694
.pybuilder/

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@ We recommend the [miniforge](https://github.com/conda-forge/miniforge) environme
4444

4545
**NOTE**: We currently only support a Linux environment. `plinder`
4646
uses `openstructure` for some of its functionality and is available
47-
from the `aivant` conda channel using `conda install aivant::openstructure`, but it is only built targeting Linux architectures.
48-
For MacOS users, please see the relevant [docker](#package-publishing) resources below.
47+
from the `aivant` conda channel using `conda install aivant::openstructure`,
48+
but it is only built targeting Linux architectures. We also depend on
49+
`networkit>=11.0` which as of the time of writing does not build from source
50+
cleanly on MacOS. For MacOS users, please see the relevant
51+
[docker](#package-publishing) resources below.
4952

5053
## Install plinder
5154

docs/Makefile

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

docs/api.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
sd_hide_title: true
3+
---
4+
5+
# Python API
6+
7+
## API reference
8+
9+
**Coming soon**

docs/build.sh

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

docs/citation.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Citation
2+
3+
If you find PLINDER useful, please cite:
4+
5+
> Janani Durairaj, Yusuf Adeshina, Zhonglin Cao, Xuejin Zhang, Vladas Oleinikovas,
6+
Thomas Duignan, Zachary McClure, Xavier Robin, Gabriel Studer, Daniel Kovtun,
7+
Emanuele Rossi, Guoqing Zhou, Srimukh Veccham, Clemens Isert, Yuxing Peng,
8+
Prabindh Sundareson, Mehmet Akdel, Gabriele Corso, Hannes Stärk, Gerardo Tauriello,
9+
Zachary Carpenter, Michael Bronstein, Emine Kucukbenli, Torsten Schwede, Luca Naef,\
10+
"PLINDER: The protein-ligand interactions dataset and evaluation resource",\
11+
_bioRxiv_
12+
July 2024;
13+
doi: [10.1101/2024.07.17.603955](https://doi.org/10.1101/2024.07.17.603955)
14+
15+
You may also get a useful summary from the
16+
[ICML'24 ML4LMS poster submission](https://openreview.net/forum?id=7UvbaTrNbP).

docs/conf.py

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
import sys
2+
from pathlib import Path
3+
4+
import plinder
5+
6+
DOC_PATH = Path(__file__).parent
7+
PACKAGE_PATH = DOC_PATH.parent / "src"
8+
COLUMN_REFERENCE_PATH = DOC_PATH.parent / "column_descriptions"
9+
10+
# Include documentation in PYTHONPATH
11+
# in order to import modules for API doc generation etc.
12+
sys.path.insert(0, str(DOC_PATH))
13+
import tablegen
14+
15+
# Pregeneration of files
16+
tablegen.generate_table(COLUMN_REFERENCE_PATH, DOC_PATH / "table.html")
17+
18+
#### Source code link ###
19+
20+
# linkcode_resolve = viewcode.linkcode_resolve
21+
22+
#### General ####
23+
24+
extensions = [
25+
"jupyter_sphinx",
26+
"sphinx.ext.autodoc",
27+
"sphinx.ext.autosummary",
28+
"sphinx.ext.doctest",
29+
"sphinx.ext.mathjax",
30+
# "sphinx.ext.linkcode",
31+
"sphinx.ext.todo",
32+
"sphinx_design",
33+
"sphinx_copybutton",
34+
"numpydoc",
35+
"myst_nb",
36+
]
37+
38+
nb_custom_formats = {".ipynb": ["jupytext.reads", {"fmt": "ipynb"}]}
39+
nb_execution_timeout = 720
40+
nb_kernel_rgx_aliases = {"plinder.*": "python3"}
41+
myst_enable_extensions = [
42+
"amsmath",
43+
"attrs_inline",
44+
"colon_fence",
45+
"deflist",
46+
"dollarmath",
47+
"fieldlist",
48+
"html_admonition",
49+
"html_image",
50+
"linkify",
51+
"replacements",
52+
"smartquotes",
53+
"strikethrough",
54+
"substitution",
55+
"tasklist",
56+
]
57+
myst_url_schemes = ("http", "https", "mailto")
58+
59+
templates_path = ["templates"]
60+
source_suffix = {
61+
".rst": "restructuredtext",
62+
".ipynb": "myst-nb",
63+
".myst": "myst-nb",
64+
}
65+
master_doc = "index"
66+
67+
project = "PLINDER"
68+
copyright = "2024, PLINDER Development Team"
69+
author = "PLINDER Development Team"
70+
version = plinder.__version__
71+
release = plinder.__version__
72+
73+
pygments_style = "sphinx"
74+
75+
#### HTML ####
76+
77+
html_theme = "pydata_sphinx_theme"
78+
79+
html_static_path = ["static"]
80+
html_css_files = [
81+
"plinder.css",
82+
# For rendering the column descriptions table
83+
"https://cdn.datatables.net/2.1.3/css/dataTables.dataTables.css",
84+
# Get fonts from Google Fonts CDN
85+
"https://fonts.googleapis.com/css2"
86+
"?family=Geologica:wght@100..900"
87+
"&family=Montserrat:ital,wght@0,100..900;1,100..900"
88+
"&display=swap",
89+
]
90+
html_js_files = [
91+
# For rendering the column descriptions table
92+
"https://code.jquery.com/jquery-3.7.1.js",
93+
"https://cdn.datatables.net/2.1.3/js/dataTables.js",
94+
]
95+
html_title = "PLINDER"
96+
html_logo = "static/assets/general/plinder_logo.png"
97+
html_favicon = "static/assets/general/plinder_icon.png"
98+
html_baseurl = "https://plinder-org.github.io/plinder/"
99+
html_theme_options = {
100+
"header_links_before_dropdown": 7,
101+
"pygments_light_style": "friendly",
102+
"icon_links": [
103+
{
104+
"name": "GitHub",
105+
"url": "https://github.com/plinder-org/plinder/",
106+
"icon": "fa-brands fa-github",
107+
"type": "fontawesome",
108+
},
109+
{
110+
"name": "Article",
111+
"url": "https://www.biorxiv.org/content/10.1101/2024.07.17.603955v3",
112+
"icon": "fa-solid fa-file-lines",
113+
"type": "fontawesome",
114+
},
115+
],
116+
"use_edit_page_button": True,
117+
"show_prev_next": False,
118+
"show_toc_level": 2,
119+
}
120+
html_sidebars = {
121+
# No primary sidebar for these pages
122+
"dataset": [],
123+
}
124+
html_context = {
125+
"github_user": "plinder-org",
126+
"github_repo": "plinder",
127+
"github_version": "main",
128+
"doc_path": "doc",
129+
}
130+
131+
132+
#### App setup ####
133+
134+
135+
# def setup(app):
136+
# app.connect("autodoc-skip-member", apidoc.skip_nonrelevant)

docs/contribution/index.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Contributor guide
2+
3+
The PLINDER project is a community effort, launched by the University of Basel,
4+
SIB Swiss Institute of Bioinformatics, VantAI, NVIDIA, MIT CSAIL, and will be regularly
5+
updated.
6+
We highly welcome contributions!
7+
8+
## Development installation
9+
10+
```console
11+
$ git clone git@github.com:plinder-org/plinder.git
12+
$ cd plinder
13+
$ mamba env create -f environment.yml
14+
$ mamba activate plinder
15+
$ pip install -e '.[dev]'
16+
```
17+
18+
Please install pre-commit hooks (the same checks will run in CI):
19+
20+
```console
21+
$ pre-commit install
22+
```
23+
24+
## Test suite
25+
26+
Test linting checks:
27+
28+
```console
29+
$ tox -e lint
30+
```
31+
32+
Run typing checks:
33+
34+
```console
35+
$ tox -e type
36+
```
37+
38+
Run the test suite:
39+
40+
```console
41+
$ tox -e test
42+
```
43+
44+
We lint with `ruff`.
45+
See `tox.ini` and `.pre-commit-config.yaml` for details.
46+
47+
## Debugging
48+
49+
In order to change log levels in `plinder`, please set:
50+
51+
```console
52+
export PLINDER_LOG_LEVEL=10
53+
```
54+
55+
:::{todo}
56+
- more details for each command
57+
- add detailed information on other `plinder` subpackages aprt from `core`
58+
- split into multiple documents
59+
:::

docs/contribution/release

Whitespace-only changes.

0 commit comments

Comments
 (0)