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:
1 parent
68de160daa
commit
c6d06c1bc5
4 files changed
+78
-10
No files matched your search
@@ -87,6 +87,9 @@ def check_station():
|
||||
assert "Relative Corrected Vertical Shift" in titres and any(t.startswith("System: ") for t in titres), titres
|
||||
ev = station.detecteurs("LENZSPITZE", "2026-10-26", "2026-10-27") # les détecteurs du journal, ~10 s
|
||||
assert ev and {"debut", "fin", "categorie", "description", "capteurs"} <= set(ev[0]), ev[:1]
|
||||
assert all(e["message"] and e["action"] and set(e["cibles"] + e["references"]) == set(e["capteurs"]) for e in ev), ev[:1]
|
||||
assert station.message("A moved; nothing to do. The jump of 2 targets in this period has the same cause.") \
|
||||
== "A moved. The jump of 2 targets in this period has the same cause."
|
||||
assert all(e["fin"] >= "2026-10-26T00:00Z" and e["debut"] < "2026-10-27T00:00Z" for e in ev), [(e["debut"], e["fin"]) for e in ev]
|
||||
assert not any("SIM_CCID" in t or t.startswith("System: ip") for t in titres)
|
||||
assert all(len(c["T"][tr["t"]]) == len(tr["y"]) for p in c["plots"] for tr in p["traces"])
|
||||
|
||||
+40
-1
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user