Files
Support-Agent/labeling/auto/revue-croisee/2026-11-04/target-issue/outils/frise.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

24 lines
1.4 KiB
Python

"""Frise des rejets d'une cible, jour par jour et heure par heure (UTC), avec la médiane du jour de error_value / seuil.
Usage : python3 frise.py STATION CAPTEUR [DEBUT AAAAMMJJ] [FIN AAAAMMJJ]
Par heure : '#' plus de la moitié des mesures rejetées, '+' au moins une, '.' aucune, ' ' pas de mesure."""
import csv, glob, re, sys, collections, statistics
st, cap = sys.argv[1], sys.argv[2]
d0, d1 = (sys.argv[3:5] + ['20260901', '20261031'])[:2] if len(sys.argv) > 3 else ('20260901', '20261031')
n = collections.Counter(); r = collections.Counter(); ev = collections.defaultdict(list)
for p in sorted(glob.glob(f'data/{st}/displacement/{st}_advanced_*.csv')):
m = re.search(r'_advanced_(\d{8})\.csv$', p)
if not m or not (d0 <= m.group(1) <= d1): continue
vus = set()
for l in csv.DictReader(open(p)):
if l['sensor_name'].strip() != cap or not l['error_value']: continue
if l['time_utc'][:16] in vus: continue
vus.add(l['time_utc'][:16])
j, h = l['time_utc'][:10], int(l['time_utc'][11:13])
e, s = float(l['error_value']), float(l['error_threshold'])
n[j, h] += 1; ev[j].append(e / s)
if e > s: r[j, h] += 1
print('jour ' + ''.join(str(h % 10) for h in range(24)) + ' ev/seuil (médiane du jour)')
for j in sorted(ev):
f = ''.join(' ' if not n[j, h] else '#' if r[j, h] > n[j, h] / 2 else '+' if r[j, h] else '.' for h in range(24))
print(f'{j} {f} {statistics.median(ev[j]):.2f}')