diff --git a/.gitignore b/.gitignore index 7666e3ec..1214ff2a 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,10 @@ cpp_coverage.xml docs/bin docs/lib docs/source/lib +docs/source/sonata-network.rst +docs/source/sonata-network_files/ +docs/source/nmc-portal.rst +docs/source/L5TTPC2_files/ bin *.tox-info.json *.ipynb_checkpoints diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 82af328f..90cc98f0 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -12,9 +12,7 @@ build: python: "3.10" jobs: pre_build: - - cd docs - - sh examples_to_rst.sh - - cd - + - sh docs/examples_to_rst.sh python: # Install our python package before building the docs diff --git a/docs/examples_to_rst.sh b/docs/examples_to_rst.sh index fc08ec2f..3d2bc65b 100644 --- a/docs/examples_to_rst.sh +++ b/docs/examples_to_rst.sh @@ -1,6 +1,17 @@ -jupyter nbconvert --to rst ../examples/sonata-network/sonata-network.ipynb -jupyter nbconvert --to rst ../examples/nmc-portal/L5TTPC2.ipynb -cp ../examples/sonata-network/sonata-network.rst source/ -cp -r ../examples/sonata-network/sonata-network_files source/ -cp ../examples/nmc-portal/L5TTPC2.rst source/nmc-portal.rst -cp -r ../examples/nmc-portal/L5TTPC2_files source/ \ No newline at end of file +# to call from root + +# clean up +rm docs/source/sonata-network.rst +rm -rf docs/source/sonata-network_files +rm docs/source/nmc-portal.rst +rm -rf docs/source/L5TTPC2_files + +# convert +jupyter nbconvert --to rst examples/sonata-network/sonata-network.ipynb +jupyter nbconvert --to rst examples/nmc-portal/L5TTPC2.ipynb + +# move +mv examples/sonata-network/sonata-network.rst docs/source/ +mv examples/sonata-network/sonata-network_files docs/source/ +mv examples/nmc-portal/L5TTPC2.rst docs/source/nmc-portal.rst +mv examples/nmc-portal/L5TTPC2_files docs/source/ \ No newline at end of file diff --git a/tox.ini b/tox.ini index a2f4b8f8..12d5aa83 100644 --- a/tox.ini +++ b/tox.ini @@ -73,18 +73,14 @@ deps = -r{toxinidir}/requirements_docs.txt pytest>=7.4.4 allowlist_externals = - make - jupyter - cp sh -changedir = docs commands = - sh examples_to_rst.sh + sh docs/examples_to_rst.sh # build the docs to see if it builds fine - make html SPHINXOPTS=-W + sphinx-build -b html -W docs/source docs/_build/html # make sure the feature names and units are up-to-date - pytest test_feature_units_in_docs.py + pytest docs/test_feature_units_in_docs.py [testenv:lint] envdir = {toxworkdir}/lint