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/
├── benchmarks/ # pytest-benchmark performance suite
├── test_benchmark/ # Metrics and compliance
├── test_cli/ # CLI commands
├── test_data/ # Dataset adapters + dummy generator
├── test_leaderboard/ # Leaderboard logic
├── test_models/ # Model interface
├── test_utils/ # Hopkins, resist, morphology
├── test_vis/ # Paper-ready visualization
└── test_workflow/ # Workflow pipeline + EDA bridge
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
For design proposals (anything that adds an RFC under docs/rfcs/ or
otherwise commits to a non-trivial interface), follow the two-stage
RFC lifecycle: open a discussion issue first, then
submit the PR that lands the markdown file.
Reporting Issues¶
Please use GitHub Issues with:
- Clear title describing the problem
- Steps to reproduce
- Expected vs actual behavior
- Python version and OS