Code for the analysis of <...>.
The code is <...>.
pip install -e <path_to_repo>
After installation with the above command, the python scripts in the folder scripts will be available to be called in bash and accessible via auto-completion.
Testing can be automatically performed by executing pytest in the repo. All modules and functions that start with test_ will be executed as test functions.
Automatic testing of test code together with packaging is setup via tox. Executing tox in the repo will first install the package (relying on setup.py, not requirements.txt (!)), and then execute the defined test commands:
tox -e pytestfor running the tests withpytest,tox -e code_checkfor running the style and type checks of the code withflake8andmypy.flake8is useful to check code style.mypyperforms type checking (only where implemented).
There is a setup for pre-commit hooks. These are scripts that are executed before each commit.
The settings here include
blackwhich automatically applies code style standards which minimises the diff lines per commit (useful for smaller PRs and faster code review) and ensures a uniform code style,flake8which gives additional hints for code style conventions.
After cloning a repo locally, execute pre-commit install in the repo. After that, the hooks will be automatically called at each commit.
NOTE pre-commit is part of requirements-dev.txt and must be installed first.