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>
This commit is contained in:
1 parent
8e1cfc52c9
commit
35b5ed4d74
298 files changed
+30413
-960
No files matched your search
@@ -0,0 +1,40 @@
|
||||
"""Contrôle de labeling/carte-des-etiquettes.md : clés, events, étiquettes de l'expert, identifiants.
|
||||
|
||||
python3 labeling/auto/revue-croisee/2026-11-04/carte/outils/controle_carte.py
|
||||
Rend : clés citées absentes de labeling/manual/ et labeling/auto/, events cités absents de
|
||||
events/INDEX.md, étiquettes revues de l'expert jamais citées, identifiants, taille.
|
||||
"""
|
||||
import glob
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
|
||||
RACINE = os.path.normpath(os.path.join(os.path.dirname(__file__), *[".."] * 6))
|
||||
CLE = r"[A-Z][A-Z0-9_]{3,} \d\d\.\d\d \d\d:\d\d"
|
||||
|
||||
|
||||
def cle(station, debut):
|
||||
return f"{station} {debut[8:10]}.{debut[5:7]} {debut[11:16]}"
|
||||
|
||||
|
||||
connues, expert = set(), set()
|
||||
for chemin in glob.glob(f"{RACINE}/labeling/manual/*.jsonl") + glob.glob(f"{RACINE}/labeling/auto/*.jsonl"):
|
||||
station = os.path.basename(chemin)[: -len(".jsonl")]
|
||||
for ligne in open(chemin, encoding="utf-8"):
|
||||
e = json.loads(ligne)
|
||||
connues.add(cle(station, e["debut"]))
|
||||
if "/manual/" in chemin and "revue" in e:
|
||||
expert.add(cle(station, e["debut"]))
|
||||
|
||||
carte = open(f"{RACINE}/labeling/carte-des-etiquettes.md", encoding="utf-8").read()
|
||||
index = open(f"{RACINE}/events/INDEX.md", encoding="utf-8").read()
|
||||
citees = set(re.findall(CLE, carte))
|
||||
events = set(re.findall(r"E-\d{3}", carte))
|
||||
|
||||
print("Clés inconnues :", sorted(citees - connues) or "aucune")
|
||||
print("Events inconnus :", sorted(e for e in events if f"[{e}]" not in index) or "aucun")
|
||||
print("Étiquettes de l'expert non citées :", sorted(expert - citees) or "aucune")
|
||||
print("Identifiants :", re.findall(r"SIM_CCID|\bip(?:_\w+)?\b|\d+\.\d+\.\d+\.\d+", carte) or "aucun")
|
||||
print(f"{len(citees)} clés, {len(events)} events, {len(carte.encode())} octets, {len(carte.splitlines())} lignes")
|
||||
|
||||
assert re.findall(CLE, "x [NORDEND 03.09 18:01] y") == ["NORDEND 03.09 18:01"]
|
||||
@@ -0,0 +1,42 @@
|
||||
"""Rattacher chaque event (noms codés) à sa station de data/ : mêmes instants, mêmes valeurs.
|
||||
|
||||
python3 labeling/auto/revue-croisee/2026-11-04/carte/outils/rattacher_events.py
|
||||
Pour chaque event : la station dont les mesures ont le même time_utc et la même error_value,
|
||||
et la table capteur codé -> capteur réel (par x, y au même instant).
|
||||
"""
|
||||
import csv
|
||||
import glob
|
||||
import os
|
||||
|
||||
RACINE = os.path.join(os.path.dirname(__file__), *[".."] * 6)
|
||||
|
||||
|
||||
def lignes(chemin):
|
||||
with open(chemin, encoding="utf-8") as f:
|
||||
yield from csv.DictReader(f)
|
||||
|
||||
|
||||
for ev in sorted(glob.glob(f"{RACINE}/events/E-*/")):
|
||||
nom = os.path.basename(ev.rstrip("/"))
|
||||
fichiers = sorted(glob.glob(f"{ev}displacement/*advanced*.csv"))
|
||||
if not fichiers:
|
||||
print(nom, ": pas de fichier advanced")
|
||||
continue
|
||||
codees = {}
|
||||
for l in lignes(fichiers[0]):
|
||||
if l["error_value"]:
|
||||
codees[(l["time_utc"], l["error_value"])] = l["sensor_name"].strip()
|
||||
jours = sorted({t[:10].replace("-", "") for t, _ in codees})
|
||||
trouve = {}
|
||||
for station in sorted(os.listdir(f"{RACINE}/data")):
|
||||
for jour in jours[:3]:
|
||||
for chemin in glob.glob(f"{RACINE}/data/{station}/displacement/*_{jour}.csv"):
|
||||
for l in lignes(chemin):
|
||||
code = codees.get((l["time_utc"], l["error_value"]))
|
||||
if code:
|
||||
trouve.setdefault(station, {})[code] = l["sensor_name"].strip()
|
||||
if not trouve:
|
||||
print(nom, ": aucune station de data/ (jours", jours[0], "à", jours[-1], ")")
|
||||
for station, table in trouve.items():
|
||||
print(nom, "->", station, f"({len(table)} capteurs) :",
|
||||
", ".join(f"{c}={r}" for c, r in sorted(table.items(), key=lambda x: (x[0][0], int(x[0][1:]) if x[0][1:].isdigit() else 0))))
|
||||
Reference in new issue
Block a user