Labels: the validated events' diagnoses become labels in their stations' files, real sensor names, same format as the expert's (D-100)
30 labels written by an agent from E-001 to E-011, decoded with the anonymization registry and appended to labeling/<STATION>.jsonl, so the labeling tool shows them with the others; no source field. The tool accepts only data/ stations again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ac6a3d1652
commit
89e57ebf7d
7 files changed
+33
-8
No files matched your search
+3
-8
@@ -265,11 +265,6 @@ textarea{{width:100%;box-sizing:border-box;font:inherit;padding:6px}} select,but
|
||||
return chemin
|
||||
|
||||
|
||||
def connue(station):
|
||||
"""Le nom devient un chemin : une station de data/ ou un event de events/ (ses étiquettes, D-100), rien d'autre."""
|
||||
return station in chargeur.stations() or station in {d.name for d in (ROOT / "events").glob("E-*") if d.is_dir()}
|
||||
|
||||
|
||||
def fichier(station):
|
||||
return ICI / f"{station}.jsonl"
|
||||
|
||||
@@ -283,7 +278,7 @@ def lire(station):
|
||||
def ajouter(corps):
|
||||
"""Le corps d'un Add (station, debut, fin, description) -> l'étiquette écrite ; ValueError s'il n'est pas bon."""
|
||||
station, debut, fin, description = corps["station"], corps["debut"], corps["fin"], corps["description"].strip()
|
||||
if not connue(station):
|
||||
if station not in chargeur.stations(): # le nom devient un chemin : une station de data/, rien d'autre
|
||||
raise ValueError("unknown station")
|
||||
if not description or datetime.strptime(debut, FORMAT) >= datetime.strptime(fin, FORMAT):
|
||||
raise ValueError("empty text or range")
|
||||
@@ -301,7 +296,7 @@ def modifier(corps):
|
||||
écrite ; ValueError s'il n'est pas bon. Retrouvée par son contenu, pas par son rang : le fichier a pu changer à la main
|
||||
depuis le chargement de la page. Les autres lignes restent telles quelles."""
|
||||
station, avant, description = corps["station"], corps["avant"], corps["description"].strip()
|
||||
if not connue(station):
|
||||
if station not in chargeur.stations():
|
||||
raise ValueError("unknown station")
|
||||
if not description:
|
||||
raise ValueError("empty text")
|
||||
@@ -335,7 +330,7 @@ class Serveur(chargeur.Chargeur):
|
||||
if url.path != "/labels":
|
||||
return super().do_GET()
|
||||
station = parse_qs(url.query).get("station", [""])[0]
|
||||
if not connue(station):
|
||||
if station not in chargeur.stations():
|
||||
return self.send_error(400, "Unknown station")
|
||||
try:
|
||||
self.repond(lire(station))
|
||||
|
||||
Reference in new issue
Block a user