From 48c395565ece9f8151c5f6c5621d6608c9386780 Mon Sep 17 00:00:00 2001 From: Worros Date: Tue, 24 Nov 2009 17:29:54 +0800 Subject: [PATCH] [NEWIMPORT] Add HandsPlayers.totalProfit Grapher now works after import yay --- pyfpdb/Database.py | 5 +++-- pyfpdb/DerivedStats.py | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 1dddafb2..9134fc6a 100755 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1396,6 +1396,7 @@ class Database: pdata[p]['card7'], pdata[p]['winnings'], pdata[p]['rake'], + pdata[p]['totalProfit'], pdata[p]['street0VPI'], pdata[p]['street1Seen'], pdata[p]['street2Seen'], @@ -1422,6 +1423,7 @@ class Database: card7, winnings, rake, + totalProfit, street0VPI, street1Seen, street2Seen, @@ -1434,7 +1436,7 @@ class Database: street4Aggr ) VALUES ( - %s, %s, %s, + %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, @@ -1444,7 +1446,6 @@ class Database: # position, # tourneyTypeId, # startCards, -# totalProfit, # street0_3BChance, # street0_3BDone, # sawShowdown, diff --git a/pyfpdb/DerivedStats.py b/pyfpdb/DerivedStats.py index 2d9869ea..1cb39a07 100644 --- a/pyfpdb/DerivedStats.py +++ b/pyfpdb/DerivedStats.py @@ -40,6 +40,7 @@ class DerivedStats(): # All stud street4 need this when importing holdem self.handsplayers[player[1]]['winnings'] = 0 self.handsplayers[player[1]]['rake'] = 0 + self.handsplayers[player[1]]['totalProfit'] = 0 self.handsplayers[player[1]]['street4Seen'] = False self.handsplayers[player[1]]['street4Aggr'] = False @@ -96,9 +97,6 @@ class DerivedStats(): #print "DEBUG: playersAtStreet 1:'%s' 2:'%s' 3:'%s' 4:'%s'" %(self.hands['playersAtStreet1'],self.hands['playersAtStreet2'],self.hands['playersAtStreet3'],self.hands['playersAtStreet4']) self.streetXRaises(hand) # Empty function currently - # comment TEXT, - # commentTs DATETIME - def assembleHandsPlayers(self, hand): #street0VPI/vpip already called in Hand #hand.players = [[seat, name, chips],[seat, name, chips]] @@ -116,6 +114,9 @@ class DerivedStats(): # Should be fine for split-pots, but won't be accurate for multi-way pots self.handsplayers[player]['rake'] = int(100* hand.rake)/len(hand.collectees) + for player in hand.pot.committed: + self.handsplayers[player]['totalProfit'] = int(self.handsplayers[player]['winnings'] - (100*hand.pot.committed[player])) + for i, street in enumerate(hand.actionStreets[2:]): self.seen(self.hand, i+1)