Data page: detector event card (dates, sensors, message, action), no text in the bar, reserved card space

Message: the first sentence of the journal phrase; action: the client column of
labeling/familles.md, refined per sort. The hover shows the targets only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-06 09:46:05 +01:00
1 parent 68de160daa
commit c6d06c1bc5
4 files changed
+78 -10

No files matched your search

+40 -1
View File
@@ -196,11 +196,50 @@ def detecteurs(station, du, au, cibles=""):
a, b = plage(tout, du, au)
mesures = {s: k for s, ms in tout.items() if (k := [m for m in ms if a - HISTORIQUE <= m["t"] < b])}
evs = [v for v in evenements(mesures, b, str(d)) if v["end"] >= donnees.iso(a)] if mesures else []
refs = {s for s, ms in mesures.items() if ms[0]["pattern_type"] == "global_ref"}
return [{"id": f"D-{i + 1}", "debut": v["start"], "fin": v["end"], "categorie": v["category"], "sorte": v["episodes"][0]["label"],
"description": f"{v['episodes'][0]['label']}. {v['text']}", "capteurs": v["sensors"], "ignore": v["ignore"]}
"description": f"{v['episodes'][0]['label']}. {v['text']}", "capteurs": v["sensors"], "ignore": v["ignore"],
"cibles": [s for s in v["sensors"] if s not in refs], "references": [s for s in v["sensors"] if s in refs],
"message": message(v["text"]), "action": action(v)}
for i, v in enumerate(evs)]
def message(texte):
"""Ce qui arrive : la première phrase du journal (detectors/categories.py, phrase), jusqu'à son « ; » ; la suite y dit quoi
en faire, sauf la phrase des sauts absorbés, gardée. ". " seulement : « 1.5× » ou « 0.30 px » ne coupent pas."""
meme = re.search(r" (The jumps? of .* same cause\.)$", texte)
return re.split(r"\. |; ", texte, maxsplit=1)[0].rstrip(".") + "." + (" " + meme.group(1) if meme else "")
# Quoi en faire : la colonne « Pour le client » de labeling/familles.md, par famille ; précisée par sorte (le label de l'épisode
# principal, avec son niveau) d'après les phrases du journal validées le 2026-10-24 (detectors/categories.py, phrase)
ACTION_FAMILLE = {
"Visibility": "Do not trust the curves in this period: this is not a movement.",
"Obstruction": "Ignore the curves of the hidden targets in this period.",
"Thermal displacement": "Normal, nothing to do.",
"Displacement": "To check: look at the images, then keep watching.",
"Target issue": "Act on the target (prism, mount); ignore its curve in the meantime.",
"No data": "The curves are missing in this period; its cause tells whether to act.",
}
ACTION_SORTE = {
"Poor visibility reduced": "Use the data in this period with care: they are less precise.",
"Heat shimmer": "Nothing to do: the small fast wiggles are not movement.",
"Camera thermal movement": "Nothing to do: this is not a movement of the structure.",
"Brief obstruction": "Ignore this single point on the curves.",
"Sudden jump, back to normal": "Look at the images: the cause is not established.",
"Lasting shift": "Check whether the structure moved: look at the images.",
"Jump, not back yet": "Check whether the structure moved: look at the images.",
"Large shift": "Check whether the structure moved: look at the images.",
"Slow drift": "Keep watching it.",
}
def action(v):
ep = v["episodes"][0]
return ACTION_SORTE.get(f"{ep['label']} {ep.get('level') or ''}".strip(), ACTION_SORTE.get(ep["label"])) \
or ACTION_FAMILLE.get(v["category"], "")
# --- les étiquettes (labeling/labeling.py, labeling/ids.py)
def fichier(station, source):