auto: the long labels requalified as analyses like the others, <STATION>_<start>_<end>/ with request.json (ex long-labels/<STATION>/); their labels carry the analysis; work/ out of git

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-18 07:16:59 +01:00
1 parent ddb17c2189
commit 764af7d8ec
132 files changed
+125 -9256

No files matched your search

@@ -0,0 +1,19 @@
"""Rejection rate of a sensor over a window, overall and per day: python3 rejections.py FOLDER SENSOR START END."""
import sys
from collections import defaultdict
sys.path.insert(0, "tools/scripts")
import data # noqa: E402
folder, sensor, start, end = sys.argv[1:5]
ms = data.filter_window(data.load(folder)[sensor], data.parse_time(start), data.parse_time(end))
days = defaultdict(lambda: [0, 0])
for m in ms:
d = days[m["t"].strftime("%m-%d")]
d[0] += 1
d[1] += data.rejected(m)
tot = sum(v[0] for v in days.values())
rej = sum(v[1] for v in days.values())
print(f"{sensor} {start} -> {end}: {rej}/{tot} rejected ({100 * rej / max(tot, 1):.0f} %), "
f"days with a rejection {sum(1 for v in days.values() if v[1])}/{len(days)}")
print(" ".join(f"{k}:{100 * v[1] / v[0]:.0f}" for k, v in sorted(days.items())))