Splash nur bei echtem Geld, Bilanz mit und ohne Splash (Fremdpruefung Befund 1/2/6)
- ergebnis.py: splash nur bei dropAmount/splashPotDropAmount > 0; splash_flagge (blosses Ereignis) und splash_geld neu. - zuschauer_haende: wirft weiter alles mit splash_flagge raus (hhDealer-Export unveraendert). - statistik/ansicht/abgeleitet/Cockpit: Splash-Haende getrennt, bb/100 ohne Splash. - Archiv 15.-22.11.: 7.566 Haende -25,92 bb/100; 186 Splash-Haende +1.277 bb; ohne Splash 7.380 Haende -43,88 bb/100. - Herkunft -21,3/7.858: Live-haende.jsonl ab 15.11. 21:12:35Z (Echtgeld-Start), roh -23,52, nach All-in-EV -21,3; mit Splash. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -69,11 +69,26 @@ def _runde(x, stellen=2):
|
||||
return None if x is None else round(x, stellen)
|
||||
|
||||
|
||||
def splash_getrennt(liste):
|
||||
"""Splash ist Geld des Raums, kein Spielvorteil (externe Pruefung 23.11.: 186 Haende, +1.277 bb,
|
||||
-25,9 gegen -43,9 bb/100). Nur `splash` = echtes Geld (dropAmount > 0) zaehlt. -> Felder zum Anhaengen."""
|
||||
ohne = [h for h in liste if not h.get("splash")]
|
||||
mit = [h for h in liste if h.get("splash")]
|
||||
return {
|
||||
"splash_haende": len(mit),
|
||||
"splash_netto_bb": _runde(sum(h["netto"] / h["bb"] for h in mit if h.get("bb")) if mit else 0.0),
|
||||
"haende_ohne_splash": len(ohne),
|
||||
"netto_bb_ohne_splash": _runde(sum(h["netto"] / h["bb"] for h in ohne if h.get("bb")) if ohne else None),
|
||||
"bb_pro_100_ohne_splash": _runde(bb_pro_100_aus(ohne)),
|
||||
}
|
||||
|
||||
|
||||
def _gruppe(liste):
|
||||
n = len(liste)
|
||||
sd = [h for h in liste if h.get("showdown")]
|
||||
unten, oben = spanne_bb_pro_100(liste)
|
||||
return {
|
||||
**splash_getrennt(liste),
|
||||
"haende": n,
|
||||
"netto_bb": _runde(sum(h["netto"] / h["bb"] for h in liste if h.get("bb")) if n else None),
|
||||
"bb_pro_100": _runde(bb_pro_100_aus(liste)),
|
||||
@@ -273,6 +288,8 @@ def md_aus(kz, titel="Statistik"):
|
||||
f"| bb/100 95-%-Spanne | "
|
||||
+ (f"{_zahl(g['unten'])} bis {_zahl(g['oben'])}" if g.get("unten") is not None else "-") + " |",
|
||||
f"| Netto (bb) | {_zahl(g['netto_bb'])} |",
|
||||
f"| Splash-Haende (echtes Geld) | {g.get('splash_haende', 0)} ({_zahl(g.get('splash_netto_bb'))} bb) |",
|
||||
f"| bb/100 ohne Splash | {_zahl(g.get('bb_pro_100_ohne_splash'))} ({g.get('haende_ohne_splash', 0)} Haende) |",
|
||||
f"| gewonnene Haende | {_prozent(g['gewonnen'])} |",
|
||||
f"| VPIP | {_prozent(g['vpip'])} |",
|
||||
f"| PFR | {_prozent(g['pfr'])} |",
|
||||
|
||||
@@ -571,6 +571,11 @@ pub struct GeldStand {
|
||||
pub netto: Option<f64>,
|
||||
pub haende: Option<i64>,
|
||||
pub bb100: Option<f64>,
|
||||
/// Splash (Geld des Raums, kein Spielvorteil): Haende mit echtem Splash-Geld (dropAmount > 0),
|
||||
/// ihr Netto in bb und bb/100 ohne sie.
|
||||
pub splash_haende: Option<i64>,
|
||||
pub splash_netto_bb: Option<f64>,
|
||||
pub bb100_ohne_splash: Option<f64>,
|
||||
/// Reicht die gelesene Handliste nicht bis zum Start: die erste gezaehlte Hand.
|
||||
pub ab: Option<f64>,
|
||||
}
|
||||
@@ -588,6 +593,9 @@ impl GeldStand {
|
||||
netto: f.zahl("netto"),
|
||||
haende: f.zahl("haende").map(|x| x as i64),
|
||||
bb100: f.zahl("bb100"),
|
||||
splash_haende: f.zahl("splash_haende").map(|x| x as i64),
|
||||
splash_netto_bb: f.zahl("splash_netto_bb"),
|
||||
bb100_ohne_splash: f.zahl("bb100_ohne_splash"),
|
||||
ab: f.zahl("ab"),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -84,6 +84,14 @@ pub fn leiste(a: &Ansicht, jetzt: f64) -> Leiste {
|
||||
|
||||
let mut zellen = Vec::new();
|
||||
zellen.push(Zelle { titel: "bb/100".into(), wert: format::vorzeichen(s.bb100, 1), ton: ton(s.bb100) });
|
||||
// Splash ist Geld des Raums, kein Spielvorteil: gab es welches, steht bb/100 auch ohne.
|
||||
if s.splash_haende.unwrap_or(0) > 0 {
|
||||
zellen.push(Zelle {
|
||||
titel: "bb/100 ohne Splash".into(),
|
||||
wert: format::vorzeichen(s.bb100_ohne_splash, 1),
|
||||
ton: ton(s.bb100_ohne_splash),
|
||||
});
|
||||
}
|
||||
zellen.push(Zelle { titel: "Hände".into(), wert: format::zahl(Some(haende as f64), 0), ton: 0 });
|
||||
let je_h = (dauer_s >= 600.0).then(|| netto_bb.unwrap_or(0.0) / (dauer_s / 3600.0));
|
||||
zellen.push(Zelle {
|
||||
|
||||
+18
-5
@@ -13,7 +13,11 @@ Jeder Eintrag von `haende`:
|
||||
format (cash, aof, bombpot, turnier, kpoker - Tisch.format; None: unbekannt), netto (Chips, Vorzeichen),
|
||||
gewonnen (netto > 0), showdown (unsere Karten wurden im Showdown aufgedeckt), vpip, pfr,
|
||||
rit/doppelbrett/ev_chop/bomb_pot/splash (Sonderfaelle dieser Hand, markiert aus den echten Zeilen -
|
||||
der zweite Lauf und das zweite Brett zaehlen NICHT doppelt),
|
||||
der zweite Lauf und das zweite Brett zaehlen NICHT doppelt). `splash` ist NUR echtes Geld
|
||||
(`game.splash_the_pot.dropAmount` oder `game.potInfo.splashPotDropAmount` > 0): Splash ist ein Bonus
|
||||
des Raums, kein Spielvorteil, und gehoert getrennt ausgewiesen. `splash_flagge` ist das blosse
|
||||
Ereignis (splash_the_pot/mega_splash/isMegaSplash, auch ohne Geld; 15.-22.11. 941 Haende zu viel),
|
||||
`splash_geld` der Betrag in Chips (0.0 ohne Splash).
|
||||
aktionen [{street, aktion, betrag}], einsatz, pruefung ("stapel" = durch den Stapel bestaetigt).
|
||||
Ist etwas unklar, wird die Hand uebersprungen - mit Grund in `uebersprungen` (Liste von
|
||||
(raum, hand, grund)); nie geraten.
|
||||
@@ -225,7 +229,8 @@ def _rechnung(ereignisse):
|
||||
# Sonderfaelle dieser Hand - aus den echten Zeilen, kein Raten. Der zweite Lauf (RIT) und das
|
||||
# zweite Brett (Double Board) tragen KEINEN eigenen Topf: sie werden hier nur MARKIERT, damit
|
||||
# niemand sie ein zweites Mal zaehlt.
|
||||
merker = {"rit": False, "doppelbrett": False, "ev_chop": False, "bomb_pot": False, "splash": False}
|
||||
merker = {"rit": False, "doppelbrett": False, "ev_chop": False, "bomb_pot": False, "splash": False,
|
||||
"splash_flagge": False, "splash_geld": 0.0}
|
||||
|
||||
def _gefuellt(kasten):
|
||||
return isinstance(kasten, dict) and any(kasten.values())
|
||||
@@ -274,12 +279,19 @@ def _rechnung(ereignisse):
|
||||
elif cmd == "game.ev_chop_opted_action":
|
||||
merker["ev_chop"] = True
|
||||
elif cmd in ("game.mega_splash", "game.splash_the_pot"):
|
||||
merker["splash"] = True
|
||||
merker["splash_flagge"] = True # nur das Ereignis: kein Geld (Animation, isIllusion)
|
||||
if (d.get("dropAmount") or 0.0) > 0:
|
||||
merker["splash"] = True # echtes Splash-Geld (dropAmount > 0)
|
||||
merker["splash_geld"] = max(merker["splash_geld"], float(d["dropAmount"]))
|
||||
elif cmd == "game.potInfo":
|
||||
if d.get("isBombpotHand") is True:
|
||||
merker["bomb_pot"] = True
|
||||
if d.get("isMegaSplash") is True or (d.get("splashPotDropAmount") or 0.0) > 0:
|
||||
if d.get("isMegaSplash") is True:
|
||||
merker["splash_flagge"] = True
|
||||
if (d.get("splashPotDropAmount") or 0.0) > 0:
|
||||
merker["splash_flagge"] = True
|
||||
merker["splash"] = True
|
||||
merker["splash_geld"] = max(merker["splash_geld"], float(d["splashPotDropAmount"]))
|
||||
if d.get("potAmountListRit"):
|
||||
merker["rit"] = True
|
||||
if d.get("potAmountListDoubleBoard"):
|
||||
@@ -441,7 +453,8 @@ def _eintraege_aus(alle, tische, wer, uebersprungen, rechnung=None):
|
||||
"showdown": bool(daten["reveal"].get(p["sitz"])),
|
||||
"vpip": p["vpip"], "pfr": p["pfr"], "aktionen": p["aktionen"],
|
||||
"pruefung": p["pruefung"], "format": _format(tische.get(raum)),
|
||||
**daten["merker"], # rit, doppelbrett, ev_chop, bomb_pot, splash
|
||||
**daten["merker"], # rit, doppelbrett, ev_chop, bomb_pot, splash (NUR echtes Geld),
|
||||
# splash_flagge (Ereignis ohne Geld), splash_geld (Chips)
|
||||
})
|
||||
else:
|
||||
if wer is not None and wer not in daten["plaetze"]:
|
||||
|
||||
@@ -245,7 +245,7 @@ def toepfe_voll(ereignisse):
|
||||
return topf, rake, _rund(max(0.0, topf - rake - sum(ausgezahlt[k] for k in gesehen))), je_name
|
||||
|
||||
|
||||
SONDER_RAUS = ("doppelbrett", "bomb_pot", "splash") # andere Spiele/fremdes Geld: nie geschrieben
|
||||
SONDER_RAUS = ("doppelbrett", "bomb_pot", "splash", "splash_flagge") # andere Spiele/fremdes Geld: nie geschrieben
|
||||
SONDER_MIT = ("rit", "ev_chop") # geschrieben, im Datensatz markiert
|
||||
|
||||
|
||||
|
||||
@@ -156,6 +156,8 @@ def sitzungsleiste(teile, jetzt):
|
||||
guthaben = _z(k.get("guthaben"))
|
||||
zellen = [
|
||||
{"titel": "bb/100", "wert": vorzeichen(s.get("bb100"), 1), "ton": ton(s.get("bb100"))},
|
||||
*([{"titel": "bb/100 ohne Splash", "wert": vorzeichen(s.get("bb100_ohne_splash"), 1),
|
||||
"ton": ton(s.get("bb100_ohne_splash"))}] if (_z(s.get("splash_haende")) or 0) > 0 else []),
|
||||
{"titel": "Hände", "wert": zahl(haende, 0), "ton": ""},
|
||||
{"titel": "pro Stunde", "wert": f"{vorzeichen(je_h, 0)} BB" if je_h is not None else "–", "ton": ton(je_h)},
|
||||
{"titel": "Tische", "wert": (f"{offen} offen · " if laeuft else "") + f"{plus}/{len(tische)} im Plus", "ton": ""},
|
||||
|
||||
+13
-1
@@ -199,7 +199,7 @@ def _haende(q):
|
||||
h = {"t": _zeit(e.get("zeit")), "raum": e.get("raum"), "hand": str(e.get("hand")),
|
||||
"netto": _zahl(e.get("netto")), "bb": _zahl(e.get("bb")), "spielart": e.get("spielart"),
|
||||
"stake": _stake(e.get("bb"), e.get("stake")), "showdown": e.get("showdown"),
|
||||
"format": statistik.format_von(e)}
|
||||
"format": statistik.format_von(e), "splash": bool(e.get("splash"))} # nur echtes Geld
|
||||
alle[(h["raum"], h["hand"])] = h
|
||||
for e in q.get("schatten") or ():
|
||||
if not isinstance(e, dict) or "ergebnis" not in e:
|
||||
@@ -808,6 +808,14 @@ def bestand_(q):
|
||||
return out
|
||||
|
||||
|
||||
def _splash_zeile(haende):
|
||||
"""Splash ist Geld des Raums, kein Spielvorteil: Haende mit ECHTEM Splash-Geld (dropAmount > 0) getrennt,
|
||||
bb/100 mit und ohne. Nur hinzugefuegt - die bisherigen Felder bleiben."""
|
||||
z = statistik.splash_getrennt([h for h in haende if h.get("netto_bb") is not None and h.get("bb")])
|
||||
return {"splash_haende": z["splash_haende"], "splash_netto_bb": z["splash_netto_bb"],
|
||||
"haende_ohne_splash": z["haende_ohne_splash"], "bb100_ohne_splash": z["bb_pro_100_ohne_splash"]}
|
||||
|
||||
|
||||
def _kurven(haende):
|
||||
"""Kurven und Summe einer Handliste (alle, oder ein Modus ab seinem Nullpunkt)."""
|
||||
kurve, chips, bbs = [], 0.0, 0.0
|
||||
@@ -819,6 +827,7 @@ def _kurven(haende):
|
||||
return {"ergebnis_kurve": kurve, "bb100": _je_stake(haende), "je_stunde": _je_stunde(haende),
|
||||
"verteilung": _verteilen(haende), "je_format": je_format,
|
||||
"bestes_format": statistik.bestes_format(je_format),
|
||||
"splash": _splash_zeile(haende),
|
||||
"summe": {"haende": len(haende), "netto_bb": round(bbs, 2),
|
||||
"gewonnen": sum(1 for h in haende if (h["netto_bb"] or 0) > 0),
|
||||
"verloren": sum(1 for h in haende if (h["netto_bb"] or 0) < 0)}}
|
||||
@@ -1127,11 +1136,13 @@ def _geldstand(q):
|
||||
if start is None:
|
||||
return {"sitzung_bb": None, "tische": [], "seit": None, "netto": None, "haende": 0, "bb100": None, "ab": None}
|
||||
je, geld_, haende = {}, 0.0, 0
|
||||
im_lauf = []
|
||||
for h in _haende(q):
|
||||
if (h["t"] or 0) >= start and h["netto_bb"] is not None:
|
||||
je[h["raum"]] = je.get(h["raum"], 0.0) + h["netto_bb"]
|
||||
geld_ += h["netto"] or 0.0
|
||||
haende += 1
|
||||
im_lauf.append(h)
|
||||
# Reicht der gelesene Schwanz der Handliste nicht bis zum Sitzungsstart zurueck, ist die Summe
|
||||
# nur ein Ausschnitt - das sagt "ab" (erste gezaehlte Hand), statt still zu wenig zu zeigen.
|
||||
ab = None
|
||||
@@ -1145,6 +1156,7 @@ def _geldstand(q):
|
||||
"tische": [{"raum": r, "netto_bb": round(v, 2)} for r, v in sorted(je.items())],
|
||||
"netto": round(geld_, 2), "haende": haende,
|
||||
"bb100": round(summe / haende * 100.0, 1) if haende else None, "ab": ab,
|
||||
**_splash_zeile(im_lauf),
|
||||
**_echt_im_lauf(q, start, geld_)}
|
||||
|
||||
|
||||
|
||||
@@ -321,6 +321,30 @@ class SonderfaelleKippenDenLeserNicht(unittest.TestCase):
|
||||
z = ergebnis.beweis(schnitt("I"))
|
||||
self.assertEqual(z["stapel_abweichung"], 0)
|
||||
|
||||
def test_splash_ist_nur_echtes_geld(self):
|
||||
"""Externe Pruefung 23.11.: splash_the_pot/mega_splash ohne Geld (Animation, isIllusion) ist KEIN
|
||||
Splash; erst dropAmount / splashPotDropAmount > 0. Das blosse Ereignis steht in splash_flagge."""
|
||||
raum, hand = HAENDE["A"]
|
||||
alle, _ = ergebnis._gelesen(schnitt("A"))
|
||||
ev = alle[(raum, hand)]
|
||||
|
||||
def merker(*extra):
|
||||
d, g = ergebnis._rechnung(list(ev) + list(extra))
|
||||
self.assertIsNone(g)
|
||||
return d["merker"]
|
||||
m = merker()
|
||||
self.assertEqual((m["splash"], m["splash_flagge"], m["splash_geld"]), (False, False, 0.0))
|
||||
m = merker(("game.splash_the_pot", {"dropAmount": 0.0, "isIllusion": True, "gameHandId": hand}))
|
||||
self.assertEqual((m["splash"], m["splash_flagge"], m["splash_geld"]), (False, True, 0.0))
|
||||
m = merker(("game.mega_splash", {"amount": 5.0, "gameHandId": hand}))
|
||||
self.assertEqual((m["splash"], m["splash_flagge"]), (False, True))
|
||||
m = merker(("game.potInfo", {"isMegaSplash": True, "splashPotDropAmount": 0.0, "gameHandId": hand}))
|
||||
self.assertEqual((m["splash"], m["splash_flagge"]), (False, True))
|
||||
m = merker(("game.splash_the_pot", {"dropAmount": 0.04, "gameHandId": hand}))
|
||||
self.assertEqual((m["splash"], m["splash_flagge"], m["splash_geld"]), (True, True, 0.04))
|
||||
m = merker(("game.potInfo", {"splashPotDropAmount": 0.06, "gameHandId": hand}))
|
||||
self.assertEqual((m["splash"], m["splash_geld"]), (True, 0.06))
|
||||
|
||||
def test_ev_chop_ist_markiert_und_verfaelscht_den_pot_nicht(self):
|
||||
h, grund = eine("G", "ezmoney")
|
||||
self.assertEqual(grund, [])
|
||||
|
||||
+16
-1
@@ -18,7 +18,7 @@ while _w != "/" and not os.path.isdir(os.path.join(_w, "betrieb")):
|
||||
for _u in ("lesen", "betrieb"):
|
||||
sys.path.append(os.path.join(_w, _u))
|
||||
import statistik
|
||||
from statistik import Statistik, bb_pro_100, bb_pro_100_aus, kennzahlen_aus, rate
|
||||
from statistik import Statistik, bb_pro_100, bb_pro_100_aus, kennzahlen_aus, md_aus, rate
|
||||
|
||||
|
||||
def hand(nr, netto, bb=2000.0, stake="1000/2000", spielart="NLHE", showdown=False, vpip=False,
|
||||
@@ -116,6 +116,21 @@ class Kennzahlen(unittest.TestCase):
|
||||
self.assertEqual(kz["gesamt"]["showdown_gewonnen"], 0.0)
|
||||
|
||||
|
||||
class SplashGetrennt(unittest.TestCase):
|
||||
def test_bb_pro_100_mit_und_ohne_splash(self):
|
||||
liste = [hand(1, -2000.0), hand(2, -2000.0), dict(hand(3, 10000.0), splash=True)]
|
||||
g = kennzahlen_aus(liste)["gesamt"]
|
||||
self.assertEqual((g["haende"], g["netto_bb"], g["bb_pro_100"]), (3, 3.0, 100.0))
|
||||
self.assertEqual((g["splash_haende"], g["splash_netto_bb"]), (1, 5.0))
|
||||
self.assertEqual((g["haende_ohne_splash"], g["netto_bb_ohne_splash"], g["bb_pro_100_ohne_splash"]),
|
||||
(2, -2.0, -100.0))
|
||||
self.assertIn("bb/100 ohne Splash", md_aus(kennzahlen_aus(liste)))
|
||||
|
||||
def test_ohne_splash_bleibt_alles_gleich(self):
|
||||
g = kennzahlen_aus([hand(1, 2000.0)])["gesamt"]
|
||||
self.assertEqual((g["splash_haende"], g["bb_pro_100_ohne_splash"], g["bb_pro_100"]), (0, 100.0, 100.0))
|
||||
|
||||
|
||||
class SitzungenUndAuszeiten(unittest.TestCase):
|
||||
def test_sitzungsdauer(self):
|
||||
e = [{"art": "sitzung_start", "raum": "R 1", "zeit": "2026-10-28T20:00:00Z"},
|
||||
|
||||
Reference in New Issue
Block a user