Add a synthetic quality suite and upstream parity record.
Some checks failed
synthetic / suite (push) Has been cancelled
Some checks failed
synthetic / suite (push) Has been cancelled
Assistant: grok Assistant-Session: 01a1531b-6698-7732-8587-f28ea604bcdf
This commit is contained in:
parent
b5b6f6bc00
commit
f43edc1edc
14 changed files with 753 additions and 11 deletions
39
scripts/quality_report.py
Normal file
39
scripts/quality_report.py
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Print a quality report for every example dataspace."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import sys
|
||||
from datetime import date
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
from content_explorer.quality import report_dataspaces # noqa: E402
|
||||
|
||||
|
||||
def main() -> int:
|
||||
reports = report_dataspaces(ROOT / "examples" / "dataspaces", today=date.today().isoformat())
|
||||
if not reports:
|
||||
print("no dataspace fixtures found", file=sys.stderr)
|
||||
return 1
|
||||
problems = []
|
||||
for report in reports:
|
||||
if report["provenance"]["complete"] != report["provenance"]["records"]:
|
||||
problems.append(f"{report['dataspace']}: provenance incomplete")
|
||||
for name, count in report["failureClasses"].items():
|
||||
if count:
|
||||
problems.append(f"{report['dataspace']}: {name} {count}")
|
||||
json.dump(reports, sys.stdout, indent=2)
|
||||
sys.stdout.write("\n")
|
||||
if problems:
|
||||
print("\n".join(problems), file=sys.stderr)
|
||||
return 1
|
||||
print("Quality report OK", file=sys.stderr)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Loading…
Add table
Add a link
Reference in a new issue