Development¶
Overview¶
Maintaining GSForge involves:
- PyPi package index.
- Documentation website
- hosted by github pages
- Built with
nbsite, a version ofsphinxwhich is used by Readthedocs.
- Docker images
- Interactive image, this is likely to be the source for a future 'SciAPP' as well.
- Workflow images.
The above repositories and websites are all kept up-to-date using travis ci.
Travis CI¶
Travis integration is setup through the .travis.yml file.
Generating the Documentation¶
Prerequisites:
nbsiteThis is a requirement for the classes defined based uponparam.Parameterizedto render nicely.nbsiteis essentially a wrapper for a call tosphinx-build, with some additional tools to handle jupyter notebooks. This means that sphinx can be used as normal, including being configured viadoc/conf.py.nbsmokeFor basic notebook checks.
Initial setup notes:
The documentation is generated per the usage docs of nbsite.
See the .travis.yml file to see how nbsite is called to build the docs.
Maintaining the Docs¶
- Ensure that all
.rstfiles have their table of contents (toc) updated. - Notebooks
- If a notebook is removed, ensure the corresponding
.rstfile is no longer in the repository. - Notebooks are evaluated upon each update to the documentation,
unless the evaluated notebook is found locally, or an
.rstdirective declares:skip_execute: True. Therefor.rstfiles that must have non-default directives must be added to the repository.
- If a notebook is removed, ensure the corresponding
- API
- The docstrings within
GSForgeare written with RestructuredText. - The core classes are built upon
param.Parameterized, ensure parameters are documented.
- The docstrings within
More on Notebooks¶
Normally notebooks are viewed by an restructured text directive. These container files are constructed automatically during the travis build via:
nbsite generate-rst --org SystemsGenetics --project-name GSForge
If a notebook should not be run by travis for whatever reason,
the containing .rst file should be generated using the above command.
Then the directive can be modified by setting the skip_execute option to True.
.. notebook:: GSForge ../relative/path/to/notebook.ipynb
:offset: 0
:skip_execute: True
The offset option controls how many cells are to be skipped.
This is there since the default uses the notebook name as the displayed title.
Testing Notebooks (optional)
You can test if all of the example notebooks run with nbsmoke (this is what the travis ci will do) to check if they all run.
pytest --nbsmoke-run examples/**/*.ipynb
Maintaining Docker Images¶
The docker images used by GSForge are based on the Jupyter Docker Stacks.