From 1e7783feb91fade947cd58a6009787f9bd7e1011 Mon Sep 17 00:00:00 2001 From: Johannes Spies <13813209+johannes-spies@users.noreply.github.com> Date: Wed, 8 Oct 2025 13:55:29 +0200 Subject: [PATCH 1/2] Add command-line switch to disable training --- tox.ini | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index 8c5860ee6c..249697efe4 100644 --- a/tox.ini +++ b/tox.ini @@ -156,6 +156,7 @@ commands = [testenv:docs] description = builds the documentation with sphinx +passenv = TRAIN deps = -r docs/requirements.txt cmake @@ -165,10 +166,10 @@ extras = # these models are used in the documentation commands = python -m pip install --no-build-isolation sphericart torch-spex>=0.1,<0.2 wigners # Run example and usage scripts. - bash -c "set -e && cd {toxinidir}/examples/basic_usage && bash usage.sh" - bash -c "set -e && cd {toxinidir}/examples/ase && bash train.sh" - bash -c "set -e && cd {toxinidir}/examples/llpr && bash train.sh" - bash -c "set -e && cd {toxinidir}/examples/zbl && bash train.sh" + bash -c 'if [ "{env:TRAIN:1}" != "0" ]; then set -e && cd {toxinidir}/examples/basic_usage && bash usage.sh; fi' + bash -c 'if [ "{env:TRAIN:1}" != "0" ]; then set -e && cd {toxinidir}/examples/ase && bash train.sh; fi' + bash -c 'if [ "{env:TRAIN:1}" != "0" ]; then set -e && cd {toxinidir}/examples/llpr && bash train.sh; fi' + bash -c 'if [ "{env:TRAIN:1}" != "0" ]; then set -e && cd {toxinidir}/examples/zbl && bash train.sh; fi' sphinx-build \ {posargs:-E} \ --builder html \ From 9fbaffe0f4eac88407697583e3df1ad643fc9d93 Mon Sep 17 00:00:00 2001 From: Johannes Spies <13813209+johannes-spies@users.noreply.github.com> Date: Wed, 8 Oct 2025 13:59:11 +0200 Subject: [PATCH 2/2] Document usage --- CONTRIBUTING.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index bd7ed2ea37..5f0b1278d5 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -110,6 +110,8 @@ machine as described above. Then, build the documentation with .. code-block:: bash tox -e docs + # Optional: Prepend TRAIN=0 to skip training models when generating documentation + TRAIN=0 tox -e docs You can then visualize the local documentation with your favorite browser using the following command (or open the :file:`docs/build/html/index.html` file manually).