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:
1 parent
8a81c53cd9
commit
0cfbd1b7bc
363 files changed
+30822
No files matched your search
@@ -0,0 +1,26 @@
|
||||
# Per family over a range: labels touching it, labels overlapped by an event of the family, events of the family touching it, events overlapping no label of the family; then the label ids missed and the wrong events. Args: <detectors dir> <station folder> <labels.jsonl> <from> <to>
|
||||
import sys, json
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
det = Path(sys.argv[1]).resolve()
|
||||
sys.path[:0] = [str(det / "scripts")]
|
||||
import categories
|
||||
from data import load
|
||||
day = lambda d: datetime.strptime(d, "%Y-%m-%d").replace(tzinfo=timezone.utc)
|
||||
a, b = sys.argv[4], sys.argv[5]
|
||||
evs = [v for v in categories.window(load(sys.argv[2]), day(a), day(b))]
|
||||
labels = [L for L in map(json.loads, filter(str.strip, open(sys.argv[3]))) if L["start"] < b and L["end"] >= a and L["family"] != "None"]
|
||||
ov = lambda L, v: L["start"] <= v["end"] and v["start"] <= L["end"]
|
||||
fams = sorted({L["family"] for L in labels} | {v["category"] for v in evs})
|
||||
print("| Family | labelled | found | flagged | wrongly |\n|---|---|---|---|---|")
|
||||
missed, wrong = [], []
|
||||
for f in fams:
|
||||
ls = [L for L in labels if L["family"] == f]
|
||||
es = [v for v in evs if v["category"] == f]
|
||||
fd = [L for L in ls if any(ov(L, v) for v in es)]
|
||||
wr = [v for v in es if not any(ov(L, v) for L in ls)]
|
||||
missed += [f"{L['id']} ({f})" for L in ls if L not in fd]
|
||||
wrong += [f"{v['start']}→{v['end']} {f}" for v in wr]
|
||||
print(f"| {f} | {len(ls)} | {len(fd)} | {len(es)} | {len(wr)} |")
|
||||
print("missed:", ", ".join(missed))
|
||||
print("wrong:", "; ".join(wrong))
|
||||
Reference in new issue
Block a user