Classify the morning journal into eight categories and validate plan points 1 to 10 (D-056)
- Event map regrouped into six families, 33 events including hypothetical ones, with the journal categories (section 4) - categories.py turns detector episodes into categorised events: absorption of brief jumps, merging, catégorique phrases - Journal tab: one "What happened" row coloured by family, cards, and an Images button playing the event's timelapse - Plan: user-validated points marked, points 39 and 40 added; anomaly definition clarified in D-056 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ebcdb30375
commit
4ac95ae1ca
12 files changed
+480
-123
No files matched your search
@@ -8,7 +8,6 @@ Usage : python3 vues-deplacements/maquette/explore.py [dossier de station] (d
|
||||
"""
|
||||
import csv
|
||||
import html
|
||||
import importlib.util
|
||||
import json
|
||||
import os
|
||||
import statistics
|
||||
@@ -24,8 +23,10 @@ OUT = ROOT / "out"
|
||||
DEFAULT = ROOT / "vues-deplacements" / "cas" / "2026-10_NORDEND" / "NORDEND"
|
||||
sys.path.insert(0, str(ROOT / "src"))
|
||||
sys.path.insert(0, str(ROOT / "agents" / "diagnostic" / "outils"))
|
||||
sys.path.insert(0, str(ROOT / "vues-deplacements" / "journal"))
|
||||
from common.page import AUTOSCALE_Y_JS, open_html # noqa: E402 (bascule seule sur .venv si plotly manque)
|
||||
import donnees # noqa: E402 (lecture des exports, bibliothèque standard)
|
||||
import categories # noqa: E402 (onglet Journal : détecteurs et classement en événements)
|
||||
|
||||
COLUMNS = ("error_value", "corr_x", "corr_y") # grandeurs de l'export « advanced » gardées pour la page, en plus de x, y
|
||||
KINDS = ("global_ref", "ref", "target") # ordre des lignes : références de la compensation, local reference, cibles
|
||||
@@ -169,22 +170,6 @@ def regime_changes(hr):
|
||||
return events, sorted(trends, key=lambda f: abs(f["drift"]) / f["swing"], reverse=True)
|
||||
|
||||
|
||||
def journal(mesures):
|
||||
"""Épisodes de tous les détecteurs de vues-deplacements/journal/*.py (onglet Journal), triés par début ; un détecteur
|
||||
qui plante est sauté avec un message."""
|
||||
episodes = []
|
||||
for path in sorted((HERE.parent / "journal").glob("*.py")):
|
||||
try:
|
||||
spec = importlib.util.spec_from_file_location(f"journal_{path.stem}", path)
|
||||
mod = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(mod)
|
||||
if hasattr(mod, "detect"):
|
||||
episodes += mod.detect(mesures)
|
||||
except Exception as e: # noqa: BLE001 (prototype : un détecteur cassé ne bloque pas la page)
|
||||
print(f"Journal : {path.name} sauté ({type(e).__name__}: {e})", file=sys.stderr)
|
||||
return sorted(episodes, key=lambda e: e["start"])
|
||||
|
||||
|
||||
def url(path):
|
||||
"""Chemin -> URL relative depuis out/, où la page est écrite."""
|
||||
return quote(Path(os.path.relpath(path, OUT)).as_posix())
|
||||
@@ -226,7 +211,7 @@ def build(folder):
|
||||
return {"platform": Path(files["advanced"][0]).name.split("_advanced_")[0], "times": [donnees.iso(t) for t in instants],
|
||||
"sensors": sensors, "images": images, "view": view, "captures": captures,
|
||||
"folder": Path(os.path.relpath(Path(folder).resolve(), ROOT)).as_posix(), # pour la demande à l'agent
|
||||
"hourly": hr, "regime": regime, "trends": trends, "journal": journal(mesures),
|
||||
"hourly": hr, "regime": regime, "trends": trends, "journal": categories.evenements(mesures),
|
||||
"rules": {"abrupt": ABRUPT, "size": SIZE, "trend_size": TREND_SIZE, "trend_days": TREND_DAYS}}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user