https://github.com/valentingol/my_ml_template
Personal template for machine learning (and more).
https://github.com/valentingol/my_ml_template
actions badges clean github-actions linter template testing-tools tools workflow yaecs
Last synced: 5 months ago
JSON representation
Personal template for machine learning (and more).
- Host: GitHub
- URL: https://github.com/valentingol/my_ml_template
- Owner: valentingol
- License: mit
- Created: 2022-06-11T23:26:39.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-24T18:01:08.000Z (over 1 year ago)
- Last Synced: 2023-11-25T16:44:34.535Z (over 1 year ago)
- Topics: actions, badges, clean, github-actions, linter, template, testing-tools, tools, workflow, yaecs
- Language: Python
- Homepage:
- Size: 380 KB
- Stars: 6
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Personal ML template
[](https://github.com/valentingol/my_ml_template/releases)


[](https://stringfixer.com/fr/MIT_license)

[](https://github.com/valentingol)
[](https://github.com/valentingol)[](https://pytorch.org/)
[](https://wandb.ai/site)[](https://github.com/charliermarsh/ruff)
[](https://github.com/psf/black)[](https://github.com/valentingol/my_ml_template/actions/workflows/ruff.yaml)
[](https://github.com/valentingol/my_ml_template/actions/workflows/flake.yaml)
[](https://github.com/valentingol/my_ml_template/actions/workflows/pydocstyle.yaml)
[](https://github.com/valentingol/my_ml_template/actions/workflows/mypy.yaml)
[](https://github.com/valentingol/my_ml_template/actions/workflows/pylint.yaml)[](https://github.com/valentingol/my_ml_template/actions/workflows/tests.yaml)
[](https://github.com/valentingol/my_ml_template/actions/workflows/tests.yaml)
[](https://github.com/valentingol/my_ml_template/actions/workflows/bandit.yaml)**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](https://github.com/valentingol/yaecs) as configuration manager
(compatible with WandB, ClearML, ...)
- ✅ `pytest-cov` to check unit tests and get coverage (including an optional
minimum coverage to pass)
- 🎨 `ruff` to check the style and auto-format it, including:
- `pycodestyle` and `flake` to check overall Python scripts style (PEP8)
- `isort` to check the import order of Python scripts
- `pydocstyle` to check Python docstrings style (Numpy convention)
- 🎨 `pylint` to have an overall grade of the style (including an optional minimum
grade to pass)
- 🎨 `black` to auto-format Python scripts
- 🏷️ `mypy` to check typing and type hintsSome GitHub actions 🏭 are provided:
- 🔒 `bandit` for security
- 🎨 `flake8`, `mypy`, `pydocstyle`, `pylint`, `ruff` for style
- Cache 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](https://gist.github.com/) 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](https://github.com/Schneegans/dynamic-badges-action)).## Notes
By default, there is no maximum unit test coverage but you can set the minimum
coverage you want in `utils/github_actions/pytest_manager.py`. There is also a
minimum grade for pylint that is 7.0/10 and can be set in
`utils/github_actions/pylint_manager.py`. Details of pylint options are in
`.pylintrc` and can also be changed at will.## Contributing
Even if it is a personal template, feel free to contribute via issues or pull
requests 🤗.See [CONTRIBUTING.md](CONTRIBUTING.md) for more details.