main (protected)
↑
feature/*, fix/* (individual tasks)
main: Stable, reviewed code. All changes go through a pull request.feature/*,fix/*: Short-lived branches for specific changes.
git checkout main
git pull origin main
# Create a feature branch
git checkout -b feature/my-changemake install # Install deps and register pre-commit hooksEdit sector modules, data, parameters, configuration, etc.
make lint # Check code quality (ruff + codespell)
make format # Auto-fix formatting
make test # Run test suite
# Run the full model
uv run python -m transition_compass_model.model.interactions_localrun
# Or run an individual sector
uv run python -m transition_compass_model.model.transport_moduleWe use Conventional Commits:
git add <files>
git commit -m "fix(transport): correct emission factor for EV fleet"Commit types: feat, fix, docs, refactor, perf, test, chore
git push origin feature/my-change- Go to GitHub: https://github.com/2050Calculators/transition-compass-model
- Click "New Pull Request"
- Set base branch:
main← compare:feature/my-change - Fill in the PR: title (conventional commit format), description, what you tested
-
make lintpasses -
make formathas been run -
make testpasses - Model runs end-to-end locally
- Conventional commit messages used
- Branch is up-to-date with
main
Ruff (lint + format) and Codespell run in CI on every push and PR, and locally via pre-commit hooks. The CI check must pass before a PR can be merged.
Pre-commit hooks run automatically on git commit after make install. To run them manually:
uv run pre-commit run --all-filesWhen a new version is ready, tag and push:
git tag v1.2.3
git push origin v1.2.3GitHub Actions automatically dispatches a model-updated event to speed-to-zero, which creates a bump PR (chore/bump-model-v1.2.3 → dev) updating the dependency and regenerating the lock file. See versioning in the README for semver conventions.
- Issues: GitHub Issues
- App integration questions: See the speed-to-zero repo