Merge remote branch 'donoban/master' into donoban-merge

This commit is contained in:
Scott Wolchok 2011-02-26 18:21:25 -05:00
commit 635dbc9a11
4 changed files with 80 additions and 4 deletions

View File

@ -73,7 +73,7 @@ except ImportError:
use_numpy = False use_numpy = False
DB_VERSION = 149 DB_VERSION = 150
# Variance created as sqlite has a bunch of undefined aggregate functions. # Variance created as sqlite has a bunch of undefined aggregate functions.
@ -1838,6 +1838,8 @@ class Database:
pdata[p]['street0_FoldTo4BDone'], pdata[p]['street0_FoldTo4BDone'],
pdata[p]['street0_SqueezeChance'], pdata[p]['street0_SqueezeChance'],
pdata[p]['street0_SqueezeDone'], pdata[p]['street0_SqueezeDone'],
pdata[p]['raiseToStealChance'],
pdata[p]['raiseToStealDone'],
pdata[p]['success_Steal'], pdata[p]['success_Steal'],
pdata[p]['otherRaisedStreet0'], pdata[p]['otherRaisedStreet0'],
pdata[p]['otherRaisedStreet1'], pdata[p]['otherRaisedStreet1'],
@ -1964,6 +1966,8 @@ class Database:
line.append(pdata[p]['street0_FoldTo4BDone']) line.append(pdata[p]['street0_FoldTo4BDone'])
line.append(pdata[p]['street0_SqueezeChance']) line.append(pdata[p]['street0_SqueezeChance'])
line.append(pdata[p]['street0_SqueezeDone']) line.append(pdata[p]['street0_SqueezeDone'])
line.append(pdata[p]['raiseToStealChance'])
line.append(pdata[p]['raiseToStealDone'])
line.append(pdata[p]['success_Steal']) line.append(pdata[p]['success_Steal'])
line.append(pdata[p]['street1Seen']) line.append(pdata[p]['street1Seen'])
line.append(pdata[p]['street2Seen']) line.append(pdata[p]['street2Seen'])

View File

@ -59,6 +59,8 @@ class DerivedStats():
init['street0_SqueezeChance']= False init['street0_SqueezeChance']= False
init['street0_SqueezeDone'] = False init['street0_SqueezeDone'] = False
init['success_Steal'] = False init['success_Steal'] = False
init['raiseToStealChance'] = False
init['raiseToStealDone'] = False
init['raiseFirstInChance'] = False init['raiseFirstInChance'] = False
init['raisedFirstIn'] = False init['raisedFirstIn'] = False
init['foldBbToStealChance'] = False init['foldBbToStealChance'] = False
@ -430,12 +432,16 @@ class DerivedStats():
#NOTE: Stud games will never hit this section #NOTE: Stud games will never hit this section
if steal_attempt: if steal_attempt:
self.handsplayers[pname]['foldBbToStealChance'] = True self.handsplayers[pname]['foldBbToStealChance'] = True
self.handsplayers[pname]['raiseToStealChance'] = True
self.handsplayers[pname]['foldedBbToSteal'] = act == 'folds' self.handsplayers[pname]['foldedBbToSteal'] = act == 'folds'
self.handsplayers[pname]['raiseToStealDone'] = act == 'raises'
self.handsplayers[stealer]['success_Steal'] = act == 'folds' self.handsplayers[stealer]['success_Steal'] = act == 'folds'
break break
elif posn == 'S': elif posn == 'S':
self.handsplayers[pname]['raiseToStealChance'] = steal_attempt
self.handsplayers[pname]['foldSbToStealChance'] = steal_attempt self.handsplayers[pname]['foldSbToStealChance'] = steal_attempt
self.handsplayers[pname]['foldedSbToSteal'] = steal_attempt and act == 'folds' self.handsplayers[pname]['foldedSbToSteal'] = steal_attempt and act == 'folds'
self.handsplayers[pname]['raiseToStealDone'] = steal_attempt and act == 'raises'
if steal_attempt and act != 'folds': if steal_attempt and act != 'folds':
break break

View File

@ -651,6 +651,9 @@ class Sql:
street0_FoldTo4BDone BOOLEAN, street0_FoldTo4BDone BOOLEAN,
street0_SqueezeChance BOOLEAN, street0_SqueezeChance BOOLEAN,
street0_SqueezeDone BOOLEAN, street0_SqueezeDone BOOLEAN,
raiseToStealChance BOOLEAN,
raiseToStealDone BOOLEAN,
success_Steal BOOLEAN, success_Steal BOOLEAN,
street1Seen BOOLEAN, street1Seen BOOLEAN,
@ -775,6 +778,9 @@ class Sql:
street0_FoldTo4BDone BOOLEAN, street0_FoldTo4BDone BOOLEAN,
street0_SqueezeChance BOOLEAN, street0_SqueezeChance BOOLEAN,
street0_SqueezeDone BOOLEAN, street0_SqueezeDone BOOLEAN,
raiseToStealChance BOOLEAN,
raiseToStealDone BOOLEAN,
success_Steal BOOLEAN, success_Steal BOOLEAN,
street1Seen BOOLEAN, street1Seen BOOLEAN,
@ -898,6 +904,9 @@ class Sql:
street0_FoldTo4BDone INT, street0_FoldTo4BDone INT,
street0_SqueezeChance INT, street0_SqueezeChance INT,
street0_SqueezeDone INT, street0_SqueezeDone INT,
raiseToStealChance INT,
raiseToStealDone INT,
success_Steal INT, success_Steal INT,
street1Seen INT, street1Seen INT,
@ -1112,6 +1121,9 @@ class Sql:
street0_FoldTo4BDone INT, street0_FoldTo4BDone INT,
street0_SqueezeChance INT, street0_SqueezeChance INT,
street0_SqueezeDone INT, street0_SqueezeDone INT,
raiseToStealChance INT,
raiseToStealDone INT,
success_Steal INT, success_Steal INT,
@ -1221,6 +1233,9 @@ class Sql:
street0_FoldTo4BDone INT, street0_FoldTo4BDone INT,
street0_SqueezeChance INT, street0_SqueezeChance INT,
street0_SqueezeDone INT, street0_SqueezeDone INT,
raiseToStealChance INT,
raiseToStealDone INT,
success_Steal INT, success_Steal INT,
street1Seen INT, street1Seen INT,
@ -1327,6 +1342,9 @@ class Sql:
street0_FoldTo4BDone INT, street0_FoldTo4BDone INT,
street0_SqueezeChance INT, street0_SqueezeChance INT,
street0_SqueezeDone INT, street0_SqueezeDone INT,
raiseToStealChance INT,
raiseToStealDone INT,
success_Steal INT, success_Steal INT,
street1Seen INT, street1Seen INT,
@ -1545,6 +1563,8 @@ class Sql:
sum(hc.street0_FoldTo4BDone) AS F4B_0, sum(hc.street0_FoldTo4BDone) AS F4B_0,
sum(hc.street0_SqueezeChance) AS SQZ_opp_0, sum(hc.street0_SqueezeChance) AS SQZ_opp_0,
sum(hc.street0_SqueezeDone) AS SQZ_0, sum(hc.street0_SqueezeDone) AS SQZ_0,
sum(hc.raiseToStealChance) AS RTS_opp,
sum(hc.raiseToStealDone) AS RTS,
sum(hc.success_Steal) AS SUC_ST, sum(hc.success_Steal) AS SUC_ST,
sum(hc.street1Seen) AS saw_f, sum(hc.street1Seen) AS saw_f,
sum(hc.street1Seen) AS saw_1, sum(hc.street1Seen) AS saw_1,
@ -1667,6 +1687,8 @@ class Sql:
sum(hc.street0_FoldTo4BDone) AS F4B_0, sum(hc.street0_FoldTo4BDone) AS F4B_0,
sum(hc.street0_SqueezeChance) AS SQZ_opp_0, sum(hc.street0_SqueezeChance) AS SQZ_opp_0,
sum(hc.street0_SqueezeDone) AS SQZ_0, sum(hc.street0_SqueezeDone) AS SQZ_0,
sum(hc.raiseToStealChance) AS RTS_opp,
sum(hc.raiseToStealDone) AS RTS,
sum(hc.success_Steal) AS SUC_ST, sum(hc.success_Steal) AS SUC_ST,
sum(hc.street1Seen) AS saw_f, sum(hc.street1Seen) AS saw_f,
sum(hc.street1Seen) AS saw_1, sum(hc.street1Seen) AS saw_1,
@ -1806,6 +1828,8 @@ class Sql:
cast(hp2.street0_FoldTo4BDone as <signed>integer) AS F4B_0, cast(hp2.street0_FoldTo4BDone as <signed>integer) AS F4B_0,
cast(hp2.street0_SqueezeChance as <signed>integer) AS SQZ_opp_0, cast(hp2.street0_SqueezeChance as <signed>integer) AS SQZ_opp_0,
cast(hp2.street0_SqueezeDone as <signed>integer) AS SQZ_0, cast(hp2.street0_SqueezeDone as <signed>integer) AS SQZ_0,
cast(hp2.raiseToStealChance as <signed>integer) AS RTS_opp,
cast(hp2.raiseToStealDone as <signed>integer) AS RTS,
cast(hp2.success_Steal as <signed>integer) AS SUC_ST, cast(hp2.success_Steal as <signed>integer) AS SUC_ST,
cast(hp2.street1Seen as <signed>integer) AS saw_f, cast(hp2.street1Seen as <signed>integer) AS saw_f,
cast(hp2.street1Seen as <signed>integer) AS saw_1, cast(hp2.street1Seen as <signed>integer) AS saw_1,
@ -1921,6 +1945,8 @@ class Sql:
cast(hp2.street0_FoldTo4BDone as <signed>integer) AS F4B_0, cast(hp2.street0_FoldTo4BDone as <signed>integer) AS F4B_0,
cast(hp2.street0_SqueezeChance as <signed>integer) AS SQZ_opp_0, cast(hp2.street0_SqueezeChance as <signed>integer) AS SQZ_opp_0,
cast(hp2.street0_SqueezeDone as <signed>integer) AS SQZ_0, cast(hp2.street0_SqueezeDone as <signed>integer) AS SQZ_0,
cast(hp2.raiseToStealChance as <signed>integer) AS RTS_opp,
cast(hp2.raiseToStealDone as <signed>integer) AS RTS,
cast(hp2.success_Steal as <signed>integer) AS SUC_ST, cast(hp2.success_Steal as <signed>integer) AS SUC_ST,
cast(hp2.street1Seen as <signed>integer) AS saw_f, cast(hp2.street1Seen as <signed>integer) AS saw_f,
cast(hp2.street1Seen as <signed>integer) AS saw_1, cast(hp2.street1Seen as <signed>integer) AS saw_1,
@ -2037,6 +2063,8 @@ class Sql:
cast(hp2.street0_FoldTo4BDone as <signed>integer) AS F4B_0, cast(hp2.street0_FoldTo4BDone as <signed>integer) AS F4B_0,
cast(hp2.street0_SqueezeChance as <signed>integer) AS SQZ_opp_0, cast(hp2.street0_SqueezeChance as <signed>integer) AS SQZ_opp_0,
cast(hp2.street0_SqueezeDone as <signed>integer) AS SQZ_0, cast(hp2.street0_SqueezeDone as <signed>integer) AS SQZ_0,
cast(hp2.raiseToStealChance as <signed>integer) AS RTS_opp,
cast(hp2.raiseToStealDone as <signed>integer) AS RTS,
cast(hp2.success_Steal as <signed>integer) AS SUC_ST, cast(hp2.success_Steal as <signed>integer) AS SUC_ST,
cast(hp2.street1Seen as <signed>integer) AS saw_f, cast(hp2.street1Seen as <signed>integer) AS saw_f,
cast(hp2.street1Seen as <signed>integer) AS saw_1, cast(hp2.street1Seen as <signed>integer) AS saw_1,
@ -2272,7 +2300,7 @@ class Sql:
from Gametypes gt from Gametypes gt
WHERE type = 'ring' WHERE type = 'ring'
order by type, limitType DESC, bb_or_buyin DESC""" order by type, limitType DESC, bb_or_buyin DESC"""
#FIXME: Some stats not added to DetailedStats #FIXME: Some stats not added to DetailedStats (miss raise to steal)
if db_server == 'mysql': if db_server == 'mysql':
self.query['playerDetailedStats'] = """ self.query['playerDetailedStats'] = """
select <hgametypeId> AS hgametypeid select <hgametypeId> AS hgametypeid
@ -3493,6 +3521,8 @@ class Sql:
,street0_FoldTo4BDone ,street0_FoldTo4BDone
,street0_SqueezeChance ,street0_SqueezeChance
,street0_SqueezeDone ,street0_SqueezeDone
,raiseToStealChance
,raiseToStealDone
,success_Steal ,success_Steal
,street1Seen ,street1Seen
,street2Seen ,street2Seen
@ -3599,6 +3629,8 @@ class Sql:
,sum(street0_FoldTo4BDone) ,sum(street0_FoldTo4BDone)
,sum(street0_SqueezeChance) ,sum(street0_SqueezeChance)
,sum(street0_SqueezeDone) ,sum(street0_SqueezeDone)
,sum(raiseToStealChance)
,sum(raiseToStealDone)
,sum(success_Steal) ,sum(success_Steal)
,sum(street1Seen) ,sum(street1Seen)
,sum(street2Seen) ,sum(street2Seen)
@ -3705,6 +3737,8 @@ class Sql:
,street0_FoldTo4BDone ,street0_FoldTo4BDone
,street0_SqueezeChance ,street0_SqueezeChance
,street0_SqueezeDone ,street0_SqueezeDone
,raiseToStealChance
,raiseToStealDone
,success_Steal ,success_Steal
,street1Seen ,street1Seen
,street2Seen ,street2Seen
@ -3811,6 +3845,8 @@ class Sql:
,sum(CAST(street0_FoldTo4BDone as integer)) ,sum(CAST(street0_FoldTo4BDone as integer))
,sum(CAST(street0_SqueezeChance as integer)) ,sum(CAST(street0_SqueezeChance as integer))
,sum(CAST(street0_SqueezeDone as integer)) ,sum(CAST(street0_SqueezeDone as integer))
,sum(CAST(raiseToStealChance as integer))
,sum(CAST(raiseToStealDone as integer))
,sum(CAST(success_Steal as integer)) ,sum(CAST(success_Steal as integer))
,sum(CAST(street1Seen as integer)) ,sum(CAST(street1Seen as integer))
,sum(CAST(street2Seen as integer)) ,sum(CAST(street2Seen as integer))
@ -3917,6 +3953,8 @@ class Sql:
,street0_FoldTo4BDone ,street0_FoldTo4BDone
,street0_SqueezeChance ,street0_SqueezeChance
,street0_SqueezeDone ,street0_SqueezeDone
,raiseToStealChance
,raiseToStealDone
,success_Steal ,success_Steal
,street1Seen ,street1Seen
,street2Seen ,street2Seen
@ -4023,6 +4061,8 @@ class Sql:
,sum(CAST(street0_FoldTo4BDone as integer)) ,sum(CAST(street0_FoldTo4BDone as integer))
,sum(CAST(street0_SqueezeChance as integer)) ,sum(CAST(street0_SqueezeChance as integer))
,sum(CAST(street0_SqueezeDone as integer)) ,sum(CAST(street0_SqueezeDone as integer))
,sum(CAST(raiseToStealChance as integer))
,sum(CAST(raiseToStealDone as integer))
,sum(CAST(success_Steal as integer)) ,sum(CAST(success_Steal as integer))
,sum(CAST(street1Seen as integer)) ,sum(CAST(street1Seen as integer))
,sum(CAST(street2Seen as integer)) ,sum(CAST(street2Seen as integer))
@ -4124,6 +4164,8 @@ class Sql:
street0_FoldTo4BDone, street0_FoldTo4BDone,
street0_SqueezeChance, street0_SqueezeChance,
street0_SqueezeDone, street0_SqueezeDone,
raiseToStealChance,
raiseToStealDone,
success_Steal, success_Steal,
street1Seen, street1Seen,
street2Seen, street2Seen,
@ -4213,7 +4255,7 @@ 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, %s, %s, %s, %s,
%s, %s)""" %s, %s, %s, %s)"""
self.query['update_hudcache'] = """ self.query['update_hudcache'] = """
UPDATE HudCache SET UPDATE HudCache SET
@ -4232,6 +4274,8 @@ class Sql:
street0_FoldTo4BDone=street0_FoldTo4BDone+%s, street0_FoldTo4BDone=street0_FoldTo4BDone+%s,
street0_SqueezeChance=street0_SqueezeChance+%s, street0_SqueezeChance=street0_SqueezeChance+%s,
street0_SqueezeDone=street0_SqueezeDone+%s, street0_SqueezeDone=street0_SqueezeDone+%s,
raiseToStealChance=raiseToStealChance+%s,
raiseToStealDone=raiseToStealDone+%s,
success_Steal=success_Steal+%s, success_Steal=success_Steal+%s,
street1Seen=street1Seen+%s, street1Seen=street1Seen+%s,
street2Seen=street2Seen+%s, street2Seen=street2Seen+%s,
@ -4706,6 +4750,8 @@ class Sql:
street0_FoldTo4BDone, street0_FoldTo4BDone,
street0_SqueezeChance, street0_SqueezeChance,
street0_SqueezeDone, street0_SqueezeDone,
raiseToStealChance,
raiseToStealDone,
success_Steal, success_Steal,
otherRaisedStreet0, otherRaisedStreet0,
otherRaisedStreet1, otherRaisedStreet1,
@ -4766,7 +4812,7 @@ 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, %s, %s, %s, %s,
%s, %s %s, %s, %s, %s
)""" )"""
self.query['store_hands_actions'] = """insert into HandsActions ( self.query['store_hands_actions'] = """insert into HandsActions (

View File

@ -530,6 +530,26 @@ def squeeze(stat_dict, player):
_('% Squeeze preflop')) _('% Squeeze preflop'))
def raiseToSteal(stat_dict, player):
""" Raise to Steal."""
stat = 0.0
try:
stat = float(stat_dict[player]['rts'])/float(stat_dict[player]['rts_opp'])
return (stat,
'%3.1f' % (100.0*stat),
'RST=%3.1f%%' % (100.0*stat),
'RST_pf=%3.1f%%' % (100.0*stat),
'(%d/%d)' % (stat_dict[player]['rts'], stat_dict[player]['rts_opp']),
_('% Raise to Steal'))
except:
return (stat,
'NA',
'RST=NA',
'RST_pf=NA',
'(0/0)',
_('% Raise to Steal'))
def f_3bet(stat_dict, player): def f_3bet(stat_dict, player):
""" Fold to 3bet preflop. """ """ Fold to 3bet preflop. """
stat = 0.0 stat = 0.0