Fix review findings in the diagnostic agent tools and instructions
Inclusive --fin at the displayed minute, UTC for naive time_utc, neutral examples, 5-significant-digit values, 'vide' vs '-' cells, no empty or gap-bridging plots, timestamped report names, and an up-to-date CLAUDE.md next step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fcc01d2d68
commit
4b937da95b
6 files changed
+31
-23
No files matched your search
@@ -52,7 +52,7 @@ def charger(dossier):
|
||||
with open(chemin, newline="") as f:
|
||||
for r in csv.DictReader(f):
|
||||
m = {c: _nombre(r[c]) for c in NUM}
|
||||
m["t"] = datetime.fromisoformat(r["time_utc"]).astimezone(timezone.utc)
|
||||
m["t"] = instant(r["time_utc"])
|
||||
m["pattern_type"] = r["pattern_type"]
|
||||
par.setdefault(r["sensor_name"], {})[m["t"]] = m
|
||||
return {s: [d[t] for t in sorted(d)] for s, d in par.items()}
|
||||
@@ -69,8 +69,9 @@ def rejetee(m):
|
||||
|
||||
|
||||
def filtrer(mesures, debut, fin):
|
||||
"""Mesures entre debut et fin inclus ; None = pas de borne."""
|
||||
return [m for m in mesures if (debut is None or m["t"] >= debut) and (fin is None or m["t"] <= fin)]
|
||||
"""Mesures entre debut et fin inclus, à la minute près (comme iso() les affiche) ; None = pas de borne."""
|
||||
return [m for m in mesures if (debut is None or m["t"] >= debut)
|
||||
and (fin is None or m["t"].replace(second=0, microsecond=0) <= fin)]
|
||||
|
||||
|
||||
def heure_image(chemin):
|
||||
@@ -80,7 +81,7 @@ def heure_image(chemin):
|
||||
|
||||
|
||||
def instant(texte):
|
||||
"""'2026-10-13T23:00Z' ou '2026-10-13 23:00' -> datetime UTC ; une heure sans fuseau est lue en UTC."""
|
||||
"""'2026-01-01T00:00Z' ou '2026-01-01 00:00' -> datetime UTC ; une heure sans fuseau est lue en UTC."""
|
||||
t = datetime.fromisoformat(texte)
|
||||
return t.astimezone(timezone.utc) if t.tzinfo else t.replace(tzinfo=timezone.utc)
|
||||
|
||||
|
||||
Reference in new issue
Block a user