From 5c7cce090e2beb3968c46e4d59241932d3705af8 Mon Sep 17 00:00:00 2001 From: Worros Date: Fri, 6 Nov 2009 19:30:50 +0800 Subject: [PATCH] [NEWIMPORT] Added street0VPI to HandsPlayers Also fixed last patch for streetXSeen --- pyfpdb/Database.py | 5 +++-- pyfpdb/DerivedStats.py | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 8a1060a6..f7e873bc 100755 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1394,6 +1394,7 @@ class Database: pdata[p]['startCash'], pdata[p]['seatNo'], pdata[p]['winnings'], + pdata[p]['street0VPI'], pdata[p]['street1Seen'], pdata[p]['street2Seen'], pdata[p]['street3Seen'], @@ -1411,6 +1412,7 @@ class Database: startCash, seatNo, winnings, + street0VPI, street1Seen, street2Seen, street3Seen, @@ -1422,7 +1424,7 @@ class Database: street4Aggr ) VALUES ( - %s, %s, %s, %s, + %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )""" @@ -1436,7 +1438,6 @@ class Database: # startCards, # rake, # totalProfit, -# street0VPI, # street0_3BChance, # street0_3BDone, # sawShowdown, diff --git a/pyfpdb/DerivedStats.py b/pyfpdb/DerivedStats.py index 1e23e600..4b48f618 100644 --- a/pyfpdb/DerivedStats.py +++ b/pyfpdb/DerivedStats.py @@ -98,6 +98,7 @@ class DerivedStats(): # commentTs DATETIME def assembleHandsPlayers(self, hand): + #street0VPI/vpip already called in Hand #hand.players = [[seat, name, chips],[seat, name, chips]] for player in hand.players: self.handsplayers[player[1]]['seatNo'] = player[0] @@ -109,7 +110,7 @@ class DerivedStats(): self.handsplayers[player]['winnings'] = int(100 * hand.collectees[player]) for i, street in enumerate(hand.actionStreets[2:]): - self.seen(self.hand, i+2) + self.seen(self.hand, i+1) for i, street in enumerate(hand.actionStreets[1:]): self.aggr(self.hand, i) @@ -815,9 +816,9 @@ class DerivedStats(): for player in hand.players: if player[1] in vpipers: - self.handsplayers[player[1]]['vpip'] = True + self.handsplayers[player[1]]['street0VPI'] = True else: - self.handsplayers[player[1]]['vpip'] = False + self.handsplayers[player[1]]['street0VPI'] = False def playersAtStreetX(self, hand): """ playersAtStreet1 SMALLINT NOT NULL, /* num of players seeing flop/street4/draw1 */""" @@ -856,7 +857,7 @@ class DerivedStats(): def seen(self, hand, i): pas = set() - for act in hand.actions[hand.actionStreets[i]]: + for act in hand.actions[hand.actionStreets[i+1]]: pas.add(act[0]) for player in hand.players: