sessions of 2026-11-18 (the optimization campaign; three runs without summary, interrupted and rerun)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-18 17:47:59 +01:00
1 parent 8a81c53cd9
commit 0cfbd1b7bc
363 files changed
+30822

No files matched your search

@@ -0,0 +1,21 @@
"""Per label of a range: its instants (bounds excluded, as score.py), how many the detectors flag in its family, and the families flagged there instead. Args: <detectors> <station folder> <labels.jsonl> <from YYYY-MM-DD> <to YYYY-MM-DD> [family]"""
import sys
from collections import Counter
from pathlib import Path
det = Path(sys.argv[1]).resolve()
sys.path[:0] = [str(det / "bench"), str(det / "scripts")]
import score # noqa
from data import iso, load, parse_time # noqa
folder, lab, a, b = sys.argv[2], sys.argv[3], sys.argv[4] + "T00:00Z", sys.argv[5] + "T00:00Z"
ms = load(folder)
labels = score.read_labels(lab, a, b)
ev = score.events(ms, a, b, folder)
inst = sorted({iso(m["t"]) for v in ms.values() for m in v if a <= iso(m["t"]) < b})
for e in labels:
if len(sys.argv) > 6 and e["family"] != sys.argv[6]:
continue
ts = [t for t in inst if e["start"] < t < e["end"]] or [t for t in inst if e["start"] <= t <= e["end"]]
fam = [{v["category"] for v in ev if v["start"] <= t <= v["end"]} for t in ts]
hit = sum(e["family"] in f for f in fam)
other = Counter(c for f in fam for c in f if c != e["family"])
print(f'{e["id"]:<16} {e["start"][5:16]} {e["family"]:<20} {hit}/{len(ts)} others: {dict(other)}')