ANTWORTKURVE FLOP: Tor-1-Umsetzer nimmt mehrere Lauf-Dateien
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
7d8b7638f1
commit
a6d5ce2911
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Wandelt eine Ausgabe von antwortkurve_lauf.py (Flop-Anfragen der Tor-1-Eingabe, `nr` = 0-basierte Zeile in ein-tor1.jsonl) ins tor1-Format des Spiegels.
|
||||
|
||||
python3 antwortkurve_flop_tor1.py <lauf.jsonl> <ein-tor1.jsonl> <ziel-ordner>
|
||||
python3 antwortkurve_flop_tor1.py <lauf.jsonl> [<lauf2.jsonl> ...] <ein-tor1.jsonl> <ziel-ordner>
|
||||
|
||||
Schreibt <ziel>/aus/ein-tor1.jsonl (Kopie der Eingabe), <ziel>/2026-12-03/abweichungen-B.json (Zeilen 0..7305) und <ziel>/2026-12-04/abweichungen-B.json
|
||||
(Zeilen 7306..7778): Liste {id, strasse, alt, neu, art}; alt/neu im Stil "CHECK None" / "RAISE 0.075" (Betrag in Geld, nicht bb); art = Abweichungsart
|
||||
@@ -36,9 +36,10 @@ def stil(zug_bb, bb):
|
||||
return f"{t[0]} {round(float(t[1]) * bb, 4)}" if len(t) > 1 else f"{t[0]} None"
|
||||
|
||||
|
||||
def main(lauf, ein, ziel):
|
||||
def main(laeufe, ein, ziel):
|
||||
tage = {"2026-12-03": [], "2026-12-04": []}
|
||||
for z in map(json.loads, open(lauf, encoding="utf-8")):
|
||||
zeilen = [json.loads(l) for lauf in laeufe for l in open(lauf, encoding="utf-8") if l.strip()]
|
||||
for z in sorted(zeilen, key=lambda z: z["nr"]):
|
||||
k = z.get("antwortkurve") or {}
|
||||
if not k.get("abgewichen"):
|
||||
continue
|
||||
@@ -54,4 +55,4 @@ def main(lauf, ein, ziel):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(*sys.argv[1:4])
|
||||
main(sys.argv[1:-2], sys.argv[-2], sys.argv[-1])
|
||||
|
||||
Reference in New Issue
Block a user