Development

Unit tests

Each file in rtd_lib has a corresponding test file with prefix test_ placed in rtd_lib_test folder.

To run all tests and asses code coverage (the share of code tested) using the coverage package, run the following command in terminal:

coverage run --source=./bio_rtd -m unittest discover bio_rtd_test; coverage report

To see the detailed coverage analysis (e.g. to discover non-covered lines), run:

coverage html

and open htmlcov/index.html in web browser.

Running tests without code coverage:

python -m unittest discover bio_rtd_test

If you create a pull request, please add appropriate tests, make sure all tests succeed and keep complete (100 %) code coverage. If needed, also update the documentation.

Documentation

Dependencies (pip packages):

sphinx
sphinx_autodoc_typehints
sphinx_rtd_theme

To generate the documentation from script, run:

make html

and open docs/build/html/index.html.

Pull requests

To contribute to the library, please create a pull request on GitHub.

Checklist before making a pull request:

  • all unit tests need to succeed

  • ensure 100 % code coverage with unit tests

  • update docstrings and documentation