screwed up previous release using branches, this should work now (added hc fields as well as hp, made new fields NULLable, use 3b not 3b4b fields), next job calculate some of these fields ...
This commit is contained in:
parent
a5884ff7ae
commit
e2137a596a
|
@ -26,8 +26,10 @@ class DerivedStats():
|
||||||
self.HDs = 0
|
self.HDs = 0
|
||||||
self.street0VPI = 0
|
self.street0VPI = 0
|
||||||
self.street0Aggr = 0
|
self.street0Aggr = 0
|
||||||
self.street0_3B4BChance = 0
|
self.street0_3BChance = 0
|
||||||
self.street0_3B4BDone = 0
|
self.street0_3BDone = 0
|
||||||
|
self.street0_4BChance = 0
|
||||||
|
self.street0_4BDone = 0
|
||||||
|
|
||||||
self.street1Seen = 0
|
self.street1Seen = 0
|
||||||
self.street2Seen = 0
|
self.street2Seen = 0
|
||||||
|
|
|
@ -185,13 +185,13 @@ class FpdbSQLQueries:
|
||||||
importTime DATETIME NOT NULL,
|
importTime DATETIME NOT NULL,
|
||||||
seats SMALLINT NOT NULL,
|
seats SMALLINT NOT NULL,
|
||||||
maxSeats SMALLINT NOT NULL,
|
maxSeats SMALLINT NOT NULL,
|
||||||
vpi SMALLINT NOT NULL,
|
vpi SMALLINT,
|
||||||
street0Seen SMALLINT NOT NULL,
|
street0Seen SMALLINT,
|
||||||
street1Seen SMALLINT NOT NULL,
|
street1Seen SMALLINT,
|
||||||
street2Seen SMALLINT NOT NULL,
|
street2Seen SMALLINT,
|
||||||
street3Seen SMALLINT NOT NULL,
|
street3Seen SMALLINT,
|
||||||
street4Seen SMALLINT NOT NULL,
|
street4Seen SMALLINT,
|
||||||
sdSeen SMALLINT NOT NULL,
|
sdSeen SMALLINT,
|
||||||
comment TEXT,
|
comment TEXT,
|
||||||
commentTs DATETIME)
|
commentTs DATETIME)
|
||||||
ENGINE=INNODB"""
|
ENGINE=INNODB"""
|
||||||
|
@ -205,13 +205,13 @@ class FpdbSQLQueries:
|
||||||
importTime timestamp without time zone,
|
importTime timestamp without time zone,
|
||||||
seats SMALLINT,
|
seats SMALLINT,
|
||||||
maxSeats SMALLINT,
|
maxSeats SMALLINT,
|
||||||
vpi SMALLINT NOT NULL,
|
vpi SMALLINT,
|
||||||
street0Seen SMALLINT NOT NULL,
|
street0Seen SMALLINT,
|
||||||
street1Seen SMALLINT NOT NULL,
|
street1Seen SMALLINT,
|
||||||
street2Seen SMALLINT NOT NULL,
|
street2Seen SMALLINT,
|
||||||
street3Seen SMALLINT NOT NULL,
|
street3Seen SMALLINT,
|
||||||
street4Seen SMALLINT NOT NULL,
|
street4Seen SMALLINT,
|
||||||
sdSeen SMALLINT NOT NULL,
|
sdSeen SMALLINT,
|
||||||
comment TEXT,
|
comment TEXT,
|
||||||
commentTs timestamp without time zone)"""
|
commentTs timestamp without time zone)"""
|
||||||
elif(self.dbname == 'SQLite'):
|
elif(self.dbname == 'SQLite'):
|
||||||
|
@ -348,19 +348,19 @@ class FpdbSQLQueries:
|
||||||
tourneyTypeId SMALLINT UNSIGNED NOT NULL, FOREIGN KEY (tourneyTypeId) REFERENCES TourneyTypes(id),
|
tourneyTypeId SMALLINT UNSIGNED NOT NULL, FOREIGN KEY (tourneyTypeId) REFERENCES TourneyTypes(id),
|
||||||
|
|
||||||
wonWhenSeenStreet1 FLOAT NOT NULL,
|
wonWhenSeenStreet1 FLOAT NOT NULL,
|
||||||
wonWhenSeenStreet2 FLOAT NOT NULL,
|
wonWhenSeenStreet2 FLOAT,
|
||||||
wonWhenSeenStreet3 FLOAT NOT NULL,
|
wonWhenSeenStreet3 FLOAT,
|
||||||
wonWhenSeenStreet4 FLOAT NOT NULL,
|
wonWhenSeenStreet4 FLOAT,
|
||||||
wonAtSD FLOAT NOT NULL,
|
wonAtSD FLOAT NOT NULL,
|
||||||
|
|
||||||
street0VPI BOOLEAN NOT NULL,
|
street0VPI BOOLEAN NOT NULL,
|
||||||
street0Aggr BOOLEAN NOT NULL,
|
street0Aggr BOOLEAN NOT NULL,
|
||||||
street0_3BChance BOOLEAN NOT NULL,
|
street0_3BChance BOOLEAN NOT NULL,
|
||||||
street0_3BDone BOOLEAN NOT NULL,
|
street0_3BDone BOOLEAN NOT NULL,
|
||||||
street0_4BChance BOOLEAN NOT NULL,
|
street0_4BChance BOOLEAN,
|
||||||
street0_4BDone BOOLEAN NOT NULL,
|
street0_4BDone BOOLEAN,
|
||||||
other3BStreet0 BOOLEAN NOT NULL,
|
other3BStreet0 BOOLEAN,
|
||||||
other4BStreet0 BOOLEAN NOT NULL,
|
other4BStreet0 BOOLEAN,
|
||||||
|
|
||||||
street1Seen BOOLEAN NOT NULL,
|
street1Seen BOOLEAN NOT NULL,
|
||||||
street2Seen BOOLEAN NOT NULL,
|
street2Seen BOOLEAN NOT NULL,
|
||||||
|
@ -373,12 +373,12 @@ class FpdbSQLQueries:
|
||||||
street3Aggr BOOLEAN NOT NULL,
|
street3Aggr BOOLEAN NOT NULL,
|
||||||
street4Aggr BOOLEAN NOT NULL,
|
street4Aggr BOOLEAN NOT NULL,
|
||||||
|
|
||||||
otherRaisedStreet0 BOOLEAN NOT NULL,
|
otherRaisedStreet0 BOOLEAN,
|
||||||
otherRaisedStreet1 BOOLEAN NOT NULL,
|
otherRaisedStreet1 BOOLEAN NOT NULL,
|
||||||
otherRaisedStreet2 BOOLEAN NOT NULL,
|
otherRaisedStreet2 BOOLEAN NOT NULL,
|
||||||
otherRaisedStreet3 BOOLEAN NOT NULL,
|
otherRaisedStreet3 BOOLEAN NOT NULL,
|
||||||
otherRaisedStreet4 BOOLEAN NOT NULL,
|
otherRaisedStreet4 BOOLEAN NOT NULL,
|
||||||
foldToOtherRaisedStreet0 BOOLEAN NOT NULL,
|
foldToOtherRaisedStreet0 BOOLEAN,
|
||||||
foldToOtherRaisedStreet1 BOOLEAN NOT NULL,
|
foldToOtherRaisedStreet1 BOOLEAN NOT NULL,
|
||||||
foldToOtherRaisedStreet2 BOOLEAN NOT NULL,
|
foldToOtherRaisedStreet2 BOOLEAN NOT NULL,
|
||||||
foldToOtherRaisedStreet3 BOOLEAN NOT NULL,
|
foldToOtherRaisedStreet3 BOOLEAN NOT NULL,
|
||||||
|
@ -456,19 +456,19 @@ class FpdbSQLQueries:
|
||||||
tourneyTypeId INT NOT NULL, FOREIGN KEY (tourneyTypeId) REFERENCES TourneyTypes(id),
|
tourneyTypeId INT NOT NULL, FOREIGN KEY (tourneyTypeId) REFERENCES TourneyTypes(id),
|
||||||
|
|
||||||
wonWhenSeenStreet1 FLOAT NOT NULL,
|
wonWhenSeenStreet1 FLOAT NOT NULL,
|
||||||
wonWhenSeenStreet2 FLOAT NOT NULL,
|
wonWhenSeenStreet2 FLOAT,
|
||||||
wonWhenSeenStreet3 FLOAT NOT NULL,
|
wonWhenSeenStreet3 FLOAT,
|
||||||
wonWhenSeenStreet4 FLOAT NOT NULL,
|
wonWhenSeenStreet4 FLOAT,
|
||||||
wonAtSD FLOAT NOT NULL,
|
wonAtSD FLOAT NOT NULL,
|
||||||
|
|
||||||
street0VPI BOOLEAN NOT NULL,
|
street0VPI BOOLEAN NOT NULL,
|
||||||
street0Aggr BOOLEAN NOT NULL,
|
street0Aggr BOOLEAN NOT NULL,
|
||||||
street0_3BChance BOOLEAN NOT NULL,
|
street0_3BChance BOOLEAN NOT NULL,
|
||||||
street0_3BDone BOOLEAN NOT NULL,
|
street0_3BDone BOOLEAN NOT NULL,
|
||||||
street0_4BChance BOOLEAN NOT NULL,
|
street0_4BChance BOOLEAN,
|
||||||
street0_4BDone BOOLEAN NOT NULL,
|
street0_4BDone BOOLEAN,
|
||||||
other3BStreet0 BOOLEAN NOT NULL,
|
other3BStreet0 BOOLEAN,
|
||||||
other4BStreet0 BOOLEAN NOT NULL,
|
other4BStreet0 BOOLEAN,
|
||||||
|
|
||||||
street1Seen BOOLEAN NOT NULL,
|
street1Seen BOOLEAN NOT NULL,
|
||||||
street2Seen BOOLEAN NOT NULL,
|
street2Seen BOOLEAN NOT NULL,
|
||||||
|
@ -481,12 +481,12 @@ class FpdbSQLQueries:
|
||||||
street3Aggr BOOLEAN NOT NULL,
|
street3Aggr BOOLEAN NOT NULL,
|
||||||
street4Aggr BOOLEAN NOT NULL,
|
street4Aggr BOOLEAN NOT NULL,
|
||||||
|
|
||||||
otherRaisedStreet0 BOOLEAN NOT NULL,
|
otherRaisedStreet0 BOOLEAN,
|
||||||
otherRaisedStreet1 BOOLEAN NOT NULL,
|
otherRaisedStreet1 BOOLEAN NOT NULL,
|
||||||
otherRaisedStreet2 BOOLEAN NOT NULL,
|
otherRaisedStreet2 BOOLEAN NOT NULL,
|
||||||
otherRaisedStreet3 BOOLEAN NOT NULL,
|
otherRaisedStreet3 BOOLEAN NOT NULL,
|
||||||
otherRaisedStreet4 BOOLEAN NOT NULL,
|
otherRaisedStreet4 BOOLEAN NOT NULL,
|
||||||
foldToOtherRaisedStreet0 BOOLEAN NOT NULL,
|
foldToOtherRaisedStreet0 BOOLEAN,
|
||||||
foldToOtherRaisedStreet1 BOOLEAN NOT NULL,
|
foldToOtherRaisedStreet1 BOOLEAN NOT NULL,
|
||||||
foldToOtherRaisedStreet2 BOOLEAN NOT NULL,
|
foldToOtherRaisedStreet2 BOOLEAN NOT NULL,
|
||||||
foldToOtherRaisedStreet3 BOOLEAN NOT NULL,
|
foldToOtherRaisedStreet3 BOOLEAN NOT NULL,
|
||||||
|
@ -603,12 +603,22 @@ class FpdbSQLQueries:
|
||||||
activeSeats SMALLINT NOT NULL,
|
activeSeats SMALLINT NOT NULL,
|
||||||
position CHAR(1),
|
position CHAR(1),
|
||||||
tourneyTypeId SMALLINT UNSIGNED NOT NULL, FOREIGN KEY (tourneyTypeId) REFERENCES TourneyTypes(id),
|
tourneyTypeId SMALLINT UNSIGNED NOT NULL, FOREIGN KEY (tourneyTypeId) REFERENCES TourneyTypes(id),
|
||||||
|
|
||||||
HDs INT NOT NULL,
|
HDs INT NOT NULL,
|
||||||
|
|
||||||
|
wonWhenSeenStreet1 FLOAT NOT NULL,
|
||||||
|
wonWhenSeenStreet2 FLOAT,
|
||||||
|
wonWhenSeenStreet3 FLOAT,
|
||||||
|
wonWhenSeenStreet4 FLOAT,
|
||||||
|
wonAtSD FLOAT NOT NULL,
|
||||||
|
|
||||||
street0VPI INT NOT NULL,
|
street0VPI INT NOT NULL,
|
||||||
street0Aggr INT NOT NULL,
|
street0Aggr INT NOT NULL,
|
||||||
street0_3B4BChance INT NOT NULL,
|
street0_3BChance INT NOT NULL,
|
||||||
street0_3B4BDone INT NOT NULL,
|
street0_3BDone INT NOT NULL,
|
||||||
|
street0_4BChance INT,
|
||||||
|
street0_4BDone INT,
|
||||||
|
other3BStreet0 INT,
|
||||||
|
other4BStreet0 INT,
|
||||||
|
|
||||||
street1Seen INT NOT NULL,
|
street1Seen INT NOT NULL,
|
||||||
street2Seen INT NOT NULL,
|
street2Seen INT NOT NULL,
|
||||||
|
@ -621,16 +631,16 @@ class FpdbSQLQueries:
|
||||||
street3Aggr INT NOT NULL,
|
street3Aggr INT NOT NULL,
|
||||||
street4Aggr INT NOT NULL,
|
street4Aggr INT NOT NULL,
|
||||||
|
|
||||||
|
otherRaisedStreet0 INT,
|
||||||
otherRaisedStreet1 INT NOT NULL,
|
otherRaisedStreet1 INT NOT NULL,
|
||||||
otherRaisedStreet2 INT NOT NULL,
|
otherRaisedStreet2 INT NOT NULL,
|
||||||
otherRaisedStreet3 INT NOT NULL,
|
otherRaisedStreet3 INT NOT NULL,
|
||||||
otherRaisedStreet4 INT NOT NULL,
|
otherRaisedStreet4 INT NOT NULL,
|
||||||
|
foldToOtherRaisedStreet0 INT,
|
||||||
foldToOtherRaisedStreet1 INT NOT NULL,
|
foldToOtherRaisedStreet1 INT NOT NULL,
|
||||||
foldToOtherRaisedStreet2 INT NOT NULL,
|
foldToOtherRaisedStreet2 INT NOT NULL,
|
||||||
foldToOtherRaisedStreet3 INT NOT NULL,
|
foldToOtherRaisedStreet3 INT NOT NULL,
|
||||||
foldToOtherRaisedStreet4 INT NOT NULL,
|
foldToOtherRaisedStreet4 INT NOT NULL,
|
||||||
wonWhenSeenStreet1 FLOAT NOT NULL,
|
|
||||||
wonAtSD FLOAT NOT NULL,
|
|
||||||
|
|
||||||
stealAttemptChance INT NOT NULL,
|
stealAttemptChance INT NOT NULL,
|
||||||
stealAttempted INT NOT NULL,
|
stealAttempted INT NOT NULL,
|
||||||
|
@ -676,12 +686,23 @@ class FpdbSQLQueries:
|
||||||
activeSeats SMALLINT,
|
activeSeats SMALLINT,
|
||||||
position CHAR(1),
|
position CHAR(1),
|
||||||
tourneyTypeId INT, FOREIGN KEY (tourneyTypeId) REFERENCES TourneyTypes(id),
|
tourneyTypeId INT, FOREIGN KEY (tourneyTypeId) REFERENCES TourneyTypes(id),
|
||||||
|
|
||||||
HDs INT,
|
HDs INT,
|
||||||
street0VPI INT,
|
|
||||||
|
wonWhenSeenStreet1 FLOAT NOT NULL,
|
||||||
|
wonWhenSeenStreet2 FLOAT,
|
||||||
|
wonWhenSeenStreet3 FLOAT,
|
||||||
|
wonWhenSeenStreet4 FLOAT,
|
||||||
|
wonAtSD FLOAT NOT NULL,
|
||||||
|
|
||||||
|
street0VPI INT NOT NULL,
|
||||||
street0Aggr INT,
|
street0Aggr INT,
|
||||||
street0_3B4BChance INT,
|
street0_3BChance INT NOT NULL,
|
||||||
street0_3B4BDone INT,
|
street0_3BDone INT NOT NULL,
|
||||||
|
street0_4BChance INT,
|
||||||
|
street0_4BDone INT,
|
||||||
|
other3BStreet0 INT,
|
||||||
|
other4BStreet0 INT,
|
||||||
|
|
||||||
street1Seen INT,
|
street1Seen INT,
|
||||||
street2Seen INT,
|
street2Seen INT,
|
||||||
street3Seen INT,
|
street3Seen INT,
|
||||||
|
@ -691,16 +712,17 @@ class FpdbSQLQueries:
|
||||||
street2Aggr INT,
|
street2Aggr INT,
|
||||||
street3Aggr INT,
|
street3Aggr INT,
|
||||||
street4Aggr INT,
|
street4Aggr INT,
|
||||||
|
|
||||||
|
otherRaisedStreet0 INT,
|
||||||
otherRaisedStreet1 INT,
|
otherRaisedStreet1 INT,
|
||||||
otherRaisedStreet2 INT,
|
otherRaisedStreet2 INT,
|
||||||
otherRaisedStreet3 INT,
|
otherRaisedStreet3 INT,
|
||||||
otherRaisedStreet4 INT,
|
otherRaisedStreet4 INT,
|
||||||
|
foldToOtherRaisedStreet0 INT,
|
||||||
foldToOtherRaisedStreet1 INT,
|
foldToOtherRaisedStreet1 INT,
|
||||||
foldToOtherRaisedStreet2 INT,
|
foldToOtherRaisedStreet2 INT,
|
||||||
foldToOtherRaisedStreet3 INT,
|
foldToOtherRaisedStreet3 INT,
|
||||||
foldToOtherRaisedStreet4 INT,
|
foldToOtherRaisedStreet4 INT,
|
||||||
wonWhenSeenStreet1 FLOAT,
|
|
||||||
wonAtSD FLOAT,
|
|
||||||
|
|
||||||
stealAttemptChance INT,
|
stealAttemptChance INT,
|
||||||
stealAttempted INT,
|
stealAttempted INT,
|
||||||
|
@ -810,8 +832,8 @@ class FpdbSQLQueries:
|
||||||
,count(1) AS n
|
,count(1) AS n
|
||||||
,100.0*sum(cast(street0VPI as integer))/count(1) AS vpip
|
,100.0*sum(cast(street0VPI as integer))/count(1) AS vpip
|
||||||
,100.0*sum(cast(street0Aggr as integer))/count(1) AS pfr
|
,100.0*sum(cast(street0Aggr as integer))/count(1) AS pfr
|
||||||
,case when sum(cast(street0_3b4bchance as integer)) = 0 then '0'
|
,case when sum(cast(street0_3Bchance as integer)) = 0 then '0'
|
||||||
else 100.0*sum(cast(street0_3b4bdone as integer))/sum(cast(street0_3b4bchance as integer))
|
else 100.0*sum(cast(street0_3Bdone as integer))/sum(cast(street0_3Bchance as integer))
|
||||||
end AS pf3
|
end AS pf3
|
||||||
,case when sum(cast(stealattemptchance as integer)) = 0 then -999
|
,case when sum(cast(stealattemptchance as integer)) = 0 then -999
|
||||||
else 100.0*sum(cast(stealattempted as integer))/sum(cast(stealattemptchance as integer))
|
else 100.0*sum(cast(stealattempted as integer))/sum(cast(stealattemptchance as integer))
|
||||||
|
@ -896,8 +918,8 @@ class FpdbSQLQueries:
|
||||||
,sum(HDs) AS n
|
,sum(HDs) AS n
|
||||||
,format(100.0*sum(street0VPI)/sum(HDs),1) AS vpip
|
,format(100.0*sum(street0VPI)/sum(HDs),1) AS vpip
|
||||||
,format(100.0*sum(street0Aggr)/sum(HDs),1) AS pfr
|
,format(100.0*sum(street0Aggr)/sum(HDs),1) AS pfr
|
||||||
,case when sum(street0_3b4bchance) = 0 then '0'
|
,case when sum(street0_3Bchance) = 0 then '0'
|
||||||
else format(100.0*sum(street0_3b4bdone)/sum(street0_3b4bchance),1)
|
else format(100.0*sum(street0_3Bdone)/sum(street0_3Bchance),1)
|
||||||
end AS pf3
|
end AS pf3
|
||||||
,case when sum(stealattemptchance) = 0 then '-'
|
,case when sum(stealattemptchance) = 0 then '-'
|
||||||
else format(100.0*sum(stealattempted)/sum(stealattemptchance),1)
|
else format(100.0*sum(stealattempted)/sum(stealattemptchance),1)
|
||||||
|
@ -996,8 +1018,8 @@ class FpdbSQLQueries:
|
||||||
,sum(HDs) as n
|
,sum(HDs) as n
|
||||||
,to_char(100.0*sum(street0VPI)/sum(HDs),'990D0') AS vpip
|
,to_char(100.0*sum(street0VPI)/sum(HDs),'990D0') AS vpip
|
||||||
,to_char(100.0*sum(street0Aggr)/sum(HDs),'90D0') AS pfr
|
,to_char(100.0*sum(street0Aggr)/sum(HDs),'90D0') AS pfr
|
||||||
,case when sum(street0_3b4bchance) = 0 then '0'
|
,case when sum(street0_3Bchance) = 0 then '0'
|
||||||
else to_char(100.0*sum(street0_3b4bdone)/sum(street0_3b4bchance),'90D0')
|
else to_char(100.0*sum(street0_3Bdone)/sum(street0_3Bchance),'90D0')
|
||||||
end AS pf3
|
end AS pf3
|
||||||
,case when sum(stealattemptchance) = 0 then '-'
|
,case when sum(stealattemptchance) = 0 then '-'
|
||||||
else to_char(100.0*sum(stealattempted)/sum(stealattemptchance),'90D0')
|
else to_char(100.0*sum(stealattempted)/sum(stealattemptchance),'90D0')
|
||||||
|
@ -1118,8 +1140,8 @@ class FpdbSQLQueries:
|
||||||
,sum(HDs) AS n
|
,sum(HDs) AS n
|
||||||
,format(100.0*sum(street0VPI)/sum(HDs),1) AS vpip
|
,format(100.0*sum(street0VPI)/sum(HDs),1) AS vpip
|
||||||
,format(100.0*sum(street0Aggr)/sum(HDs),1) AS pfr
|
,format(100.0*sum(street0Aggr)/sum(HDs),1) AS pfr
|
||||||
,case when sum(street0_3b4bchance) = 0 then '0'
|
,case when sum(street0_3Bchance) = 0 then '0'
|
||||||
else format(100.0*sum(street0_3b4bdone)/sum(street0_3b4bchance),1)
|
else format(100.0*sum(street0_3Bdone)/sum(street0_3Bchance),1)
|
||||||
end AS pf3
|
end AS pf3
|
||||||
,case when sum(stealattemptchance) = 0 then '-'
|
,case when sum(stealattemptchance) = 0 then '-'
|
||||||
else format(100.0*sum(stealattempted)/sum(stealattemptchance),1)
|
else format(100.0*sum(stealattempted)/sum(stealattemptchance),1)
|
||||||
|
@ -1249,8 +1271,8 @@ class FpdbSQLQueries:
|
||||||
,sum(HDs) AS n
|
,sum(HDs) AS n
|
||||||
,to_char(round(100.0*sum(street0VPI)/sum(HDs)),'990D0') AS vpip
|
,to_char(round(100.0*sum(street0VPI)/sum(HDs)),'990D0') AS vpip
|
||||||
,to_char(round(100.0*sum(street0Aggr)/sum(HDs)),'90D0') AS pfr
|
,to_char(round(100.0*sum(street0Aggr)/sum(HDs)),'90D0') AS pfr
|
||||||
,case when sum(street0_3b4bchance) = 0 then '0'
|
,case when sum(street0_3Bchance) = 0 then '0'
|
||||||
else to_char(100.0*sum(street0_3b4bdone)/sum(street0_3b4bchance),'90D0')
|
else to_char(100.0*sum(street0_3Bdone)/sum(street0_3Bchance),'90D0')
|
||||||
end AS pf3
|
end AS pf3
|
||||||
,case when sum(stealattemptchance) = 0 then '-'
|
,case when sum(stealattemptchance) = 0 then '-'
|
||||||
else to_char(100.0*sum(stealattempted)/sum(stealattemptchance),'90D0')
|
else to_char(100.0*sum(stealattempted)/sum(stealattemptchance),'90D0')
|
||||||
|
@ -1449,7 +1471,7 @@ class FpdbSQLQueries:
|
||||||
, hp.winnings - SUM(ha.amount) as profit
|
, hp.winnings - SUM(ha.amount) as profit
|
||||||
from HandsPlayers hp
|
from HandsPlayers hp
|
||||||
inner join Hands h ON h.id = hp.handId
|
inner join Hands h ON h.id = hp.handId
|
||||||
left join HandsActions ha ON ha.handPlayerId = hp.id
|
left join HandsActions ha ON ha.handsPlayerId = hp.id
|
||||||
where hp.playerId in <player_test>
|
where hp.playerId in <player_test>
|
||||||
# use <gametype_test> here ?
|
# use <gametype_test> here ?
|
||||||
and hp.tourneysPlayersId IS NULL
|
and hp.tourneysPlayersId IS NULL
|
||||||
|
@ -1489,8 +1511,8 @@ class FpdbSQLQueries:
|
||||||
,wonAtSD
|
,wonAtSD
|
||||||
,street0VPI
|
,street0VPI
|
||||||
,street0Aggr
|
,street0Aggr
|
||||||
,street0_3B4BChance
|
,street0_3BChance
|
||||||
,street0_3B4BDone
|
,street0_3BDone
|
||||||
,street1Seen
|
,street1Seen
|
||||||
,street2Seen
|
,street2Seen
|
||||||
,street3Seen
|
,street3Seen
|
||||||
|
@ -1563,8 +1585,8 @@ class FpdbSQLQueries:
|
||||||
,sum(wonAtSD)
|
,sum(wonAtSD)
|
||||||
,sum(CAST(street0VPI as integer))
|
,sum(CAST(street0VPI as integer))
|
||||||
,sum(CAST(street0Aggr as integer))
|
,sum(CAST(street0Aggr as integer))
|
||||||
,sum(CAST(street0_3B4BChance as integer))
|
,sum(CAST(street0_3BChance as integer))
|
||||||
,sum(CAST(street0_3B4BDone as integer))
|
,sum(CAST(street0_3BDone as integer))
|
||||||
,sum(CAST(street1Seen as integer))
|
,sum(CAST(street1Seen as integer))
|
||||||
,sum(CAST(street2Seen as integer))
|
,sum(CAST(street2Seen as integer))
|
||||||
,sum(CAST(street3Seen as integer))
|
,sum(CAST(street3Seen as integer))
|
||||||
|
|
|
@ -76,7 +76,7 @@ class GuiTableViewer (threading.Thread):
|
||||||
arr=[]
|
arr=[]
|
||||||
#first prepare the header row
|
#first prepare the header row
|
||||||
if (self.category=="holdem" or self.category=="omahahi" or self.category=="omahahilo"):
|
if (self.category=="holdem" or self.category=="omahahi" or self.category=="omahahilo"):
|
||||||
tmp=("Name", "HDs", "VPIP", "PFR", "PF3B4B", "ST")
|
tmp=("Name", "HDs", "VPIP", "PFR", "PF3B", "ST")
|
||||||
|
|
||||||
tmp+=("FS", "FB")
|
tmp+=("FS", "FB")
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ class GuiTableViewer (threading.Thread):
|
||||||
tmp.append(str(row[6]))#Hands
|
tmp.append(str(row[6]))#Hands
|
||||||
tmp.append(self.hudDivide(row[7],row[6])) #VPIP
|
tmp.append(self.hudDivide(row[7],row[6])) #VPIP
|
||||||
tmp.append(self.hudDivide(row[8],row[6])) #PFR
|
tmp.append(self.hudDivide(row[8],row[6])) #PFR
|
||||||
tmp.append(self.hudDivide(row[10],row[9])+" ("+str(row[9])+")") #PF3B4B
|
tmp.append(self.hudDivide(row[10],row[9])+" ("+str(row[9])+")") #PF3B
|
||||||
|
|
||||||
tmp.append(self.hudDivide(row[31],row[30])+" ("+str(row[30])+")") #ST
|
tmp.append(self.hudDivide(row[31],row[30])+" ("+str(row[30])+")") #ST
|
||||||
|
|
||||||
|
|
138
pyfpdb/SQL.py
138
pyfpdb/SQL.py
|
@ -172,72 +172,72 @@ class Sql:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self.query['get_stats_from_hand'] = """
|
self.query['get_stats_from_hand'] = """
|
||||||
SELECT HudCache.playerId AS player_id,
|
SELECT hc.playerId AS player_id,
|
||||||
HandsPlayers.seatNo AS seat,
|
hp.seatNo AS seat,
|
||||||
Players.name AS screen_name,
|
p.name AS screen_name,
|
||||||
sum(HDs) AS n,
|
sum(hc.HDs) AS n,
|
||||||
sum(street0VPI) AS vpip,
|
sum(hc.street0VPI) AS vpip,
|
||||||
sum(street0Aggr) AS pfr,
|
sum(hc.street0Aggr) AS pfr,
|
||||||
sum(street0_3B4BChance) AS TB_opp_0,
|
sum(hc.street0_3BChance) AS TB_opp_0,
|
||||||
sum(street0_3B4BDone) AS TB_0,
|
sum(hc.street0_3BDone) AS TB_0,
|
||||||
sum(street1Seen) AS saw_f,
|
sum(hc.street1Seen) AS saw_f,
|
||||||
sum(street1Seen) AS saw_1,
|
sum(hc.street1Seen) AS saw_1,
|
||||||
sum(street2Seen) AS saw_2,
|
sum(hc.street2Seen) AS saw_2,
|
||||||
sum(street3Seen) AS saw_3,
|
sum(hc.street3Seen) AS saw_3,
|
||||||
sum(street4Seen) AS saw_4,
|
sum(hc.street4Seen) AS saw_4,
|
||||||
sum(sawShowdown) AS sd,
|
sum(hc.sawShowdown) AS sd,
|
||||||
sum(street1Aggr) AS aggr_1,
|
sum(hc.street1Aggr) AS aggr_1,
|
||||||
sum(street2Aggr) AS aggr_2,
|
sum(hc.street2Aggr) AS aggr_2,
|
||||||
sum(street3Aggr) AS aggr_3,
|
sum(hc.street3Aggr) AS aggr_3,
|
||||||
sum(street4Aggr) AS aggr_4,
|
sum(hc.street4Aggr) AS aggr_4,
|
||||||
sum(otherRaisedStreet1) AS was_raised_1,
|
sum(hc.otherRaisedStreet1) AS was_raised_1,
|
||||||
sum(otherRaisedStreet2) AS was_raised_2,
|
sum(hc.otherRaisedStreet2) AS was_raised_2,
|
||||||
sum(otherRaisedStreet3) AS was_raised_3,
|
sum(hc.otherRaisedStreet3) AS was_raised_3,
|
||||||
sum(otherRaisedStreet4) AS was_raised_4,
|
sum(hc.otherRaisedStreet4) AS was_raised_4,
|
||||||
sum(foldToOtherRaisedStreet1) AS f_freq_1,
|
sum(hc.foldToOtherRaisedStreet1) AS f_freq_1,
|
||||||
sum(foldToOtherRaisedStreet2) AS f_freq_2,
|
sum(hc.foldToOtherRaisedStreet2) AS f_freq_2,
|
||||||
sum(foldToOtherRaisedStreet3) AS f_freq_3,
|
sum(hc.foldToOtherRaisedStreet3) AS f_freq_3,
|
||||||
sum(foldToOtherRaisedStreet4) AS f_freq_4,
|
sum(hc.foldToOtherRaisedStreet4) AS f_freq_4,
|
||||||
sum(wonWhenSeenStreet1) AS w_w_s_1,
|
sum(hc.wonWhenSeenStreet1) AS w_w_s_1,
|
||||||
sum(wonAtSD) AS wmsd,
|
sum(hc.wonAtSD) AS wmsd,
|
||||||
sum(stealAttemptChance) AS steal_opp,
|
sum(hc.stealAttemptChance) AS steal_opp,
|
||||||
sum(stealAttempted) AS steal,
|
sum(hc.stealAttempted) AS steal,
|
||||||
sum(foldSbToStealChance) AS SBstolen,
|
sum(hc.foldSbToStealChance) AS SBstolen,
|
||||||
sum(foldedSbToSteal) AS SBnotDef,
|
sum(hc.foldedSbToSteal) AS SBnotDef,
|
||||||
sum(foldBbToStealChance) AS BBstolen,
|
sum(hc.foldBbToStealChance) AS BBstolen,
|
||||||
sum(foldedBbToSteal) AS BBnotDef,
|
sum(hc.foldedBbToSteal) AS BBnotDef,
|
||||||
sum(street1CBChance) AS CB_opp_1,
|
sum(hc.street1CBChance) AS CB_opp_1,
|
||||||
sum(street1CBDone) AS CB_1,
|
sum(hc.street1CBDone) AS CB_1,
|
||||||
sum(street2CBChance) AS CB_opp_2,
|
sum(hc.street2CBChance) AS CB_opp_2,
|
||||||
sum(street2CBDone) AS CB_2,
|
sum(hc.street2CBDone) AS CB_2,
|
||||||
sum(street3CBChance) AS CB_opp_3,
|
sum(hc.street3CBChance) AS CB_opp_3,
|
||||||
sum(street3CBDone) AS CB_3,
|
sum(hc.street3CBDone) AS CB_3,
|
||||||
sum(street4CBChance) AS CB_opp_4,
|
sum(hc.street4CBChance) AS CB_opp_4,
|
||||||
sum(street4CBDone) AS CB_4,
|
sum(hc.street4CBDone) AS CB_4,
|
||||||
sum(foldToStreet1CBChance) AS f_cb_opp_1,
|
sum(hc.foldToStreet1CBChance) AS f_cb_opp_1,
|
||||||
sum(foldToStreet1CBDone) AS f_cb_1,
|
sum(hc.foldToStreet1CBDone) AS f_cb_1,
|
||||||
sum(foldToStreet2CBChance) AS f_cb_opp_2,
|
sum(hc.foldToStreet2CBChance) AS f_cb_opp_2,
|
||||||
sum(foldToStreet2CBDone) AS f_cb_2,
|
sum(hc.foldToStreet2CBDone) AS f_cb_2,
|
||||||
sum(foldToStreet3CBChance) AS f_cb_opp_3,
|
sum(hc.foldToStreet3CBChance) AS f_cb_opp_3,
|
||||||
sum(foldToStreet3CBDone) AS f_cb_3,
|
sum(hc.foldToStreet3CBDone) AS f_cb_3,
|
||||||
sum(foldToStreet4CBChance) AS f_cb_opp_4,
|
sum(hc.foldToStreet4CBChance) AS f_cb_opp_4,
|
||||||
sum(foldToStreet4CBDone) AS f_cb_4,
|
sum(hc.foldToStreet4CBDone) AS f_cb_4,
|
||||||
sum(totalProfit) AS net,
|
sum(hc.totalProfit) AS net,
|
||||||
sum(street1CheckCallRaiseChance) AS ccr_opp_1,
|
sum(hc.street1CheckCallRaiseChance) AS ccr_opp_1,
|
||||||
sum(street1CheckCallRaiseDone) AS ccr_1,
|
sum(hc.street1CheckCallRaiseDone) AS ccr_1,
|
||||||
sum(street2CheckCallRaiseChance) AS ccr_opp_2,
|
sum(hc.street2CheckCallRaiseChance) AS ccr_opp_2,
|
||||||
sum(street2CheckCallRaiseDone) AS ccr_2,
|
sum(hc.street2CheckCallRaiseDone) AS ccr_2,
|
||||||
sum(street3CheckCallRaiseChance) AS ccr_opp_3,
|
sum(hc.street3CheckCallRaiseChance) AS ccr_opp_3,
|
||||||
sum(street3CheckCallRaiseDone) AS ccr_3,
|
sum(hc.street3CheckCallRaiseDone) AS ccr_3,
|
||||||
sum(street4CheckCallRaiseChance) AS ccr_opp_4,
|
sum(hc.street4CheckCallRaiseChance) AS ccr_opp_4,
|
||||||
sum(street4CheckCallRaiseDone) AS ccr_4
|
sum(hc.street4CheckCallRaiseDone) AS ccr_4
|
||||||
FROM Hands
|
FROM Hands h
|
||||||
INNER JOIN HandsPlayers ON (HandsPlayers.handId = %s)
|
INNER JOIN HandsPlayers hp ON (hp.handId = %s)
|
||||||
INNER JOIN HudCache ON ( HudCache.PlayerId = HandsPlayers.PlayerId+0
|
INNER JOIN HudCache hc ON ( hc.PlayerId = hp.PlayerId+0
|
||||||
AND HudCache.gametypeId+0 = Hands.gametypeId+0)
|
AND hc.gametypeId+0 = h.gametypeId+0)
|
||||||
INNER JOIN Players ON (Players.id = HandsPlayers.PlayerId+0)
|
INNER JOIN Players p ON (p.id = hp.PlayerId+0)
|
||||||
WHERE Hands.id = %s
|
WHERE h.id = %s
|
||||||
GROUP BY HudCache.PlayerId, HandsPlayers.seatNo, Players.name
|
GROUP BY hc.PlayerId, hp.seatNo, p.name
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# same as above except stats are aggregated for all blind/limit levels
|
# same as above except stats are aggregated for all blind/limit levels
|
||||||
|
@ -246,8 +246,8 @@ class Sql:
|
||||||
sum(HDs) AS n,
|
sum(HDs) AS n,
|
||||||
sum(street0VPI) AS vpip,
|
sum(street0VPI) AS vpip,
|
||||||
sum(street0Aggr) AS pfr,
|
sum(street0Aggr) AS pfr,
|
||||||
sum(street0_3B4BChance) AS TB_opp_0,
|
sum(street0_3BChance) AS TB_opp_0,
|
||||||
sum(street0_3B4BDone) AS TB_0,
|
sum(street0_3BDone) AS TB_0,
|
||||||
sum(street1Seen) AS saw_f,
|
sum(street1Seen) AS saw_f,
|
||||||
sum(street1Seen) AS saw_1,
|
sum(street1Seen) AS saw_1,
|
||||||
sum(street2Seen) AS saw_2,
|
sum(street2Seen) AS saw_2,
|
||||||
|
@ -377,7 +377,7 @@ class Sql:
|
||||||
FROM Players, HandsActions, HandsPlayers
|
FROM Players, HandsActions, HandsPlayers
|
||||||
WHERE HandsPlayers.handid = %s
|
WHERE HandsPlayers.handid = %s
|
||||||
AND HandsPlayers.playerid = Players.id
|
AND HandsPlayers.playerid = Players.id
|
||||||
AND HandsActions.handPlayerId = HandsPlayers.id
|
AND HandsActions.handsPlayerId = HandsPlayers.id
|
||||||
ORDER BY street, actionno
|
ORDER BY street, actionno
|
||||||
"""
|
"""
|
||||||
if __name__== "__main__":
|
if __name__== "__main__":
|
||||||
|
|
|
@ -54,7 +54,7 @@ indexes = [
|
||||||
, {'tab':'Gametypes', 'col':'siteId', 'drop':0}
|
, {'tab':'Gametypes', 'col':'siteId', 'drop':0}
|
||||||
, {'tab':'Hands', 'col':'gametypeId', 'drop':0} # mct 22/3/09
|
, {'tab':'Hands', 'col':'gametypeId', 'drop':0} # mct 22/3/09
|
||||||
, {'tab':'Hands', 'col':'siteHandNo', 'drop':0}
|
, {'tab':'Hands', 'col':'siteHandNo', 'drop':0}
|
||||||
, {'tab':'HandsActions', 'col':'handplayerId', 'drop':0}
|
, {'tab':'HandsActions', 'col':'handsPlayerId', 'drop':0}
|
||||||
, {'tab':'HandsPlayers', 'col':'handId', 'drop':1}
|
, {'tab':'HandsPlayers', 'col':'handId', 'drop':1}
|
||||||
, {'tab':'HandsPlayers', 'col':'playerId', 'drop':1}
|
, {'tab':'HandsPlayers', 'col':'playerId', 'drop':1}
|
||||||
, {'tab':'HandsPlayers', 'col':'tourneysPlayersId', 'drop':0}
|
, {'tab':'HandsPlayers', 'col':'tourneysPlayersId', 'drop':0}
|
||||||
|
@ -78,7 +78,7 @@ foreignKeys = [
|
||||||
{'fktab':'Hands', 'fkcol':'gametypeId', 'rtab':'Gametypes', 'rcol':'id', 'drop':1}
|
{'fktab':'Hands', 'fkcol':'gametypeId', 'rtab':'Gametypes', 'rcol':'id', 'drop':1}
|
||||||
, {'fktab':'HandsPlayers', 'fkcol':'handId', 'rtab':'Hands', 'rcol':'id', 'drop':1}
|
, {'fktab':'HandsPlayers', 'fkcol':'handId', 'rtab':'Hands', 'rcol':'id', 'drop':1}
|
||||||
, {'fktab':'HandsPlayers', 'fkcol':'playerId', 'rtab':'Players', 'rcol':'id', 'drop':1}
|
, {'fktab':'HandsPlayers', 'fkcol':'playerId', 'rtab':'Players', 'rcol':'id', 'drop':1}
|
||||||
, {'fktab':'HandsActions', 'fkcol':'handPlayerId', 'rtab':'HandsPlayers', 'rcol':'id', 'drop':1}
|
, {'fktab':'HandsActions', 'fkcol':'handsPlayerId', 'rtab':'HandsPlayers', 'rcol':'id', 'drop':1}
|
||||||
, {'fktab':'HudCache', 'fkcol':'gametypeId', 'rtab':'Gametypes', 'rcol':'id', 'drop':1}
|
, {'fktab':'HudCache', 'fkcol':'gametypeId', 'rtab':'Gametypes', 'rcol':'id', 'drop':1}
|
||||||
, {'fktab':'HudCache', 'fkcol':'playerId', 'rtab':'Players', 'rcol':'id', 'drop':0}
|
, {'fktab':'HudCache', 'fkcol':'playerId', 'rtab':'Players', 'rcol':'id', 'drop':0}
|
||||||
, {'fktab':'HudCache', 'fkcol':'tourneyTypeId', 'rtab':'TourneyTypes', 'rcol':'id', 'drop':1}
|
, {'fktab':'HudCache', 'fkcol':'tourneyTypeId', 'rtab':'TourneyTypes', 'rcol':'id', 'drop':1}
|
||||||
|
@ -87,7 +87,7 @@ foreignKeys = [
|
||||||
{'fktab':'Hands', 'fkcol':'gametypeId', 'rtab':'Gametypes', 'rcol':'id', 'drop':1}
|
{'fktab':'Hands', 'fkcol':'gametypeId', 'rtab':'Gametypes', 'rcol':'id', 'drop':1}
|
||||||
, {'fktab':'HandsPlayers', 'fkcol':'handId', 'rtab':'Hands', 'rcol':'id', 'drop':1}
|
, {'fktab':'HandsPlayers', 'fkcol':'handId', 'rtab':'Hands', 'rcol':'id', 'drop':1}
|
||||||
, {'fktab':'HandsPlayers', 'fkcol':'playerId', 'rtab':'Players', 'rcol':'id', 'drop':1}
|
, {'fktab':'HandsPlayers', 'fkcol':'playerId', 'rtab':'Players', 'rcol':'id', 'drop':1}
|
||||||
, {'fktab':'HandsActions', 'fkcol':'handPlayerId', 'rtab':'HandsPlayers', 'rcol':'id', 'drop':1}
|
, {'fktab':'HandsActions', 'fkcol':'handsPlayerId', 'rtab':'HandsPlayers', 'rcol':'id', 'drop':1}
|
||||||
, {'fktab':'HudCache', 'fkcol':'gametypeId', 'rtab':'Gametypes', 'rcol':'id', 'drop':1}
|
, {'fktab':'HudCache', 'fkcol':'gametypeId', 'rtab':'Gametypes', 'rcol':'id', 'drop':1}
|
||||||
, {'fktab':'HudCache', 'fkcol':'playerId', 'rtab':'Players', 'rcol':'id', 'drop':0}
|
, {'fktab':'HudCache', 'fkcol':'playerId', 'rtab':'Players', 'rcol':'id', 'drop':0}
|
||||||
, {'fktab':'HudCache', 'fkcol':'tourneyTypeId', 'rtab':'TourneyTypes', 'rcol':'id', 'drop':1}
|
, {'fktab':'HudCache', 'fkcol':'tourneyTypeId', 'rtab':'TourneyTypes', 'rcol':'id', 'drop':1}
|
||||||
|
@ -1433,7 +1433,7 @@ def storeActions(cursor, handsPlayersIds, actionTypes, allIns, actionAmounts, ac
|
||||||
# Add inserts into a list and let
|
# Add inserts into a list and let
|
||||||
inserts = inserts + [(handsPlayersIds[j], i, actionNos[i][j][k], actionTypes[i][j][k], allIns[i][j][k], actionAmounts[i][j][k])]
|
inserts = inserts + [(handsPlayersIds[j], i, actionNos[i][j][k], actionTypes[i][j][k], allIns[i][j][k], actionAmounts[i][j][k])]
|
||||||
|
|
||||||
cursor.executemany("INSERT INTO HandsActions (handPlayerId, street, actionNo, action, allIn, amount) VALUES (%s, %s, %s, %s, %s, %s)", inserts)
|
cursor.executemany("INSERT INTO HandsActions (handsPlayerId, street, actionNo, action, allIn, amount) VALUES (%s, %s, %s, %s, %s, %s)", inserts)
|
||||||
#end def storeActions
|
#end def storeActions
|
||||||
|
|
||||||
def store_board_cards(cursor, hands_id, board_values, board_suits):
|
def store_board_cards(cursor, hands_id, board_values, board_suits):
|
||||||
|
@ -1482,7 +1482,7 @@ def store_hands_players_holdem_omaha(backend, conn, cursor, category, hands_id,
|
||||||
INSERT INTO HandsPlayers
|
INSERT INTO HandsPlayers
|
||||||
(handId, playerId, startCash, position, activeSeats, tourneyTypeId,
|
(handId, playerId, startCash, position, activeSeats, tourneyTypeId,
|
||||||
card1Value, card1Suit, card2Value, card2Suit, winnings, rake, seatNo, totalProfit,
|
card1Value, card1Suit, card2Value, card2Suit, winnings, rake, seatNo, totalProfit,
|
||||||
street0VPI, street0Aggr, street0_3B4BChance, street0_3B4BDone,
|
street0VPI, street0Aggr, street0_3BChance, street0_3BDone,
|
||||||
street1Seen, street2Seen, street3Seen, street4Seen, sawShowdown,
|
street1Seen, street2Seen, street3Seen, street4Seen, sawShowdown,
|
||||||
street1Aggr, street2Aggr, street3Aggr, street4Aggr,
|
street1Aggr, street2Aggr, street3Aggr, street4Aggr,
|
||||||
otherRaisedStreet1, otherRaisedStreet2, otherRaisedStreet3, otherRaisedStreet4,
|
otherRaisedStreet1, otherRaisedStreet2, otherRaisedStreet3, otherRaisedStreet4,
|
||||||
|
@ -1503,7 +1503,7 @@ VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s,
|
||||||
card_values[i][0], card_suits[i][0], card_values[i][1], card_suits[i][1],
|
card_values[i][0], card_suits[i][0], card_values[i][1], card_suits[i][1],
|
||||||
winnings[i], rakes[i], seatNos[i], hudCache['totalProfit'][i],
|
winnings[i], rakes[i], seatNos[i], hudCache['totalProfit'][i],
|
||||||
hudCache['street0VPI'][i], hudCache['street0Aggr'][i],
|
hudCache['street0VPI'][i], hudCache['street0Aggr'][i],
|
||||||
hudCache['street0_3B4BChance'][i], hudCache['street0_3B4BDone'][i],
|
hudCache['street0_3BChance'][i], hudCache['street0_3BDone'][i],
|
||||||
hudCache['street1Seen'][i], hudCache['street2Seen'][i], hudCache['street3Seen'][i],
|
hudCache['street1Seen'][i], hudCache['street2Seen'][i], hudCache['street3Seen'][i],
|
||||||
hudCache['street4Seen'][i], hudCache['sawShowdown'][i],
|
hudCache['street4Seen'][i], hudCache['sawShowdown'][i],
|
||||||
hudCache['street1Aggr'][i], hudCache['street2Aggr'][i], hudCache['street3Aggr'][i], hudCache['street4Aggr'][i],
|
hudCache['street1Aggr'][i], hudCache['street2Aggr'][i], hudCache['street3Aggr'][i], hudCache['street4Aggr'][i],
|
||||||
|
@ -1534,7 +1534,7 @@ VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s,
|
||||||
(handId, playerId, startCash, position, activeSeats, tourneyTypeId,
|
(handId, playerId, startCash, position, activeSeats, tourneyTypeId,
|
||||||
card1Value, card1Suit, card2Value, card2Suit,
|
card1Value, card1Suit, card2Value, card2Suit,
|
||||||
card3Value, card3Suit, card4Value, card4Suit, winnings, rake, seatNo, totalProfit,
|
card3Value, card3Suit, card4Value, card4Suit, winnings, rake, seatNo, totalProfit,
|
||||||
street0VPI, street0Aggr, street0_3B4BChance, street0_3B4BDone,
|
street0VPI, street0Aggr, street0_3BChance, street0_3BDone,
|
||||||
street1Seen, street2Seen, street3Seen, street4Seen, sawShowdown,
|
street1Seen, street2Seen, street3Seen, street4Seen, sawShowdown,
|
||||||
street1Aggr, street2Aggr, street3Aggr, street4Aggr,
|
street1Aggr, street2Aggr, street3Aggr, street4Aggr,
|
||||||
otherRaisedStreet1, otherRaisedStreet2, otherRaisedStreet3, otherRaisedStreet4,
|
otherRaisedStreet1, otherRaisedStreet2, otherRaisedStreet3, otherRaisedStreet4,
|
||||||
|
@ -1556,7 +1556,7 @@ VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s,
|
||||||
card_values[i][2], card_suits[i][2], card_values[i][3], card_suits[i][3],
|
card_values[i][2], card_suits[i][2], card_values[i][3], card_suits[i][3],
|
||||||
winnings[i], rakes[i], seatNos[i], hudCache['totalProfit'][i],
|
winnings[i], rakes[i], seatNos[i], hudCache['totalProfit'][i],
|
||||||
hudCache['street0VPI'][i], hudCache['street0Aggr'][i],
|
hudCache['street0VPI'][i], hudCache['street0Aggr'][i],
|
||||||
hudCache['street0_3B4BChance'][i], hudCache['street0_3B4BDone'][i],
|
hudCache['street0_3BChance'][i], hudCache['street0_3BDone'][i],
|
||||||
hudCache['street1Seen'][i], hudCache['street2Seen'][i], hudCache['street3Seen'][i],
|
hudCache['street1Seen'][i], hudCache['street2Seen'][i], hudCache['street3Seen'][i],
|
||||||
hudCache['street4Seen'][i], hudCache['sawShowdown'][i],
|
hudCache['street4Seen'][i], hudCache['sawShowdown'][i],
|
||||||
hudCache['street1Aggr'][i], hudCache['street2Aggr'][i], hudCache['street3Aggr'][i], hudCache['street4Aggr'][i],
|
hudCache['street1Aggr'][i], hudCache['street2Aggr'][i], hudCache['street3Aggr'][i], hudCache['street4Aggr'][i],
|
||||||
|
@ -1679,8 +1679,8 @@ sure to also change the following storage method and table_viewer.prepare_data i
|
||||||
#setup subarrays of the result dictionary.
|
#setup subarrays of the result dictionary.
|
||||||
street0VPI=[]
|
street0VPI=[]
|
||||||
street0Aggr=[]
|
street0Aggr=[]
|
||||||
street0_3B4BChance=[]
|
street0_3BChance=[]
|
||||||
street0_3B4BDone=[]
|
street0_3BDone=[]
|
||||||
street1Seen=[]
|
street1Seen=[]
|
||||||
street2Seen=[]
|
street2Seen=[]
|
||||||
street3Seen=[]
|
street3Seen=[]
|
||||||
|
@ -1753,8 +1753,8 @@ sure to also change the following storage method and table_viewer.prepare_data i
|
||||||
#set default values
|
#set default values
|
||||||
myStreet0VPI=False
|
myStreet0VPI=False
|
||||||
myStreet0Aggr=False
|
myStreet0Aggr=False
|
||||||
myStreet0_3B4BChance=False
|
myStreet0_3BChance=False
|
||||||
myStreet0_3B4BDone=False
|
myStreet0_3BDone=False
|
||||||
myStreet1Seen=False
|
myStreet1Seen=False
|
||||||
myStreet2Seen=False
|
myStreet2Seen=False
|
||||||
myStreet3Seen=False
|
myStreet3Seen=False
|
||||||
|
@ -1786,7 +1786,7 @@ sure to also change the following storage method and table_viewer.prepare_data i
|
||||||
if currentAction == "bet" or currentAction == "call":
|
if currentAction == "bet" or currentAction == "call":
|
||||||
myStreet0VPI = True
|
myStreet0VPI = True
|
||||||
|
|
||||||
#PF3B4BChance and PF3B4B
|
#PF3BChance and PF3B
|
||||||
pfFold=-1
|
pfFold=-1
|
||||||
pfRaise=-1
|
pfRaise=-1
|
||||||
if firstPfRaiseByNo != -1:
|
if firstPfRaiseByNo != -1:
|
||||||
|
@ -1797,9 +1797,9 @@ sure to also change the following storage method and table_viewer.prepare_data i
|
||||||
if actionType[1] == "fold" and pfFold == -1:
|
if actionType[1] == "fold" and pfFold == -1:
|
||||||
pfFold = i
|
pfFold = i
|
||||||
if pfFold == -1 or pfFold > firstPfRaiseByNo:
|
if pfFold == -1 or pfFold > firstPfRaiseByNo:
|
||||||
myStreet0_3B4BChance = True
|
myStreet0_3BChance = True
|
||||||
if pfRaise > firstPfRaiseByNo:
|
if pfRaise > firstPfRaiseByNo:
|
||||||
myStreet0_3B4BDone = True
|
myStreet0_3BDone = True
|
||||||
|
|
||||||
#steal calculations
|
#steal calculations
|
||||||
if base=="hold":
|
if base=="hold":
|
||||||
|
@ -1944,8 +1944,8 @@ sure to also change the following storage method and table_viewer.prepare_data i
|
||||||
#add each value to the appropriate array
|
#add each value to the appropriate array
|
||||||
street0VPI.append(myStreet0VPI)
|
street0VPI.append(myStreet0VPI)
|
||||||
street0Aggr.append(myStreet0Aggr)
|
street0Aggr.append(myStreet0Aggr)
|
||||||
street0_3B4BChance.append(myStreet0_3B4BChance)
|
street0_3BChance.append(myStreet0_3BChance)
|
||||||
street0_3B4BDone.append(myStreet0_3B4BDone)
|
street0_3BDone.append(myStreet0_3BDone)
|
||||||
street1Seen.append(myStreet1Seen)
|
street1Seen.append(myStreet1Seen)
|
||||||
street2Seen.append(myStreet2Seen)
|
street2Seen.append(myStreet2Seen)
|
||||||
street3Seen.append(myStreet3Seen)
|
street3Seen.append(myStreet3Seen)
|
||||||
|
@ -1993,8 +1993,8 @@ sure to also change the following storage method and table_viewer.prepare_data i
|
||||||
#add each array to the to-be-returned dictionary
|
#add each array to the to-be-returned dictionary
|
||||||
result={'street0VPI':street0VPI}
|
result={'street0VPI':street0VPI}
|
||||||
result['street0Aggr']=street0Aggr
|
result['street0Aggr']=street0Aggr
|
||||||
result['street0_3B4BChance']=street0_3B4BChance
|
result['street0_3BChance']=street0_3BChance
|
||||||
result['street0_3B4BDone']=street0_3B4BDone
|
result['street0_3BDone']=street0_3BDone
|
||||||
result['street1Seen']=street1Seen
|
result['street1Seen']=street1Seen
|
||||||
result['street2Seen']=street2Seen
|
result['street2Seen']=street2Seen
|
||||||
result['street3Seen']=street3Seen
|
result['street3Seen']=street3Seen
|
||||||
|
@ -2305,8 +2305,8 @@ def storeHudCache(cursor, base, category, gametypeId, playerIds, hudImportData):
|
||||||
row[6]+=1 #HDs
|
row[6]+=1 #HDs
|
||||||
if hudImportData['street0VPI'][player]: row[7]+=1
|
if hudImportData['street0VPI'][player]: row[7]+=1
|
||||||
if hudImportData['street0Aggr'][player]: row[8]+=1
|
if hudImportData['street0Aggr'][player]: row[8]+=1
|
||||||
if hudImportData['street0_3B4BChance'][player]: row[9]+=1
|
if hudImportData['street0_3BChance'][player]: row[9]+=1
|
||||||
if hudImportData['street0_3B4BDone'][player]: row[10]+=1
|
if hudImportData['street0_3BDone'][player]: row[10]+=1
|
||||||
if hudImportData['street1Seen'][player]: row[11]+=1
|
if hudImportData['street1Seen'][player]: row[11]+=1
|
||||||
if hudImportData['street2Seen'][player]: row[12]+=1
|
if hudImportData['street2Seen'][player]: row[12]+=1
|
||||||
if hudImportData['street3Seen'][player]: row[13]+=1
|
if hudImportData['street3Seen'][player]: row[13]+=1
|
||||||
|
@ -2369,7 +2369,7 @@ def storeHudCache(cursor, base, category, gametypeId, playerIds, hudImportData):
|
||||||
#print "playerid before insert:",row[2]
|
#print "playerid before insert:",row[2]
|
||||||
cursor.execute("""INSERT INTO HudCache
|
cursor.execute("""INSERT INTO HudCache
|
||||||
(gametypeId, playerId, activeSeats, position, tourneyTypeId,
|
(gametypeId, playerId, activeSeats, position, tourneyTypeId,
|
||||||
HDs, street0VPI, street0Aggr, street0_3B4BChance, street0_3B4BDone,
|
HDs, street0VPI, street0Aggr, street0_3BChance, street0_3BDone,
|
||||||
street1Seen, street2Seen, street3Seen, street4Seen, sawShowdown,
|
street1Seen, street2Seen, street3Seen, street4Seen, sawShowdown,
|
||||||
street1Aggr, street2Aggr, street3Aggr, street4Aggr, otherRaisedStreet1,
|
street1Aggr, street2Aggr, street3Aggr, street4Aggr, otherRaisedStreet1,
|
||||||
otherRaisedStreet2, otherRaisedStreet3, otherRaisedStreet4, foldToOtherRaisedStreet1, foldToOtherRaisedStreet2,
|
otherRaisedStreet2, otherRaisedStreet3, otherRaisedStreet4, foldToOtherRaisedStreet1, foldToOtherRaisedStreet2,
|
||||||
|
@ -2395,7 +2395,7 @@ VALUES (%s, %s, %s, %s, %s,
|
||||||
else:
|
else:
|
||||||
#print "storing updated hud data line"
|
#print "storing updated hud data line"
|
||||||
cursor.execute("""UPDATE HudCache
|
cursor.execute("""UPDATE HudCache
|
||||||
SET HDs=%s, street0VPI=%s, street0Aggr=%s, street0_3B4BChance=%s, street0_3B4BDone=%s,
|
SET HDs=%s, street0VPI=%s, street0Aggr=%s, street0_3BChance=%s, street0_3BDone=%s,
|
||||||
street1Seen=%s, street2Seen=%s, street3Seen=%s, street4Seen=%s, sawShowdown=%s,
|
street1Seen=%s, street2Seen=%s, street3Seen=%s, street4Seen=%s, sawShowdown=%s,
|
||||||
street1Aggr=%s, street2Aggr=%s, street3Aggr=%s, street4Aggr=%s, otherRaisedStreet1=%s,
|
street1Aggr=%s, street2Aggr=%s, street3Aggr=%s, street4Aggr=%s, otherRaisedStreet1=%s,
|
||||||
otherRaisedStreet2=%s, otherRaisedStreet3=%s, otherRaisedStreet4=%s, foldToOtherRaisedStreet1=%s, foldToOtherRaisedStreet2=%s,
|
otherRaisedStreet2=%s, otherRaisedStreet3=%s, otherRaisedStreet4=%s, foldToOtherRaisedStreet1=%s, foldToOtherRaisedStreet2=%s,
|
||||||
|
@ -2444,8 +2444,8 @@ def storeHudCache2(backend, cursor, base, category, gametypeId, playerIds, hudIm
|
||||||
row[6]+=1 #HDs
|
row[6]+=1 #HDs
|
||||||
if hudImportData['street0VPI'][player]: row[7]+=1
|
if hudImportData['street0VPI'][player]: row[7]+=1
|
||||||
if hudImportData['street0Aggr'][player]: row[8]+=1
|
if hudImportData['street0Aggr'][player]: row[8]+=1
|
||||||
if hudImportData['street0_3B4BChance'][player]: row[9]+=1
|
if hudImportData['street0_3BChance'][player]: row[9]+=1
|
||||||
if hudImportData['street0_3B4BDone'][player]: row[10]+=1
|
if hudImportData['street0_3BDone'][player]: row[10]+=1
|
||||||
if hudImportData['street1Seen'][player]: row[11]+=1
|
if hudImportData['street1Seen'][player]: row[11]+=1
|
||||||
if hudImportData['street2Seen'][player]: row[12]+=1
|
if hudImportData['street2Seen'][player]: row[12]+=1
|
||||||
if hudImportData['street3Seen'][player]: row[13]+=1
|
if hudImportData['street3Seen'][player]: row[13]+=1
|
||||||
|
@ -2507,7 +2507,7 @@ def storeHudCache2(backend, cursor, base, category, gametypeId, playerIds, hudIm
|
||||||
# Try to do the update first:
|
# Try to do the update first:
|
||||||
num = cursor.execute("""UPDATE HudCache
|
num = cursor.execute("""UPDATE HudCache
|
||||||
SET HDs=HDs+%s, street0VPI=street0VPI+%s, street0Aggr=street0Aggr+%s,
|
SET HDs=HDs+%s, street0VPI=street0VPI+%s, street0Aggr=street0Aggr+%s,
|
||||||
street0_3B4BChance=street0_3B4BChance+%s, street0_3B4BDone=street0_3B4BDone+%s,
|
street0_3BChance=street0_3BChance+%s, street0_3BDone=street0_3BDone+%s,
|
||||||
street1Seen=street1Seen+%s, street2Seen=street2Seen+%s, street3Seen=street3Seen+%s,
|
street1Seen=street1Seen+%s, street2Seen=street2Seen+%s, street3Seen=street3Seen+%s,
|
||||||
street4Seen=street4Seen+%s, sawShowdown=sawShowdown+%s,
|
street4Seen=street4Seen+%s, sawShowdown=sawShowdown+%s,
|
||||||
street1Aggr=street1Aggr+%s, street2Aggr=street2Aggr+%s, street3Aggr=street3Aggr+%s,
|
street1Aggr=street1Aggr+%s, street2Aggr=street2Aggr+%s, street3Aggr=street3Aggr+%s,
|
||||||
|
@ -2556,7 +2556,7 @@ AND tourneyTypeId+0=%s""", (row[6], row[7], row[8], row[9], row[10],
|
||||||
#print "playerid before insert:",row[2]," num = ", num
|
#print "playerid before insert:",row[2]," num = ", num
|
||||||
cursor.execute("""INSERT INTO HudCache
|
cursor.execute("""INSERT INTO HudCache
|
||||||
(gametypeId, playerId, activeSeats, position, tourneyTypeId,
|
(gametypeId, playerId, activeSeats, position, tourneyTypeId,
|
||||||
HDs, street0VPI, street0Aggr, street0_3B4BChance, street0_3B4BDone,
|
HDs, street0VPI, street0Aggr, street0_3BChance, street0_3BDone,
|
||||||
street1Seen, street2Seen, street3Seen, street4Seen, sawShowdown,
|
street1Seen, street2Seen, street3Seen, street4Seen, sawShowdown,
|
||||||
street1Aggr, street2Aggr, street3Aggr, street4Aggr, otherRaisedStreet1,
|
street1Aggr, street2Aggr, street3Aggr, street4Aggr, otherRaisedStreet1,
|
||||||
otherRaisedStreet2, otherRaisedStreet3, otherRaisedStreet4, foldToOtherRaisedStreet1, foldToOtherRaisedStreet2,
|
otherRaisedStreet2, otherRaisedStreet3, otherRaisedStreet4, foldToOtherRaisedStreet1, foldToOtherRaisedStreet2,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user