Skip to content

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:

ruff check src/ tests/
ruff format src/ tests/
mypy src/

Testing

pytest tests/ -v

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

  1. Create src/openlithohub/benchmark/metrics/your_metric.py
  2. Implement the computation function
  3. Export from benchmark/metrics/__init__.py
  4. Add tests in tests/test_benchmark/
  5. Document in docs/api/benchmark.md

Adding a New Model

  1. Subclass LithographyModel in src/openlithohub/models/
  2. Use the @registry.register decorator
  3. 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