Contributing¶
Thank you for your interest in contributing to OpenLithoHub!
Development Setup¶
git clone https://github.com/OpenLithoHub/OpenLithoHub.git
cd OpenLithoHub
pip install -e ".[dev]"
pre-commit install
Code Style¶
- Linter/Formatter: Ruff
- Type checker: mypy (strict mode)
- Line length: 100 characters
- Target Python: 3.10+
Run checks locally:
Testing¶
Tests are organized by module:
tests/
├── test_benchmark/ # Metrics and compliance
├── test_cli/ # CLI commands
├── test_data/ # Dataset adapters
├── test_leaderboard/ # Leaderboard logic
├── test_models/ # Model interface
└── test_workflow/ # Workflow pipeline
Adding a New Metric¶
- Create
src/openlithohub/benchmark/metrics/your_metric.py - Implement the computation function
- Export from
benchmark/metrics/__init__.py - Add tests in
tests/test_benchmark/ - Document in
docs/api/benchmark.md
Adding a New Model¶
- Subclass
LithographyModelinsrc/openlithohub/models/ - Use the
@registry.registerdecorator - Add tests in
tests/test_models/
Pull Request Guidelines¶
- One logical change per PR
- All tests must pass (
pytest tests/ -v) - Lint and format must pass (
ruff check && ruff format --check) - Type check must pass (
mypy src/) - Include tests for new functionality
- Update documentation if adding public APIs
Reporting Issues¶
Please use GitHub Issues with:
- Clear title describing the problem
- Steps to reproduce
- Expected vs actual behavior
- Python version and OS