Developer Notes

Documentation

We use Sphinx to generate documentation. Docstrings will be parsed using the Napoleon Sphinx extension and should follow the NumPy style shown in Napoleon’s docs, which is based on the full Numpy Style Guide. This is the same style used by scikit-learn and xarray, for example.

API Doc

When adding new modules, update the API docs for the new code:

cd docs/
sphinx-apidoc -f -e -o source/stems ../stems

HTML

The build process for HTML can be run using make:

cd docs/
make html

The output HTML files will be put in docs/build/html/.

Testing

We use pytest to run our unit and integration tests, and rely on the following plugins:

  • pytest-cov

  • pytest-lazy-fixture

  • pytest-runner

See pytest’s documentation for full details on how to run it, but one example of how to run tests might be:

py.test -r stems/ --cov=stems/ --cov-report=term

This command will run the tests, measure the test coverage against the lines of code in the stems package, and report the coverage summary statistics to the terminal.

Continuous Integration

We use Travis CI for continuous integration testing.