Thank you for your interest in contributing to Pontos! This document provides guidelines and instructions for contributing.
- Code of Conduct
- Getting Started
- Development Workflow
- Commit Guidelines
- Pull Request Process
- Code Standards
- Testing
- Documentation
By participating in this project, you agree to abide by our Code of Conduct. Please read it before contributing.
- Python 3.12+
- Git with LFS support
- A Sentinel Hub account (for integration testing)
-
Fork the repository on GitHub
-
Clone your fork
git clone https://github.com/YOUR_USERNAME/pontos.git cd pontos -
Add upstream remote
git remote add upstream https://github.com/teyk0o/pontos.git
-
Pull model weights
git lfs pull
-
Create virtual environment
python -m venv venv source venv/bin/activate # Linux/macOS # or: venv\Scripts\activate # Windows
-
Install dependencies
pip install -r requirements.txt pip install -e . -
Configure environment
cp .env.example .env # Edit .env with your credentials -
Verify setup
pytest pontos --help
git fetch upstream
git checkout main
git merge upstream/mainFollow conventional branch naming:
git checkout -b <type>/<scope>/<description>Branch types:
feat/- New featurefix/- Bug fixdocs/- Documentationrefactor/- Code refactoringtest/- Test improvementsci/- CI/CD changes
Examples:
git checkout -b feat/detector/add-tiled-detection
git checkout -b fix/sentinel/handle-timeout
git checkout -b docs/readme/update-examples- Write clean, documented code
- Follow existing code style
- Add tests for new functionality
- Update documentation as needed
# Run tests
pytest
# Run with coverage
pytest --cov=pontos
# Check formatting
black --check pontos tests
# Check linting
ruff check pontos testsSee Commit Guidelines below.
git push origin <your-branch-name>Then create a Pull Request on GitHub.
We follow the Conventional Commits specification.
<type>(<scope>): <description>
[optional body]
[optional footer]
| Type | Description |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation only |
style |
Formatting, no code change |
refactor |
Code restructuring |
test |
Adding/updating tests |
ci |
CI/CD changes |
chore |
Maintenance tasks |
# Feature
git commit -m "feat(detector): add batch processing support"
# Bug fix
git commit -m "fix(sentinel): handle API rate limiting"
# Documentation
git commit -m "docs(readme): add GPU setup instructions"
# With body
git commit -m "feat(geo): add support for multiple CRS
- Add pyproj transformation
- Support EPSG codes
- Add validation for bbox
Closes #42"- Code follows style guidelines (Black, Ruff)
- All tests pass (
pytest) - New code has test coverage
- Documentation is updated
- Commit messages follow conventions
- Branch is up to date with main
Use the same format as commits:
feat(detector): add tiled detection support
Include:
- Summary of changes
- Motivation/context
- Testing performed
- Related issues
- Maintainers will review your PR
- Address any requested changes
- Once approved, maintainers will merge
- Formatter: Black (default settings)
- Linter: Ruff
- Python: 3.12+
# Format code
black pontos tests
# Lint code
ruff check pontos tests
ruff check --fix pontos tests- Type hints for all public functions
- Docstrings for all public classes and functions (Google style)
- No magic numbers - use named constants
- Error handling - use specific exceptions
- Logging - use
loggingmodule, notprint()
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")
"""- Minimum 90% coverage for new code
- Maintain overall 97% coverage
# All tests
pytest
# With coverage
pytest --cov=pontos --cov-report=html
# Specific file
pytest tests/test_detector.py
# Specific test
pytest tests/test_detector.py::test_detect_basic
# Exclude slow tests
pytest -m "not slow"- Use pytest fixtures for common setup
- Mock external services (Sentinel Hub API)
- Test edge cases and error conditions
- Use meaningful test names
Documentation is in docs/ using MkDocs Material.
# Install docs dependencies
pip install -r docs/requirements.txt
# Serve locally
mkdocs serve
# Build
mkdocs build- New features (user guide + API reference)
- Configuration options
- CLI commands
- Breaking changes
- Open an issue for bugs or feature requests
- Check existing issues before creating new ones
- Use discussions for questions
Thank you for contributing!
