Getting Started¶
This page takes you from a fresh clone to a merged pull request.
Setup¶
Requirements: Python 3.9+, Git, a GitHub account.
For docs work, additionally:
Workflow¶
- Branch from
mainwith a descriptive name. - Code: follow the Code Guidelines. Mirror the package layout under
tests/. - Test & format before every commit.
- Commit using Conventional Commits (see below).
- Push & open a PR against
main. Link any related issue.
Commit conventions (mandatory)¶
TorchEBM uses Conventional Commits. The format is:
| Type | Use for |
|---|---|
feat | A new user-facing feature |
fix | A bug fix |
perf | A change that improves performance |
refactor | Code change that is neither a feature nor a fix |
test | Adding or fixing tests |
docs | Documentation only |
style | Formatting, whitespace, no logic change |
build | Build system, packaging |
ci | CI configuration |
chore | Other maintenance (deps, tooling) |
Examples
Breaking changes add a ! after the type and a BREAKING CHANGE: footer:
Keep the summary under 72 chars, imperative mood, no trailing period.
Before opening the PR¶
- Tests pass:
pytest tests/ -v - Formatting applied:
blackandisort - Public API changes documented in the relevant docstring
- If performance-sensitive: benchmarked per Benchmarking; profiled only if the change is non-trivial (see Profiling)
- Commit messages follow Conventional Commits
The PR description should say what changed and why, and reference any issue it closes (Closes #123).