diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index ed987d81..42fee82b 100755 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1402,6 +1402,7 @@ class Database: pdata[p]['street2Seen'], pdata[p]['street3Seen'], pdata[p]['street4Seen'], + pdata[p]['sawShowdown'], pdata[p]['street0Aggr'], pdata[p]['street1Aggr'], pdata[p]['street2Aggr'], @@ -1430,6 +1431,7 @@ class Database: street2Seen, street3Seen, street4Seen, + sawShowdown, street0Aggr, street1Aggr, street2Aggr, @@ -1438,6 +1440,7 @@ class Database: wonWhenSeenStreet1 ) VALUES ( + %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, @@ -1450,7 +1453,6 @@ class Database: # startCards, # street0_3BChance, # street0_3BDone, -# sawShowdown, # wonAtSD, # otherRaisedStreet1, # otherRaisedStreet2, diff --git a/pyfpdb/DerivedStats.py b/pyfpdb/DerivedStats.py index c6b3fc64..3214cbbb 100644 --- a/pyfpdb/DerivedStats.py +++ b/pyfpdb/DerivedStats.py @@ -44,6 +44,7 @@ class DerivedStats(): self.handsplayers[player[1]]['street4Seen'] = False self.handsplayers[player[1]]['street4Aggr'] = False self.handsplayers[player[1]]['wonWhenSeenStreet1'] = False + self.handsplayers[player[1]]['sawShowdown'] = False self.assembleHands(self.hand) self.assembleHandsPlayers(self.hand) @@ -100,6 +101,8 @@ class DerivedStats(): def assembleHandsPlayers(self, hand): #street0VPI/vpip already called in Hand + # sawShowdown is calculated in playersAtStreetX, as that calculation gives us a convenient list of names + #hand.players = [[seat, name, chips],[seat, name, chips]] for player in hand.players: self.handsplayers[player[1]]['seatNo'] = player[0] @@ -193,7 +196,11 @@ class DerivedStats(): self.hands['playersAtStreet%d' % (i+1)] = len(set.union(alliners, actors)) actions = hand.actions[hand.actionStreets[-1]] - self.hands['playersAtShowdown'] = len(set.union(self.pfba(actions) - self.pfba(actions, l=('folds',)), alliners)) + pas = set.union(self.pfba(actions) - self.pfba(actions, l=('folds',)), alliners) + self.hands['playersAtShowdown'] = len(pas) + + for player in pas: + self.handsplayers[player]['sawShowdown'] = True def streetXRaises(self, hand): # self.actions[street] is a list of all actions in a tuple, contining the action as the second element