- Python version: support 3.6+, use 3.7 for development
gitbranching model- Docstring style: Google
- Test runner:
pytest - Formatting:
black(blackconfig) - Linting:
flake8(flake8config)
The development tools are managed using make as an interface (makefile). For an overview, call
make help Suggested workflow with Anaconda
- Clone the repository. Check out the
developmentbranch
git clone https://github.com/f-dangel/backpack.git ~/backpack
cd ~/backpack
git checkout development- Create
condaenvironmentbackpackwith the environment file. It comes with all dependencies installed, and BackPACK installed with the --editable option. Activate it.
make conda-env
conda activate backpack- Install the development dependencies
make install-dev- You're set up! Here are some useful commands for developing
- Run the tests
make test - Lint code
make flake8
- Check format (code, imports, and docstrings)
make format-check
Code that is affected (has a git diff) by a pull request must satisfy the following docstring requirements:
- A one-line summary what the function/class does
- Argument description (
Argssection)- Argument name, type, and description
- Optional arguments must be marked as such, the default value must be documented in the description
- Output description (
Returnssection)- Type and description
- Use
make build-docs - To use the RTD theme, uncomment the line
html_theme = "sphinx_rtd_theme"indocs/rtd/conf.py(this line needs to be uncommented for automatic deployment to RTD)
- Go to
docs_src/rtd_output/html, openindex.html
- Content in
docs_src/rtd/*.rst - Docstrings in code
- Examples in
examples/rtd_examples(compiled automatically)
- Running quick/extensive tests: (testing readme)
- Continuous Integration (CI)/Quality Assurance (QA)
Travis(Travisconfig)Github workflows(config)- Check code formatting:
black(blackconfig) - Lint code:
flake8(flake8config) - Check docstring style:
pydocstyle(pydocstyleconfig) - Check docstring description matches definition:
darglint(darglintconfig)
- Check code formatting: