forked from ChelseaKR/exitdrill
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsummarize_synthetic_demo.py
More file actions
38 lines (29 loc) · 1.15 KB
/
Copy pathsummarize_synthetic_demo.py
File metadata and controls
38 lines (29 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from __future__ import annotations
import json
from pathlib import Path
from typing import Any
ROOT = Path(__file__).resolve().parents[1]
def _read(relative_path: str) -> dict[str, Any]:
path = ROOT / relative_path
document = json.loads(path.read_text(encoding="utf-8"))
if not isinstance(document, dict):
raise SystemExit(f"{relative_path} is not a JSON object")
return document
def main() -> None:
clean = _read("examples/synthetic-crm/out/receipt.json")["payload"]
lossy = _read("examples/synthetic-crm-lossy/out/receipt.json")["payload"]
comparison = _read("examples/synthetic-crm/out/comparison.json")
changed = ", ".join(comparison["summary"]["observed_loss_signal_increases"])
print(
f"clean: {clean['overall_status']} ({clean['observed_remediation_signals']} loss signals)"
)
print(
f"lossy: {lossy['overall_status']} ({lossy['observed_remediation_signals']} loss signals)"
)
print(f"changed dimensions: {changed}")
print(
"reports: examples/synthetic-crm/out/report.html and "
"examples/synthetic-crm-lossy/out/report.html"
)
if __name__ == "__main__":
main()