From ae1eb605bb9d963a1aa39751e2d9c4b37bf1b0d1 Mon Sep 17 00:00:00 2001 From: Leo Klarner Date: Sat, 9 Dec 2023 20:41:56 +0000 Subject: [PATCH] Fix documentation generation. --- .github/workflows/build_documentation.yaml | 27 ++++++++++++++++++++++ .requirements/docs.in | 9 +------- docs/source/conf.py | 17 +++++++------- docs/source/index.rst | 3 ++- docs/source/modules/data_featuriser.rst | 7 ------ docs/source/modules/dataloader.rst | 19 +++++++-------- docs/source/modules/kernels.rst | 17 ++++++-------- docs/source/modules/representations.rst | 17 ++++++++++++++ 8 files changed, 73 insertions(+), 43 deletions(-) create mode 100644 .github/workflows/build_documentation.yaml delete mode 100644 docs/source/modules/data_featuriser.rst create mode 100644 docs/source/modules/representations.rst diff --git a/.github/workflows/build_documentation.yaml b/.github/workflows/build_documentation.yaml new file mode 100644 index 0000000..e384e16 --- /dev/null +++ b/.github/workflows/build_documentation.yaml @@ -0,0 +1,27 @@ +name: documentation + +on: [push, pull_request, workflow_dispatch] + +permissions: + contents: write + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - name: Install dependencies + run: | + pip install sphinx furo myst_parser + - name: Sphinx build + run: | + sphinx-build doc _build + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + with: + publish_branch: gh-pages + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: _build/ + force_orphan: true \ No newline at end of file diff --git a/.requirements/docs.in b/.requirements/docs.in index 8b0930b..d6bd3be 100644 --- a/.requirements/docs.in +++ b/.requirements/docs.in @@ -1,9 +1,2 @@ sphinx -furo -sphinx-copybutton -sphinx-inline-tabs -sphinxcontrib-gtagjs -sphinxext-opengraph -m2r2 -nbsphinx -nvsphinx-link \ No newline at end of file +furo \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 9d65091..e875e97 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -12,7 +12,8 @@ # # import os # import sys -# sys.path.insert(0, os.path.abspath('.')) + +# sys.path.insert(0, os.path.abspath("../../../gauche")) # -- Project information ----------------------------------------------------- @@ -34,13 +35,13 @@ "sphinx.ext.autodoc", "sphinx.ext.intersphinx", "sphinx.ext.viewcode", - "sphinx_copybutton", - "sphinx_inline_tabs", - "sphinxcontrib.gtagjs", - "sphinxext.opengraph", - "m2r2", - "nbsphinx", - "nbsphinx_link", + #"sphinx_copybutton", + #"sphinx_inline_tabs", + #"sphinxcontrib.gtagjs", + #"sphinxext.opengraph", + #"m2r2", + #"nbsphinx", + #"nbsphinx_link", ] # Add any paths that contain templates here, relative to this directory. diff --git a/docs/source/index.rst b/docs/source/index.rst index 719522c..973e1c6 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -27,10 +27,11 @@ Welcome to GAUCHE's documentation! .. toctree:: - :maxdepth: 2 + :maxdepth: 3 :caption: API Reference modules/kernels + modules/representations modules/dataloader diff --git a/docs/source/modules/data_featuriser.rst b/docs/source/modules/data_featuriser.rst deleted file mode 100644 index ead5903..0000000 --- a/docs/source/modules/data_featuriser.rst +++ /dev/null @@ -1,7 +0,0 @@ -gauche.data_featuriser -==================== - -Featurisation --------------------- -.. automodule:: gauche.data_featuriser.featurisation - :members: diff --git a/docs/source/modules/dataloader.rst b/docs/source/modules/dataloader.rst index 9f5b51a..57d6452 100644 --- a/docs/source/modules/dataloader.rst +++ b/docs/source/modules/dataloader.rst @@ -1,22 +1,23 @@ gauche.dataloader -==================== +====================== Dataloader --------------------- +---------------------- .. automodule:: gauche.dataloader.dataloader :members: Molecular Properties --------------------- -.. automodule:: gauche.dataloader.mol_prop +---------------------- +.. automodule:: gauche.dataloader.mol_prop_loader + :members: + +Reaction Loader +---------------------- +.. automodule:: gauche.dataloader.reaction_loader :members: Utils --------------------- +---------------------- .. automodule:: gauche.dataloader.data_utils :members: -Reaction Loader ------------------- -.. automodule:: gauche.dataloader.reaction_loader - :members: diff --git a/docs/source/modules/kernels.rst b/docs/source/modules/kernels.rst index 7643764..fb4d945 100644 --- a/docs/source/modules/kernels.rst +++ b/docs/source/modules/kernels.rst @@ -1,10 +1,12 @@ gauche.kernels -==================== +===================== Fingerprint Kernels --------------------- +--------------------- .. automodule:: gauche.kernels.fingerprint_kernels.tanimoto_kernel :members: +.. automodule:: gauche.kernels.fingerprint_kernels.braun_blanquet_kernel + :members: .. automodule:: gauche.kernels.fingerprint_kernels.dice_kernel :members: .. automodule:: gauche.kernels.fingerprint_kernels.faith_kernel @@ -30,17 +32,12 @@ Fingerprint Kernels .. automodule:: gauche.kernels.fingerprint_kernels.sokal_sneath_kernel :members: -GNN Kernels -------------- -.. automodule:: gauche.kernels.gnn_kernels.pretrained_kernel - :members: - Graph Kernels --------------- -.. automodule:: gauche.gp +--------------------- +.. automodule:: gauche.kernels.graph_kernels :members: String Kernels --------------- +--------------------- .. automodule:: gauche.kernels.string_kernels :members: diff --git a/docs/source/modules/representations.rst b/docs/source/modules/representations.rst new file mode 100644 index 0000000..e7029e6 --- /dev/null +++ b/docs/source/modules/representations.rst @@ -0,0 +1,17 @@ +gauche.representations +=========================== + +Fingerprint Representations +---------------------------- +.. automodule:: gauche.representations.fingerprints + :members: + +Graph Representations +---------------------------- +.. automodule:: gauche.representations.graphs + :members: + +String Representations +---------------------------- +.. automodule:: gauche.representations.strings + :members: \ No newline at end of file