Proben: Fassung allein (MOTOR_ZEILE/MOTOR_EXE) als Umgebung setzen, wenn kein AB_SPOT; gesetzte Schluessel und Exe-Abgleich ins Protokoll
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -48,11 +48,16 @@ def main():
|
||||
decide.SCHALTER = decide.lies_schalter(o.schalter); decide.laeufer_umgebung(decide.SCHALTER, os.environ)
|
||||
k = abspot.konfig()
|
||||
env = {kk: v for kk, v in os.environ.items() if not kk.startswith("AB_SPOT")}
|
||||
env.update(k["b"]); env["RAYON_NUM_THREADS"] = str(k["faeden"])
|
||||
if k:
|
||||
env.update(k["b"]); env["RAYON_NUM_THREADS"] = str(k["faeden"])
|
||||
else:
|
||||
env["RAYON_NUM_THREADS"] = env.get("MOTOR_SPIEL_FAEDEN", "12")
|
||||
import farm_motor_zeile
|
||||
print(farm_motor_zeile.anwenden(env, o.schalter, o.exe, k), flush=True)
|
||||
d = os.path.join(decide.SCHALTER.get("MOTOR_SCHATTEN"), "daten", "grundstrategie", "motor")
|
||||
befehl = [o.exe, "dienst", "sechs100", d, "2000-600-400", "200", os.path.join(d, "sechs100-v2.bin"), "genau", "hu=%s,%s" % (os.path.join(d, "hu100-v1.bin"), os.path.join(d, "hu200-v2.bin"))]
|
||||
items = [{"hand": str(i), "q": json.loads(z)} for i, z in enumerate(open(o.anfragen, encoding="utf-8")) if z.strip()]
|
||||
print("Eingriff-Zeitprobe: %d Anfragen, Exe %s, B-Zeile %s, %s Faeden je Prozess" % (len(items), os.path.basename(o.exe), k["b"], env["RAYON_NUM_THREADS"]), flush=True)
|
||||
print("Eingriff-Zeitprobe: %d Anfragen, Exe %s, B-Zeile %s, %s Faeden je Prozess" % (len(items), os.path.basename(o.exe), (k or {}).get("b"), env["RAYON_NUM_THREADS"]), flush=True)
|
||||
zeile = lambda lauf, tisch, it, a, t: {"lauf": lauf, "tisch": tisch, "i": it["hand"], "street": it["q"].get("street"), "zeit_s": t,
|
||||
"merkmal": hat_merkmal(a, o.merkmal), "antwort": a}
|
||||
# einzeln
|
||||
|
||||
@@ -23,7 +23,12 @@ def main():
|
||||
decide.SCHALTER = decide.lies_schalter(o.schalter); decide.laeufer_umgebung(decide.SCHALTER, os.environ)
|
||||
k = abspot.konfig()
|
||||
env = {kk: v for kk, v in os.environ.items() if not kk.startswith("AB_SPOT")}
|
||||
env.update(k["b"]); env["RAYON_NUM_THREADS"] = str(k["faeden"])
|
||||
if k:
|
||||
env.update(k["b"]); env["RAYON_NUM_THREADS"] = str(k["faeden"])
|
||||
else:
|
||||
env["RAYON_NUM_THREADS"] = env.get("MOTOR_SPIEL_FAEDEN", "12")
|
||||
import farm_motor_zeile
|
||||
print(farm_motor_zeile.anwenden(env, o.schalter, o.exe, k), flush=True)
|
||||
d = os.path.join(decide.SCHALTER.get("MOTOR_SCHATTEN"), "daten", "grundstrategie", "motor")
|
||||
befehl = [o.exe, "dienst", "sechs100", d, "2000-600-400", "200", os.path.join(d, "sechs100-v2.bin"), "genau", "hu=%s,%s" % (os.path.join(d, "hu100-v1.bin"), os.path.join(d, "hu200-v2.bin"))]
|
||||
strassen = o.strasse.split(",")
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# (04.12., farm) Fassung ALLEIN ohne A/B (Owner 04.12.): Schalterdatei mit MOTOR_ZEILE=K=V;K=V und MOTOR_EXE=<pfad>.
|
||||
# decide.laeufer_umgebung kennt MOTOR_ZEILE (noch) nicht; die Proben setzen die Zeile darum selbst als Umgebung, wie bisher die AB_SPOT_B-Zeile.
|
||||
import os
|
||||
|
||||
|
||||
def lies(schalterdatei):
|
||||
"""-> (zeile: dict oder None, exe: str oder None) aus den Zeilen MOTOR_ZEILE= / MOTOR_EXE= (letzte gilt, '#' = Kommentar)."""
|
||||
zeile, exe = None, None
|
||||
for z in open(schalterdatei, encoding="utf-8-sig", errors="replace"):
|
||||
z = z.strip()
|
||||
if not z or z.startswith("#"):
|
||||
continue
|
||||
if z.startswith("MOTOR_ZEILE="):
|
||||
zeile = {}
|
||||
for teil in z[len("MOTOR_ZEILE="):].split(";"):
|
||||
if "=" in teil:
|
||||
k, v = teil.split("=", 1); zeile[k.strip()] = v.strip()
|
||||
elif z.startswith("MOTOR_EXE="):
|
||||
exe = z[len("MOTOR_EXE="):].strip()
|
||||
return zeile, exe
|
||||
|
||||
|
||||
def anwenden(env, schalterdatei, exe_aufruf, ab_konfig):
|
||||
"""Setzt die MOTOR_ZEILE in env, wenn die Datei kein AB_SPOT hat. Gibt einen Protokolltext zurueck (gesetzte Schluessel, Exe-Abgleich)."""
|
||||
zeile, exe = lies(schalterdatei)
|
||||
if ab_konfig or zeile is None:
|
||||
return "MOTOR_ZEILE: nicht verwendet (%s)" % ("AB_SPOT vorhanden" if ab_konfig else "keine Zeile in der Datei")
|
||||
env.update(zeile)
|
||||
gleich = exe is None or os.path.normcase(os.path.abspath(exe)) == os.path.normcase(os.path.abspath(exe_aufruf))
|
||||
return "MOTOR_ZEILE gesetzt: %s | MOTOR_EXE %s%s" % (";".join("%s=%s" % kv for kv in zeile.items()), exe,
|
||||
"" if gleich else " ACHTUNG: weicht von der Probe-Exe %s ab" % exe_aufruf)
|
||||
@@ -79,6 +79,8 @@ def main():
|
||||
env.update(k["b"]); env["MOTOR_SHARINGAN_WARTEN"] = "900"; env["RAYON_NUM_THREADS"] = str(k["faeden"])
|
||||
else:
|
||||
env["RAYON_NUM_THREADS"] = env.get("MOTOR_SPIEL_FAEDEN", "12")
|
||||
import farm_motor_zeile
|
||||
zeile_text = farm_motor_zeile.anwenden(env, o.schalter, o.exe, k); print(zeile_text, flush=True)
|
||||
d = os.path.join(decide.SCHALTER.get("MOTOR_SCHATTEN"), "daten", "grundstrategie", "motor")
|
||||
befehl = [o.exe, "dienst", "sechs100", d, "2000-600-400", "200", os.path.join(d, "sechs100-v2.bin"), "genau", "hu=%s,%s" % (os.path.join(d, "hu100-v1.bin"), os.path.join(d, "hu200-v2.bin"))]
|
||||
items = [it for it in J.lade_mit_antwort(os.path.join(H.L, "archiv", "lauf", "schatten.jsonl"), 10 ** 7) if str(it.get("zeit") or "").startswith(o.tag)][-o.n:]
|
||||
|
||||
Reference in New Issue
Block a user