diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 88fbe166..be5cd955 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -73,7 +73,7 @@ except ImportError: use_numpy = False -DB_VERSION = 148 +DB_VERSION = 149 # Variance created as sqlite has a bunch of undefined aggregate functions. @@ -1826,12 +1826,15 @@ class Database: pdata[p]['street0_3BDone'], pdata[p]['street0_4BChance'], pdata[p]['street0_4BDone'], + pdata[p]['street0_C4BChance'], + pdata[p]['street0_C4BDone'], pdata[p]['street0_FoldTo3BChance'], pdata[p]['street0_FoldTo3BDone'], pdata[p]['street0_FoldTo4BChance'], pdata[p]['street0_FoldTo4BDone'], - pdata[p]['other3BStreet0'], - pdata[p]['other4BStreet0'], + pdata[p]['street0_SqueezeChance'], + pdata[p]['street0_SqueezeDone'], + pdata[p]['success_Steal'], pdata[p]['otherRaisedStreet0'], pdata[p]['otherRaisedStreet1'], pdata[p]['otherRaisedStreet2'], @@ -1953,12 +1956,15 @@ class Database: line.append(pdata[p]['street0_3BDone']) line.append(pdata[p]['street0_4BChance']) line.append(pdata[p]['street0_4BDone']) + line.append(pdata[p]['street0_C4BChance']) + line.append(pdata[p]['street0_C4BDone']) line.append(pdata[p]['street0_FoldTo3BChance']) line.append(pdata[p]['street0_FoldTo3BDone']) line.append(pdata[p]['street0_FoldTo4BChance']) line.append(pdata[p]['street0_FoldTo4BDone']) - line.append(pdata[p]['other3BStreet0']) - line.append(pdata[p]['other4BStreet0']) + line.append(pdata[p]['street0_SqueezeChance']) + line.append(pdata[p]['street0_SqueezeDone']) + line.append(pdata[p]['success_Steal']) line.append(pdata[p]['street1Seen']) line.append(pdata[p]['street2Seen']) line.append(pdata[p]['street3Seen']) diff --git a/pyfpdb/DerivedStats.py b/pyfpdb/DerivedStats.py index 2bb3542f..a21bc209 100644 --- a/pyfpdb/DerivedStats.py +++ b/pyfpdb/DerivedStats.py @@ -50,10 +50,15 @@ class DerivedStats(): self.handsplayers[player[1]]['street0_3BDone'] = False self.handsplayers[player[1]]['street0_4BChance'] = False self.handsplayers[player[1]]['street0_4BDone'] = False + self.handsplayers[player[1]]['street0_C4BChance'] = False + self.handsplayers[player[1]]['street0_C4BDone'] = False self.handsplayers[player[1]]['street0_FoldTo3BChance']= False self.handsplayers[player[1]]['street0_FoldTo3BDone']= False self.handsplayers[player[1]]['street0_FoldTo4BChance']= False self.handsplayers[player[1]]['street0_FoldTo4BDone']= False + self.handsplayers[player[1]]['street0_SqueezeChance']= False + self.handsplayers[player[1]]['street0_SqueezeDone'] = False + self.handsplayers[player[1]]['success_Steal'] = False self.handsplayers[player[1]]['raiseFirstInChance'] = False self.handsplayers[player[1]]['raisedFirstIn'] = False self.handsplayers[player[1]]['foldBbToStealChance'] = False @@ -417,8 +422,10 @@ class DerivedStats(): #print "\naction:", action[0], posn, type(posn), steal_attempt, act if posn == 'B': #NOTE: Stud games will never hit this section - self.handsplayers[pname]['foldBbToStealChance'] = steal_attempt - self.handsplayers[pname]['foldedBbToSteal'] = steal_attempt and act == 'folds' + if steal_attempt: + self.handsplayers[pname]['foldBbToStealChance'] = True + self.handsplayers[pname]['foldedBbToSteal'] = act == 'folds' + self.handsplayers[stealer]['success_Steal'] = act == 'folds' break elif posn == 'S': self.handsplayers[pname]['foldSbToStealChance'] = steal_attempt @@ -434,6 +441,7 @@ class DerivedStats(): raised = True if posn in steal_positions: steal_attempt = True + stealer = pname if act == 'calls': break @@ -443,8 +451,8 @@ class DerivedStats(): def calc34BetStreet0(self, hand): """Fills street0_(3|4)B(Chance|Done), other(3|4)BStreet0""" bet_level = 1 # bet_level after 3-bet is equal to 3 + squeeze_chance = 0 for action in hand.actions[hand.actionStreets[1]]: - # FIXME: fill other(3|4)BStreet0 - i have no idea what does it mean pname, act, aggr = action[0], action[1], action[1] in ('raises', 'bets') if bet_level == 1: if aggr: @@ -453,8 +461,13 @@ class DerivedStats(): continue elif bet_level == 2: self.handsplayers[pname]['street0_3BChance'] = True + self.handsplayers[pname]['street0_SqueezeChance'] = squeeze_chance + if not squeeze_chance and act == 'calls': + squeeze_chance = 1 + continue if aggr: self.handsplayers[pname]['street0_3BDone'] = True + self.handsplayers[pname]['street0_SqueezeDone'] = squeeze_chance second_agressor = pname bet_level += 1 continue @@ -468,6 +481,11 @@ class DerivedStats(): elif act == 'folds': self.handsplayers[pname]['street0_FoldTo3BDone'] = True break + else: + self.handsplayers[pname]['street0_C4BChance'] = True + if aggr: + self.handsplayers[pname]['street0_C4BDone'] = True + bet_level += 1 continue elif bet_level == 4: if pname == second_agressor: diff --git a/pyfpdb/GuiRingPlayerStats.py b/pyfpdb/GuiRingPlayerStats.py index 9a64eac6..4d214767 100644 --- a/pyfpdb/GuiRingPlayerStats.py +++ b/pyfpdb/GuiRingPlayerStats.py @@ -50,6 +50,9 @@ onlinehelp = {'Game':_('Type of Game'), 'VPIP':_('Voluntarily Putting In the pot\n(blinds excluded)'), 'PFR':_('% Pre Flop Raise'), 'PF3':_('% Pre Flop Re-Raise / 3Bet'), + 'PF4':_('% Pre Flop Re-Raise / 4Bet'), + 'PFF3':_('% Pre Flop Fold To Re-Raise / F3Bet'), + 'PFF4':_('% Pre Flop Fold To Re-Raise / F4Bet'), 'AggFac':_('Aggression Factor\n'), 'AggFreq':_('Aggression Frequency\nBet or Raise vs Fold'), 'ContBet':_('Continuation Bet post-flop'), diff --git a/pyfpdb/HUD_config.xml.example b/pyfpdb/HUD_config.xml.example index 803b9694..85e6f443 100644 --- a/pyfpdb/HUD_config.xml.example +++ b/pyfpdb/HUD_config.xml.example @@ -24,6 +24,9 @@ + + + @@ -743,8 +746,14 @@ Left-Drag to Move" - + + + + + + + diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index 1dc7e36f..024e466b 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -639,13 +639,16 @@ class Sql: street0_3BChance BOOLEAN, street0_3BDone BOOLEAN, street0_4BChance BOOLEAN, + street0_C4BChance BOOLEAN, street0_4BDone BOOLEAN, + street0_C4BDone BOOLEAN, street0_FoldTo3BChance BOOLEAN, street0_FoldTo3BDone BOOLEAN, street0_FoldTo4BChance BOOLEAN, street0_FoldTo4BDone BOOLEAN, - other3BStreet0 BOOLEAN, - other4BStreet0 BOOLEAN, + street0_SqueezeChance BOOLEAN, + street0_SqueezeDone BOOLEAN, + success_Steal BOOLEAN, street1Seen BOOLEAN, street2Seen BOOLEAN, @@ -761,12 +764,15 @@ class Sql: street0_3BDone BOOLEAN, street0_4BChance BOOLEAN, street0_4BDone BOOLEAN, + street0_C4BChance BOOLEAN, + street0_C4BDone BOOLEAN, street0_FoldTo3BChance BOOLEAN, street0_FoldTo3BDone BOOLEAN, street0_FoldTo4BChance BOOLEAN, street0_FoldTo4BDone BOOLEAN, - other3BStreet0 BOOLEAN, - other4BStreet0 BOOLEAN, + street0_SqueezeChance BOOLEAN, + street0_SqueezeDone BOOLEAN, + success_Steal BOOLEAN, street1Seen BOOLEAN, street2Seen BOOLEAN, @@ -881,12 +887,15 @@ class Sql: street0_3BDone INT, street0_4BChance INT, street0_4BDone INT, + street0_C4BChance INT, + street0_C4BDone INT, street0_FoldTo3BChance INT, street0_FoldTo3BDone INT, street0_FoldTo4BChance INT, street0_FoldTo4BDone INT, - other3BStreet0 INT, - other4BStreet0 INT, + street0_SqueezeChance INT, + street0_SqueezeDone INT, + success_Steal INT, street1Seen INT, street2Seen INT, @@ -1091,13 +1100,16 @@ class Sql: street0_3BDone INT, street0_4BChance INT, street0_4BDone INT, + street0_C4BChance INT, + street0_C4BDone INT, street0_FoldTo3BChance INT, street0_FoldTo3BDone INT, street0_FoldTo4BChance INT, street0_FoldTo4BDone INT, + street0_SqueezeChance INT, + street0_SqueezeDone INT, + success_Steal INT, - other3BStreet0 INT, - other4BStreet0 INT, street1Seen INT, street2Seen INT, @@ -1197,12 +1209,15 @@ class Sql: street0_3BDone INT, street0_4BChance INT, street0_4BDone INT, + street0_C4BChance INT, + street0_C4BDone INT, street0_FoldTo3BChance INT, street0_FoldTo3BDone INT, street0_FoldTo4BChance INT, street0_FoldTo4BDone INT, - other3BStreet0 INT, - other4BStreet0 INT, + street0_SqueezeChance INT, + street0_SqueezeDone INT, + success_Steal INT, street1Seen INT, street2Seen INT, @@ -1300,12 +1315,15 @@ class Sql: street0_3BDone INT, street0_4BChance INT, street0_4BDone INT, + street0_C4BChance INT, + street0_C4BDone INT, street0_FoldTo3BChance INT, street0_FoldTo3BDone INT, street0_FoldTo4BChance INT, street0_FoldTo4BDone INT, - other3BStreet0 INT, - other4BStreet0 INT, + street0_SqueezeChance INT, + street0_SqueezeDone INT, + success_Steal INT, street1Seen INT, street2Seen INT, @@ -1515,10 +1533,15 @@ class Sql: sum(hc.street0_3BDone) AS TB_0, sum(hc.street0_4BChance) AS FB_opp_0, sum(hc.street0_4BDone) AS FB_0, + sum(hc.street0_C4BChance) AS CFB_opp_0, + sum(hc.street0_C4BDone) AS CFB_0, sum(hc.street0_FoldTo3BChance) AS F3B_opp_0, sum(hc.street0_FoldTo3BDone) AS F3B_0, sum(hc.street0_FoldTo4BChance) AS F4B_opp_0, sum(hc.street0_FoldTo4BDone) AS F4B_0, + sum(hc.street0_SqueezeChance) AS SQZ_opp_0, + sum(hc.street0_SqueezeDone) AS SQZ_0, + sum(hc.success_Steal) AS SUC_ST, sum(hc.street1Seen) AS saw_f, sum(hc.street1Seen) AS saw_1, sum(hc.street2Seen) AS saw_2, @@ -1632,10 +1655,15 @@ class Sql: sum(hc.street0_3BDone) AS TB_0, sum(hc.street0_4BChance) AS FB_opp_0, sum(hc.street0_4BDone) AS FB_0, + sum(hc.street0_C4BChance) AS CFB_opp_0, + sum(hc.street0_C4BDone) AS CFB_0, sum(hc.street0_FoldTo3BChance) AS F3B_opp_0, sum(hc.street0_FoldTo3BDone) AS F3B_0, sum(hc.street0_FoldTo4BChance) AS F4B_opp_0, sum(hc.street0_FoldTo4BDone) AS F4B_0, + sum(hc.street0_SqueezeChance) AS SQZ_opp_0, + sum(hc.street0_SqueezeDone) AS SQZ_0, + sum(hc.success_Steal) AS SUC_ST, sum(hc.street1Seen) AS saw_f, sum(hc.street1Seen) AS saw_1, sum(hc.street2Seen) AS saw_2, @@ -1766,10 +1794,15 @@ class Sql: cast(hp2.street0_3BDone as integer) AS TB_0, cast(hp2.street0_4BChance as integer) AS FB_opp_0, cast(hp2.street0_4BDone as integer) AS FB_0, + cast(hp2.street0_C4BChance as integer) AS CFB_opp_0, + cast(hp2.street0_C4BDone as integer) AS CFB_0, cast(hp2.street0_FoldTo3BChance as integer) AS F3B_opp_0, cast(hp2.street0_FoldTo3BDone as integer) AS F3B_0, cast(hp2.street0_FoldTo4BChance as integer) AS F4B_opp_0, cast(hp2.street0_FoldTo4BDone as integer) AS F4B_0, + cast(hp2.street0_SqueezeChance as integer) AS SQZ_opp_0, + cast(hp2.street0_SqueezeDone as integer) AS SQZ_0, + cast(hp2.success_Steal as integer) AS SUC_ST, cast(hp2.street1Seen as integer) AS saw_f, cast(hp2.street1Seen as integer) AS saw_1, cast(hp2.street2Seen as integer) AS saw_2, @@ -1876,10 +1909,15 @@ class Sql: cast(hp2.street0_3BDone as integer) AS TB_0, cast(hp2.street0_4BChance as integer) AS FB_opp_0, cast(hp2.street0_4BDone as integer) AS FB_0, + cast(hp2.street0_C4BChance as integer) AS CFB_opp_0, + cast(hp2.street0_C4BDone as integer) AS CFB_0, cast(hp2.street0_FoldTo3BChance as integer) AS F3B_opp_0, cast(hp2.street0_FoldTo3BDone as integer) AS F3B_0, cast(hp2.street0_FoldTo4BChance as integer) AS F4B_opp_0, cast(hp2.street0_FoldTo4BDone as integer) AS F4B_0, + cast(hp2.street0_SqueezeChance as integer) AS SQZ_opp_0, + cast(hp2.street0_SqueezeDone as integer) AS SQZ_0, + cast(hp2.success_Steal as integer) AS SUC_ST, cast(hp2.street1Seen as integer) AS saw_f, cast(hp2.street1Seen as integer) AS saw_1, cast(hp2.street2Seen as integer) AS saw_2, @@ -1987,10 +2025,15 @@ class Sql: cast(hp2.street0_3BDone as integer) AS TB_0, cast(hp2.street0_4BChance as integer) AS FB_opp_0, cast(hp2.street0_4BDone as integer) AS FB_0, + cast(hp2.street0_C4BChance as integer) AS CFB_opp_0, + cast(hp2.street0_C4BDone as integer) AS CFB_0, cast(hp2.street0_FoldTo3BChance as integer) AS F3B_opp_0, cast(hp2.street0_FoldTo3BDone as integer) AS F3B_0, cast(hp2.street0_FoldTo4BChance as integer) AS F4B_opp_0, cast(hp2.street0_FoldTo4BDone as integer) AS F4B_0, + cast(hp2.street0_SqueezeChance as integer) AS SQZ_opp_0, + cast(hp2.street0_SqueezeDone as integer) AS SQZ_0, + cast(hp2.success_Steal as integer) AS SUC_ST, cast(hp2.street1Seen as integer) AS saw_f, cast(hp2.street1Seen as integer) AS saw_1, cast(hp2.street2Seen as integer) AS saw_2, @@ -2225,7 +2268,7 @@ class Sql: from Gametypes gt WHERE type = 'ring' order by type, limitType DESC, bb_or_buyin DESC""" -# FIXME: fold to 3bet don't added + #FIXME: Some stats not added to DetailedStats if db_server == 'mysql': self.query['playerDetailedStats'] = """ select AS hgametypeid @@ -2244,6 +2287,16 @@ class Sql: ,case when sum(cast(hp.street0_3Bchance as integer)) = 0 then -999 else 100.0*sum(cast(hp.street0_3Bdone as integer))/sum(cast(hp.street0_3Bchance as integer)) end AS pf3 + ,case when sum(cast(hp.street0_4Bchance as integer)) = 0 then -999 + else 100.0*sum(cast(hp.street0_4Bdone as integer))/sum(cast(hp.street0_4Bchance as integer)) + end AS pf4 + ,case when sum(cast(hp.street0_FoldTo3Bchance as integer)) = 0 then -999 + else 100.0*sum(cast(hp.street0_FoldTo3Bdone as integer))/sum(cast(hp.street0_FoldTo3Bchance as integer)) + end AS pff3 + ,case when sum(cast(hp.street0_FoldTo4Bchance as integer)) = 0 then -999 + else 100.0*sum(cast(hp.street0_FoldTo4Bdone as integer))/sum(cast(hp.street0_FoldTo4Bchance as integer)) + end AS pff4 + ,case when sum(cast(hp.raiseFirstInChance as integer)) = 0 then -999 else 100.0 * sum(cast(hp.raisedFirstIn as integer)) / sum(cast(hp.raiseFirstInChance as integer)) @@ -2365,6 +2418,15 @@ class Sql: ,case when sum(cast(hp.street0_3Bchance as integer)) = 0 then -999 else 100.0*sum(cast(hp.street0_3Bdone as integer))/sum(cast(hp.street0_3Bchance as integer)) end AS pf3 + ,case when sum(cast(hp.street0_4Bchance as integer)) = 0 then -999 + else 100.0*sum(cast(hp.street0_4Bdone as integer))/sum(cast(hp.street0_4Bchance as integer)) + end AS pf4 + ,case when sum(cast(hp.street0_FoldTo3Bchance as integer)) = 0 then -999 + else 100.0*sum(cast(hp.street0_FoldTo3Bdone as integer))/sum(cast(hp.street0_FoldTo3Bchance as integer)) + end AS pff3 + ,case when sum(cast(hp.street0_FoldTo4Bchance as integer)) = 0 then -999 + else 100.0*sum(cast(hp.street0_FoldTo4Bdone as integer))/sum(cast(hp.street0_FoldTo4Bchance as integer)) + end AS pff4 ,case when sum(cast(hp.raiseFirstInChance as integer)) = 0 then -999 else 100.0 * sum(cast(hp.raisedFirstIn as integer)) / sum(cast(hp.raiseFirstInChance as integer)) @@ -2487,6 +2549,15 @@ class Sql: ,case when sum(cast(hp.street0_3Bchance as integer)) = 0 then -999 else 100.0*sum(cast(hp.street0_3Bdone as integer))/sum(cast(hp.street0_3Bchance as integer)) end AS pf3 + ,case when sum(cast(hp.street0_4Bchance as integer)) = 0 then -999 + else 100.0*sum(cast(hp.street0_4Bdone as integer))/sum(cast(hp.street0_4Bchance as integer)) + end AS pf4 + ,case when sum(cast(hp.street0_FoldTo3Bchance as integer)) = 0 then -999 + else 100.0*sum(cast(hp.street0_FoldTo3Bdone as integer))/sum(cast(hp.street0_FoldTo3Bchance as integer)) + end AS pff3 + ,case when sum(cast(hp.street0_FoldTo4Bchance as integer)) = 0 then -999 + else 100.0*sum(cast(hp.street0_FoldTo4Bdone as integer))/sum(cast(hp.street0_FoldTo4Bchance as integer)) + end AS pff4 ,case when sum(cast(hp.raiseFirstInChance as integer)) = 0 then -999 else 100.0 * sum(cast(hp.raisedFirstIn as integer)) / sum(cast(hp.raiseFirstInChance as integer)) @@ -2592,6 +2663,7 @@ class Sql: ,s.name """ + #FIXME: 3/4bet and foldTo don't added four tournaments yet if db_server == 'mysql': self.query['tourneyPlayerDetailedStats'] = """ select s.name AS siteName @@ -2715,6 +2787,9 @@ class Sql: ,stats.vpip ,stats.pfr ,stats.pf3 + ,stats.pf4 + ,stats.pff3 + ,stats.pff4 ,stats.steals ,stats.saw_f ,stats.sawsd @@ -2745,6 +2820,15 @@ class Sql: ,case when sum(street0_3Bchance) = 0 then '0' else format(100.0*sum(street0_3Bdone)/sum(street0_3Bchance),1) end AS pf3 + ,case when sum(street0_4Bchance) = 0 then '0' + else format(100.0*sum(street0_4Bdone)/sum(street0_4Bchance),1) + end AS pf4 + ,case when sum(street0_FoldTo3Bchance) = 0 then '0' + else format(100.0*sum(street0_FoldTo3Bdone)/sum(street0_FoldTo3Bchance),1) + end AS pff3 + ,case when sum(street0_FoldTo4Bchance) = 0 then '0' + else format(100.0*sum(street0_FoldTo4Bdone)/sum(street0_FoldTo4Bchance),1) + end AS pff4 ,case when sum(raiseFirstInChance) = 0 then '-' else format(100.0*sum(raisedFirstIn)/sum(raiseFirstInChance),1) end AS steals @@ -2821,6 +2905,9 @@ class Sql: ,stats.vpip ,stats.pfr ,stats.pf3 + ,stats.pf4 + ,stats.pff3 + ,stats.pff4 ,stats.steals ,stats.saw_f ,stats.sawsd @@ -2935,6 +3022,9 @@ class Sql: ,stats.vpip ,stats.pfr ,stats.pf3 + ,stats.pf4 + ,stats.pff3 + ,stats.pff4 ,stats.steals ,stats.saw_f ,stats.sawsd @@ -2973,6 +3063,15 @@ class Sql: ,case when sum(street0_3Bchance) = 0 then '0' else format(100.0*sum(street0_3Bdone)/sum(street0_3Bchance),1) end AS pf3 + ,case when sum(street0_4Bchance) = 0 then '0' + else format(100.0*sum(street0_4Bdone)/sum(street0_4Bchance),1) + end AS pf4 + ,case when sum(street0_FoldTo3Bchance) = 0 then '0' + else format(100.0*sum(street0_FoldTo3Bdone)/sum(street0_FoldTo3Bchance),1) + end AS pff3 + ,case when sum(street0_FoldTo4Bchance) = 0 then '0' + else format(100.0*sum(street0_FoldTo4Bdone)/sum(street0_FoldTo4Bchance),1) + end AS pff4 ,case when sum(raiseFirstInChance) = 0 then '-' else format(100.0*sum(raisedFirstIn)/sum(raiseFirstInChance),1) end AS steals @@ -3071,6 +3170,9 @@ class Sql: ,stats.vpip ,stats.pfr ,stats.pf3 + ,stats.pf4 + ,stats.pff3 + ,stats.pff4 ,stats.steals ,stats.saw_f ,stats.sawsd @@ -3109,6 +3211,15 @@ class Sql: ,case when sum(street0_3Bchance) = 0 then '0' else to_char(100.0*sum(street0_3Bdone)/sum(street0_3Bchance),'90D0') end AS pf3 + ,case when sum(street0_4Bchance) = 0 then '0' + else to_char(100.0*sum(street0_4Bdone)/sum(street0_4Bchance),'90D0') + end AS pf4 + ,case when sum(street0_FoldTo3Bchance) = 0 then '0' + else to_char(100.0*sum(street0_FoldTo3Bdone)/sum(street0_FoldTo3Bchance),'90D0') + end AS pff3 + ,case when sum(street0_FoldTo4Bchance) = 0 then '0' + else to_char(100.0*sum(street0_FoldTo4Bdone)/sum(street0_FoldTo4Bchance),'90D0') + end AS pff4 ,case when sum(raiseFirstInChance) = 0 then '-' else to_char(100.0*sum(raisedFirstIn)/sum(raiseFirstInChance),'90D0') end AS steals @@ -3334,12 +3445,15 @@ class Sql: ,street0_3BDone ,street0_4BChance ,street0_4BDone + ,street0_C4BChance + ,street0_C4BDone ,street0_FoldTo3BChance ,street0_FoldTo3BDone ,street0_FoldTo4BChance ,street0_FoldTo4BDone - ,other3BStreet0 - ,other4BStreet0 + ,street0_SqueezeChance + ,street0_SqueezeDone + ,success_Steal ,street1Seen ,street2Seen ,street3Seen @@ -3436,13 +3550,15 @@ class Sql: ,sum(street0_3BChance) ,sum(street0_3BDone) ,sum(street0_4BChance) - ,sum(street0_4BDone) + ,sum(street0_C4BChance) + ,sum(street0_C4BDone) ,sum(street0_FoldTo3BChance) ,sum(street0_FoldTo3BDone) ,sum(street0_FoldTo4BChance) ,sum(street0_FoldTo4BDone) - ,sum(other3BStreet0) - ,sum(other4BStreet0) + ,sum(street0_SqueezeChance) + ,sum(street0_SqueezeDone) + ,sum(success_Steal) ,sum(street1Seen) ,sum(street2Seen) ,sum(street3Seen) @@ -3540,12 +3656,15 @@ class Sql: ,street0_3BDone ,street0_4BChance ,street0_4BDone + ,street0_C4BChance + ,street0_C4BDone ,street0_FoldTo3BChance ,street0_FoldTo3BDone ,street0_FoldTo4BChance ,street0_FoldTo4BDone - ,other3BStreet0 - ,other4BStreet0 + ,street0_SqueezeChance + ,street0_SqueezeDone + ,success_Steal ,street1Seen ,street2Seen ,street3Seen @@ -3643,12 +3762,15 @@ class Sql: ,sum(CAST(street0_3BDone as integer)) ,sum(CAST(street0_4BChance as integer)) ,sum(CAST(street0_4BDone as integer)) + ,sum(CAST(street0_C4BChance as integer)) + ,sum(CAST(street0_C4BDone as integer)) ,sum(CAST(street0_FoldTo3BChance as integer)) ,sum(CAST(street0_FoldTo3BDone as integer)) ,sum(CAST(street0_FoldTo4BChance as integer)) ,sum(CAST(street0_FoldTo4BDone as integer)) - ,sum(CAST(other3BStreet0 as integer)) - ,sum(CAST(other4BStreet0 as integer)) + ,sum(CAST(street0_SqueezeChance as integer)) + ,sum(CAST(street0_SqueezeDone as integer)) + ,sum(CAST(success_Steal as integer)) ,sum(CAST(street1Seen as integer)) ,sum(CAST(street2Seen as integer)) ,sum(CAST(street3Seen as integer)) @@ -3746,12 +3868,15 @@ class Sql: ,street0_3BDone ,street0_4BChance ,street0_4BDone + ,street0_C4BChance + ,street0_C4BDone ,street0_FoldTo3BChance ,street0_FoldTo3BDone ,street0_FoldTo4BChance ,street0_FoldTo4BDone - ,other3BStreet0 - ,other4BStreet0 + ,street0_SqueezeChance + ,street0_SqueezeDone + ,success_Steal ,street1Seen ,street2Seen ,street3Seen @@ -3849,12 +3974,15 @@ class Sql: ,sum(CAST(street0_3BDone as integer)) ,sum(CAST(street0_4BChance as integer)) ,sum(CAST(street0_4BDone as integer)) + ,sum(CAST(street0_C4BChance as integer)) + ,sum(CAST(street0_C4BDone as integer)) ,sum(CAST(street0_FoldTo3BChance as integer)) ,sum(CAST(street0_FoldTo3BDone as integer)) ,sum(CAST(street0_FoldTo4BChance as integer)) ,sum(CAST(street0_FoldTo4BDone as integer)) - ,sum(CAST(other3BStreet0 as integer)) - ,sum(CAST(other4BStreet0 as integer)) + ,sum(CAST(street0_SqueezeChance as integer)) + ,sum(CAST(street0_SqueezeDone as integer)) + ,sum(CAST(success_Steal as integer)) ,sum(CAST(street1Seen as integer)) ,sum(CAST(street2Seen as integer)) ,sum(CAST(street3Seen as integer)) @@ -3947,12 +4075,15 @@ class Sql: street0_3BDone, street0_4BChance, street0_4BDone, + street0_C4BChance, + street0_C4BDone, street0_FoldTo3BChance, street0_FoldTo3BDone, street0_FoldTo4BChance, street0_FoldTo4BDone, - other3BStreet0, - other4BStreet0, + street0_SqueezeChance, + street0_SqueezeDone, + success_Steal, street1Seen, street2Seen, street3Seen, @@ -4040,7 +4171,8 @@ class Sql: %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, - %s, %s, %s, %s)""" + %s, %s, %s, %s, %s, + %s, %s)""" self.query['update_hudcache'] = """ UPDATE HudCache SET @@ -4051,12 +4183,15 @@ class Sql: street0_3BDone=street0_3BDone+%s, street0_4BChance=street0_4BChance+%s, street0_4BDone=street0_4BDone+%s, + street0_C4BChance=street0_C4BChance+%s, + street0_C4BDone=street0_C4BDone+%s, street0_FoldTo3BChance=street0_FoldTo3BChance+%s, street0_FoldTo3BDone=street0_FoldTo3BDone+%s, street0_FoldTo4BChance=street0_FoldTo4BChance+%s, street0_FoldTo4BDone=street0_FoldTo4BDone+%s, - other3BStreet0=other3BStreet0+%s, - other4BStreet0=other4BStreet0+%s, + street0_SqueezeChance=street0_SqueezeChance+%s, + street0_SqueezeDone=street0_SqueezeDone+%s, + success_Steal=success_Steal+%s, street1Seen=street1Seen+%s, street2Seen=street2Seen+%s, street3Seen=street3Seen+%s, @@ -4513,12 +4648,15 @@ class Sql: street0_3BDone, street0_4BChance, street0_4BDone, + street0_C4BChance, + street0_C4BDone, street0_FoldTo3BChance, street0_FoldTo3BDone, street0_FoldTo4BChance, street0_FoldTo4BDone, - other3BStreet0, - other4BStreet0, + street0_SqueezeChance, + street0_SqueezeDone, + success_Steal, otherRaisedStreet0, otherRaisedStreet1, otherRaisedStreet2, @@ -4577,7 +4715,8 @@ class Sql: %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, - %s, %s, %s, %s + %s, %s, %s, %s, %s, + %s, %s )""" self.query['store_hands_actions'] = """INSERT INTO HandsActions ( diff --git a/pyfpdb/Stats.py b/pyfpdb/Stats.py index 97d37d7c..a1feedc4 100755 --- a/pyfpdb/Stats.py +++ b/pyfpdb/Stats.py @@ -378,6 +378,21 @@ def steal(stat_dict, player): except: return (stat, 'NA', 'st=NA', 'steal=NA', '(0/0)', '% steal attempted') +def s_steal(stat_dict, player): + """ Success Steal %.""" + stat = 0.0 + try: + stat = float(stat_dict[player]['suc_st'])/float(stat_dict[player]['steal']) + return (stat, + '%3.1f' % (100.0*stat), + 's_st=%3.1f%%' % (100.0*stat), + 's_steal=%3.1f%%' % (100.0*stat), + '(%d/%d)' % (stat_dict[player]['suc_st'], stat_dict[player]['steal']), + _('% success steal') + ) + except: + return (stat, 'NA', 'st=NA', 's_steal=NA', '(0/0)', '% success steal') + def f_SB_steal(stat_dict, player): """ Folded SB to steal.""" stat = 0.0 @@ -465,17 +480,56 @@ def four_B(stat_dict, player): return (stat, '%3.1f' % (100.0*stat), '4B=%3.1f%%' % (100.0*stat), - '4B_pf=%3.1f%%' % (100.0*stat), + '4B=%3.1f%%' % (100.0*stat), '(%d/%d)' % (stat_dict[player]['fb_0'], stat_dict[player]['fb_opp_0']), _('% 4 Bet preflop/4rd')) except: return (stat, 'NA', '4B=NA', - '4B_pf=NA', + '4B=NA', '(0/0)', _('% 4 Bet preflop/4rd')) +def cfour_B(stat_dict, player): + """ Cold Four bet preflop/4rd.""" + stat = 0.0 + try: + stat = float(stat_dict[player]['cfb_0'])/float(stat_dict[player]['cfb_opp_0']) + return (stat, + '%3.1f' % (100.0*stat), + 'C4B=%3.1f%%' % (100.0*stat), + 'C4B_pf=%3.1f%%' % (100.0*stat), + '(%d/%d)' % (stat_dict[player]['cfb_0'], stat_dict[player]['cfb_opp_0']), + _('% Cold 4 Bet preflop/4rd')) + except: + return (stat, + 'NA', + 'C4B=NA', + 'C4B_pf=NA', + '(0/0)', + _('% Cold 4 Bet preflop/4rd')) + +def squeeze(stat_dict, player): + """ Squeeze bet preflop.""" + stat = 0.0 + try: + stat = float(stat_dict[player]['sqz_0'])/float(stat_dict[player]['sqz_opp_0']) + return (stat, + '%3.1f' % (100.0*stat), + 'SQZ=%3.1f%%' % (100.0*stat), + 'SQZ_pf=%3.1f%%' % (100.0*stat), + '(%d/%d)' % (stat_dict[player]['sqz_0'], stat_dict[player]['sqz_opp_0']), + _('% Squeeze preflop')) + except: + return (stat, + 'NA', + 'SQZ=NA', + 'SQZ_pf=NA', + '(0/0)', + _('% Squeeze preflop')) + + def f_3bet(stat_dict, player): """ Fold to 3bet preflop. """ stat = 0.0