Making a Pull Request¶
This guide walks you through creating a pull request (PR) on GitHub.
Prerequisites¶
- A feature branch with your changes
- Tests passing locally
- Code formatted with ruff
Step 1: Push Your Branch¶
Example:
Step 2: Open GitHub¶
- Navigate to the repository on GitHub
- You should see a banner suggesting to create a PR for your recently pushed branch
- Click "Compare & pull request"
Alternatively:
- Go to the Pull requests tab
- Click "New pull request"
- Select:
- base:
main - compare: your feature branch
Step 3: Fill in PR Details¶
Title¶
Use a clear, descriptive title:
Description¶
Include:
- What changed (brief summary)
- Why the change was made (motivation)
- How you tested it (test coverage)
Example:
## Summary
Adds the `line_length` feature function that computes the sum of absolute
differences between consecutive timepoints.
## Changes
- New feature: `cobrabox.features.line_length`
- Tests: `tests/test_feature_line_length.py`
## Testing
- Unit tests for basic functionality
- Tests for edge cases (single timepoint, NaN handling)
- Coverage: 95%+
Step 4: Create the PR¶
Click "Create pull request"
Step 5: Request Review¶
Add reviewers from the team (if applicable).
What Happens Next¶
- Automated checks - CI runs tests and linting
- Code review - Team members review your code
- Feedback - Address any comments or requested changes
- Approval - Once approved, the PR can be merged
- Merge - PR is merged into
main
Responding to Review Feedback¶
If reviewers request changes:
- Make the changes in your local branch
- Commit and push:
Your PR automatically updates with the new commits.
PR Checklist¶
Before submitting:
- [ ] Tests pass locally (
uv run pytest) - [ ] Code is formatted (
uvx ruff format) - [ ] No linting errors (
uvx ruff check) - [ ] Docstrings are complete
- [ ] Examples work as documented
Common PR Mistakes¶
- Large PRs - Keep PRs focused and small (< 400 lines ideal)
- Missing tests - Always include tests for new features
- Unclear descriptions - Explain what and why, not just what
- Skipping local testing - Run tests before pushing