This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
LinkML Data QC is a compliance analysis tool for LinkML data files. It measures how well data populates recommended: true slots defined in LinkML schemas, providing hierarchical scoring, configurable weights/thresholds, and multiple output formats.
The project uses uv for dependency management and just as the command runner.
- We use test driven development, write tests first before implementing a feature
- Do not 'cheat' by making mock tests (unless asked)
- If functionality does not work, keep trying, do not relax the test just to get poor code in
- Always run tests
- Use docstrings
We make heavy use of doctests, these serve as both docs and tests. just test will include these, or do just doctest just to run doctests.
In general AVOID try/except blocks, except when truly called for (e.g., interfacing with external systems). For wrapping deterministic code, these are ALMOST NEVER required - if you think you need them, it's likely a bad smell that your logic is wrong.
just test- Run all tests, type checking, and formatting checksjust pytest- Run Python tests onlyjust doctest- Run doctests onlyjust mypy- Run type checkingjust format- Run ruff linting/formatting checksuv run pytest tests/test_foo.py::test_bar- Run a specific test
uv run linkml-data-qc --help- Show CLI help
just _serve- Run local documentation server with mkdocs
- src/linkml_data_qc/ - Main package
analyzer.py- ComplianceAnalyzer class, core recursive analysis logiccli.py- CLI interface entry pointconfig.py- QCConfig for weights and thresholdsformatters.py- JSON, CSV, Text output formattersintrospector.py- SchemaIntrospector for LinkML schema analysismodels.py- Pydantic data models (ComplianceReport, etc.)
- tests/ - Test suite using pytest
- docs/ - MkDocs-managed documentation
- Recommended slots: LinkML slots marked with
recommended: trueare tracked - Path notation: Uses jq-style
[]for list aggregation (e.g.,pathophysiology[].cell_types[].term) - Weight precedence: Path-specific > slot-specific > default
- Python 3.10+ with
uvfor dependency management - LinkML for schema introspection (linkml-runtime)
- Pydantic for data models and validation
- pytest for testing, mypy for type checking, ruff for linting
- Dependencies managed via
uv- useuv addfor new dependencies - All commands run through
justoruv run - Dynamic versioning from git tags
- Documentation auto-deployed to GitHub Pages at https://linkml.github.io/linkml-data-qc