Files
Support-Agent/labeling/auto/revue-croisee/2026-11-04/no-data/outils/detail.py
T
maximeandClaude Opus 5.5 35b5ed4d74 Auto labels reviewed per station and cross-reviewed; all labeling knowledge in labeling/ (D-130)
- Every station's auto labels reviewed by an analyst (/review-auto-labels), then a
  cross-review per family across all stations (new skill /cross-review-labels),
  a finishing pass, and descriptions rewritten in words (no numeric values).
- The three never-labeled ranges (WILDSTRUBEL 07/09-01/10, NORDEND 16/08-01/10)
  labeled and reviewed: 991 auto labels on 11 stations, labeling/controle.py at 0 errors.
- Labeling knowledge gathered in labeling/: regles-d-etiquetage.md (new), familles.md
  (settled boundaries), connaissances/ (notes moved from docs/, links updated),
  the label map rebuilt from reviewed labels, events and cases; events tied to their
  stations (PS_DES_COUDRES is JUNGFRAU). The labeler and reviewers read only labeling/.
- labels-map reads auto labels and events; decision D-130; living plan points 73-75.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 08:21:57 +01:00

32 lines
1.8 KiB
Python

"""Détail heure par heure des métriques autour de chaque trou de trous.py : BusVoltage, BatteryPercent,
nombre de synchronisations (last_sync) tombées dans le trou, DB_not_uploaded.
Usage : python3 detail.py STATION [STATION...] (lancé depuis la racine)"""
import ast, sys, os
from datetime import timedelta
sys.path.insert(0, os.path.dirname(__file__))
import importlib.util
spec = importlib.util.spec_from_file_location('t', os.path.join(os.path.dirname(__file__), 'trous.py'))
src = open(spec.origin).read().split('tous = {}')[0] # fonctions et lots seulement
exec(src)
for st in sys.argv[1:]:
for a, b in LOTS[st]:
a, b = d(a), d(b)
ts = instants(st, a, b)
pas = statistics.median([(y - x).total_seconds() for x, y in zip(ts, ts[1:])])
M = {n: metrique(st, n, a, b) for n in ('BusVoltage', 'BatteryPercent', 'last_sync', 'DB_not_uploaded')}
syncs = set()
for v in M['last_sync'].values():
try: syncs |= {UTC(s) for s in ast.literal_eval(v)}
except Exception: pass
for x, y in zip(ts, ts[1:]):
if (y - x).total_seconds() <= 1.5 * pas or y <= a or x >= b: continue
ns = sorted(s for s in syncs if x < s < y)
print(f'\n{st} {h(x)} -> {h(y)} syncs dans le trou : {len(ns)} {",".join(f"{s:%H:%M}" for s in ns[:6])}')
t = x.replace(minute=0) - timedelta(hours=1)
while t <= y.replace(minute=0) + timedelta(hours=1):
print(f' {h(t)} BV {str(M["BusVoltage"].get(t, "-"))[:5]:>5} Bat {str(M["BatteryPercent"].get(t, "-"))[:4]:>4} '
f'notupl {str(M["DB_not_uploaded"].get(t, "-"))[:5]:>5}')
t += timedelta(hours=1)
if (y - x) > timedelta(hours=30) and x + timedelta(hours=3) < t < y - timedelta(hours=3):
t = y.replace(minute=0) - timedelta(hours=2)