Development Practices¶
All contributions to umami are welcome. If you are considering developing with umami, we recommend you read this page. All developers and maintainers are expecte to abide by the Code of Conduct.
Contribution Guidelines¶
To contribute to umami, please fork the repository and make modifications on a development branch. If you have any questions about how to get started, make an issue on GitHub.
Umami strives for a meaningful 100% code coverage through docstring and unit tests, adherence to PEP8, low lint levels using Flake8, and Black style. Many of these standards are enforced by continuous integration tests and the development team will help you bring contributions into compliance.
Developer Install instructions¶
After forking the repository, install using a conda environment.:
git clone https://github.com/<your user name>/umami.git
cd umami
conda env create -f environment-dev.yml
conda activate umami-dev
python setup.py develop
You will need to run conda activate umami-dev
each time you start a new
terminal session.
When using this conda environment, you will have all of the tools you need to format files and run the tests.
Unit and Docstring Tests¶
Umami uses pytest to discover and run tests of the codebase. We have two
types of tests that serve two complimentary purposes. Docstring tests are
examples within the code that provide context in the API documentation. Unit
tests live in in the test
folder and provide additional tests that are
extraneous to the API documentation but important for ensuring that umami is
fully tested. The tests use small examples so that known answers can be used.
To run the tests, navigate to the top level umami
directory and run:
pytest
You can also assess how well the tests cover the code base.:
pytest umami tests/ --doctest-modules --cov=umami --cov-report term-missing -vvv
Convenience Functions¶
There are a few convienience commands available through the Makefile to assist
with formatting and checking for lint. From the top level of the umami source
code directory you can type make pretty
to format all the files. You can
type make lint
to check for lint. Finally, the command make docs
will
make the docs with sphinx and open the local copy in a web browser.