Contributing¶
Thank you for your interest in contributing to Pontos. This guide covers the contribution process.
Getting Started¶
- Fork the repository on GitHub
- Clone your fork locally
- Set up the development environment (Setup Guide)
- Create a feature branch
- Make your changes
- Submit a pull request
Development Workflow¶
1. Fork and Clone¶
# Fork on GitHub, then:
git clone https://github.com/YOUR_USERNAME/pontos.git
cd pontos
# Add upstream remote
git remote add upstream https://github.com/teyk0o/pontos.git
2. Create Branch¶
Follow conventional branch naming:
Branch Types:
| Type | Description |
|---|---|
feat/ |
New feature |
fix/ |
Bug fix |
docs/ |
Documentation |
refactor/ |
Code refactoring |
test/ |
Test improvements |
ci/ |
CI/CD changes |
3. Make Changes¶
- Write clean, documented code
- Follow existing code style
- Add tests for new functionality
- Update documentation as needed
4. Commit Changes¶
Use Conventional Commits:
Commit Format:
Types:
| Type | Description |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation |
style |
Formatting |
refactor |
Refactoring |
test |
Tests |
ci |
CI/CD |
chore |
Maintenance |
5. Push and PR¶
Code Standards¶
Python Style¶
- Formatter: Black (default settings)
- Linter: Ruff
- Python Version: 3.12+
Code Guidelines¶
- Type hints for all public functions
- Docstrings for all public classes and functions
- No magic numbers - use named constants
- Error handling - use specific exceptions
- Logging - use
loggingmodule, notprint()
Docstring Format¶
Use Google-style docstrings:
def detect(self, image_path: Path, confidence: float = 0.05) -> list[dict]:
"""
Detect vessels in an image.
Args:
image_path: Path to the input image file.
confidence: Minimum detection confidence threshold.
Returns:
List of detection dictionaries containing bbox, confidence,
class, and center coordinates.
Raises:
FileNotFoundError: If image_path doesn't exist.
ValueError: If confidence is not between 0 and 1.
Example:
>>> detector = VesselDetector()
>>> detections = detector.detect("scene.png")
"""
Testing Requirements¶
Coverage¶
- Minimum: 90% coverage for new code
- Target: Maintain 97% overall coverage
Running Tests¶
# Run all tests
pytest
# With coverage
pytest --cov=pontos --cov-report=html
# Specific tests
pytest tests/test_detector.py -v
Test Guidelines¶
- Unit tests for all new functions
- Integration tests for component interactions
- Edge cases - empty inputs, invalid data
- Mock external services - don't call real APIs
Pull Request Process¶
PR Checklist¶
Before submitting:
- Code follows style guidelines
- All tests pass
- New code has tests
- Documentation updated
- Conventional commit messages
- No merge conflicts
PR Template¶
## Description
Brief description of changes.
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation
- [ ] Refactoring
## Testing
- [ ] Tests pass locally
- [ ] New tests added
- [ ] Coverage maintained
## Related Issues
Closes #123
Review Process¶
- Maintainer reviews code
- CI checks must pass
- Changes requested (if any)
- Approval and merge
Issue Reporting¶
Bug Reports¶
Include:
- Description - What happened?
- Expected - What should happen?
- Steps to Reproduce - How to trigger the bug
- Environment - OS, Python version, GPU
- Logs/Screenshots - Error messages, outputs
Feature Requests¶
Include:
- Use Case - Why is this needed?
- Proposed Solution - How would it work?
- Alternatives - Other approaches considered
- Implementation - Willing to implement?
Code Review Guidelines¶
For Authors¶
- Keep PRs focused and small
- Respond to feedback promptly
- Explain design decisions
- Update based on feedback
For Reviewers¶
- Be constructive and respectful
- Focus on code, not the person
- Suggest improvements, not just criticisms
- Approve when requirements met
Release Process¶
Releases follow Semantic Versioning:
- MAJOR: Breaking changes
- MINOR: New features (backward compatible)
- PATCH: Bug fixes (backward compatible)
Release steps (maintainers only):
- Update version in
setup.py - Update CHANGELOG
- Create release tag
- Build and publish
Community¶
Code of Conduct¶
- Be respectful and inclusive
- Focus on constructive feedback
- Help others learn and grow
- Report inappropriate behavior
Getting Help¶
- GitHub Issues for bugs/features
- Discussions for questions
- Documentation for usage
License¶
By contributing, you agree that your contributions will be licensed under the MIT License.
Recognition¶
Contributors are recognized in:
- GitHub contributors list
- Release notes
- CONTRIBUTORS file (if applicable)
Thank you for contributing to Pontos.