extensive use of any() in WTSD WMSD calcs

This commit is contained in:
eblade 2009-03-18 23:48:23 -04:00
parent f823db4eef
commit e4ac034774

View File

@ -1777,22 +1777,21 @@ sure to also change the following storage method and table_viewer.prepare_data i
#calculate VPIP and PFR
street=0
heroPfRaiseCount=0
for count in xrange(len(action_types[street][player])):#finally individual actions
currentAction=action_types[street][player][count]
for currentAction in action_types[street][player]: # finally individual actions
if currentAction == "bet":
myStreet0Aggr = True
if (currentAction=="bet" or currentAction=="call"):
if currentAction == "bet" or currentAction == "call":
myStreet0VPI = True
#PF3B4BChance and PF3B4B
pfFold=-1
pfRaise=-1
if firstPfRaiseByNo != -1:
for i in xrange(len(actionTypeByNo[0])):
if actionTypeByNo[0][i][0]==player_ids[player]:
if actionTypeByNo[0][i][1]=="bet" and pfRaise==-1 and i>firstPfRaiseByNo:
for i, actionType in enumerate(actionTypeByNo[0]):
if actionType[0] == player_ids[player]:
if actionType[1] == "bet" and pfRaise == -1 and i > firstPfRaiseByNo:
pfRaise = i
if actionTypeByNo[0][i][1]=="fold" and pfFold==-1:
if actionType[1] == "fold" and pfFold == -1:
pfFold = i
if pfFold == -1 or pfFold > firstPfRaiseByNo:
myStreet0_3B4BChance = True
@ -1829,20 +1828,17 @@ sure to also change the following storage method and table_viewer.prepare_data i
#calculate saw* values
isAllIn = False
for i in xrange(len(allIns[0][player])):
if allIns[0][player][i]:
if any(i for i in allIns[0][player]):
isAllIn = True
if (len(action_types[1][player])>0 or isAllIn):
myStreet1Seen = True
for i in xrange(len(allIns[1][player])):
if allIns[1][player][i]:
if any(i for i in allIns[1][player]):
isAllIn = True
if (len(action_types[2][player])>0 or isAllIn):
myStreet2Seen = True
for i in xrange(len(allIns[2][player])):
if allIns[2][player][i]:
if any(i for i in allIns[2][player]):
isAllIn = True
if (len(action_types[3][player])>0 or isAllIn):
myStreet3Seen = True
@ -1850,21 +1846,18 @@ sure to also change the following storage method and table_viewer.prepare_data i
#print "base:", base
if base=="hold":
mySawShowdown = True
for count in xrange(len(action_types[3][player])):
if action_types[3][player][count]=="fold":
if any(actiontype == "fold" for actiontype in action_types[3][player]):
mySawShowdown = False
else:
#print "in else"
for i in xrange(len(allIns[3][player])):
if allIns[3][player][i]:
if any(i for i in allIns[3][player]):
isAllIn = True
if (len(action_types[4][player])>0 or isAllIn):
#print "in if"
myStreet4Seen = True
mySawShowdown = True
for count in xrange(len(action_types[4][player])):
if action_types[4][player][count]=="fold":
if any(actiontype == "fold" for actiontype in action_types[4][player]):
mySawShowdown = False