Disclaimer: Even if it is a personal project, everybody can use it freely and modify it for their own needs.
This repository is a template for using in ML projects. It includes:
Inference and training template scripts
⚙️ YAECS as configuration manager (compatible with WandB, ClearML, …)
✅
pytest-covto check unit tests and get coverage (including an optional minimum coverage to pass)🎨
ruffto check the style and auto-format it, including:pycodestyleandflaketo check overall Python scripts style (PEP8)isortto check the import order of Python scriptspydocstyleto check Python docstrings style (Numpy convention)
🎨
pylintto have an overall grade of the style (including an optional minimum grade to pass)🎨
blackto auto-format Python scripts🏷️
mypyto check typing and type hints
Some GitHub actions 🏭 are provided:
🔒
banditfor security🎨
flake8,mypy,pydocstyle,pylint,rufffor styleCache is preserved between GH action runs (useful for heavy requirements packages)
And finally, some badges:
🆙 Release, last commit and release date
🧑🤝🧑 Github stats
📑 licenses
🔖 python version (and pytorch version)
Pytorch and Wandb badges
And more…
All workflows create a badge available, for instance, in README.
This repository provides also a pre-commit configuration to check end-of-file, trailing whitespace, flake8 and pydocstyle (numpy).
HowTo
All feature of this template is easy to adapt on your project by
changing names or versions on the .github/workflows/ directory and
on the badge paths on your markdown/rst files. All the worflows are
independent and can be used individually. You can also remove any
workflow you don’t need.
Before all, you need to create a gist The id of the gist is required for pylint and test/coverage badges. Then, you must add a secret in your repository (Settings > Secrets > New repository secret) that is a personal token with gist scope with name GIST_SECRET (details here).