git28 - added test hands for steal and cb

uncommented db version checking - it works
started implementing storing steals
filling steal attempts and attempt chances fields now, but not verified correctness nor am i displaying it
This commit is contained in:
steffen123 2008-08-13 03:07:44 +01:00
parent 436bfc26f2
commit 6d7bdc347c
11 changed files with 205 additions and 44 deletions

View File

@ -1,31 +1,35 @@
todolist (db=database, imp=importer, tv=tableviewer)
Everything is subject to change.
before alpha
============
test everything actually works in windows too
expand instructions for profile file
verify link in release notes
next
====
3B/4B might not be recognised nor counted as chance if someone raised after player called.
uncomment version checking
fill steal fields correctly, add to tester and tv
before alpha2
=============
fill steal reaction fields
add all steal fields to tester and tv
CB, 2nd/3rd Barrel, fold to these
separate all gui and all processing into files that are named accordingly
ensure that there is only one db handle flying around and that its state is handled properly, ie. by the GUI. i think that might be why we have to reconnect the DB in tableviewer.
figure out what slowed it down so much between git19 and git21 (8/9aug)
printhand each and the 2/3 relevant printplayerflags respectively on ps-lhe-ring-successful-steal-by-cutoff.txt and ps-lhe-ring-call-3B-preflop-cb-no2b.txt
auto-import
why do we have to reconnect in tv.read_names_clicked?
implement error file in importer
catch index error, type error, file not found error
seperate and improve instructions for update
verify link in release notes
split install instructions into OS-specific and OS-independent section. expand release creator to concatenate.
expand instructions for profile file, again, the release-creator will cat it.
delete old mailing list and create fpdb-announce
finish updating filelist
use different colours according to classification.
table with data for graphs for SD/F, W$wSF, W$@SD
return sng support
before beta
===========
SD/F, W$wsF, W$@SD too low as reported by daedal in 2+2 forum on 12/13aug
show database version error in GUI
anonymiser script to generate testdata without making a dozen find&replace all...
separate all gui and all processing into files that are named accordingly
ensure that there is only one db handle flying around and that its state is handled properly, ie. by the GUI. i think that might be why we have to reconnect the DB in tableviewer.
figure out what slowed it down so much between git19 and git21 (8/9aug)
why do we have to reconnect in tv.read_names_clicked?
implement error file in importer
catch index error, type error, file not found error
use different colours according to classification.
table with data for graphs for SD/F, W$wSF, W$@SD
add stud, razz and tourney back to imp/tv but with less seperate codepathes
move prepare-git.sh and create-release.sh to utils
offer not storing db password

View File

@ -13,7 +13,7 @@ To install it go to https://sourceforge.net/projects/showfiles.php?group_id=2268
This is alpha1, as the name indicates it is still at a very early stage. The importer and database are nearing completion but the GUI in particular is not very functional yet and the HUD is missing alltogether.
If anyone wishes to help with development that would be very very welcome and I've put a few notes in docs/readme-dev.txt in the download for what you could do. Or just start coding and set me the patches :)
If anyone wishes to help with development that would be very very welcome and I've put a few notes in docs/readme-dev.txt in the download for what you could do. Or just start coding and send me the patches :)
If you're not a programmer and you're not interested in learning it you can still help simply by trying it out and sending bug reports and feature requests. To avoid unrealistic expectations I'd like to state that it'll be a long time until fpdb reaches feature parity to established paid-for closed source software.
Feature List (short now, growing fast ;) ):
@ -45,10 +45,9 @@ Tv takes a history filename and loads the appropriate players' stats and display
For all stats it also displays how many hands this particular is based on
If you can live with alpha software please give this a go and send any feedback, feature requests/suggestions, bug reports and animal names to steffen@sycamoretest.info or pick one of the contact methods listed in readme-overview.txt or reply to this post.
IMPORTANT: The database format WILL undergo more changes and at this point I am not planning to write a converter so please keep your history files so you can re-import when necessary. Independent of this you should always keep the original raw files in a safe place with any tracking software. Should you however end up loosing your files somehow let me know and I'll try to help.
Please send any feedback, feature requests/suggestions, bug reports and animal names to steffen@sycamoretest.info, pick one of the contact methods listed in readme-overview.txt, send me a PM here or reply to this post.

View File

@ -347,7 +347,7 @@ This program is licensed under the AGPL3, see docs"""+os.sep+"agpl-3.0.txt")
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.connect("delete_event", self.delete_event)
self.window.connect("destroy", self.destroy)
self.window.set_title("Free Poker DB - version: alpha1, git27")
self.window.set_title("Free Poker DB - version: alpha1+, git28")
self.window.set_border_width(1)
self.window.set_size_request(950,400)
self.window.set_resizable(True)

View File

@ -44,13 +44,13 @@ class fpdb_db:
else:
raise fpdb_simple.FpdbError("unrecognised database backend:"+backend)
self.cursor=self.db.cursor()
#try:
# self.cursor.execute("SELECT * FROM settings")
# settings=self.cursor.fetchone()
# if settings[0]!=21:
# print "outdated database version - please recreate tables"
#except:# _mysql_exceptions.ProgrammingError:
# print "failed to read settings table - please recreate tables"
try:
self.cursor.execute("SELECT * FROM settings")
settings=self.cursor.fetchone()
if settings[0]!=28:
print "outdated database version - please recreate tables"
except:# _mysql_exceptions.ProgrammingError:
print "failed to read settings table - please recreate tables"
#end def connect
def create_table(self, string):
@ -281,7 +281,7 @@ class fpdb_db:
foldSbToStealChance INT,
foldedSbToSteal INT)""")
self.cursor.execute("INSERT INTO settings VALUES (21);")
self.cursor.execute("INSERT INTO settings VALUES (28);")
self.cursor.execute("INSERT INTO sites VALUES (DEFAULT, \"Full Tilt Poker\", 'USD');")
self.cursor.execute("INSERT INTO sites VALUES (DEFAULT, \"PokerStars\", 'USD');")
self.db.commit()

View File

@ -101,7 +101,7 @@ def mainParser(db, cursor, site, category, hand):
totalWinnings=0
for i in range(len(winnings)):
totalWinnings+=winnings[i]
hudImportData=fpdb_simple.calculateHudImport(playerIDs, category, actionTypes, actionTypeByNo, winnings, totalWinnings)
hudImportData=fpdb_simple.generateHudData(playerIDs, category, actionTypes, actionTypeByNo, winnings, totalWinnings, positions)
if isTourney:
raise fpdb_simple.FpdbError ("tourneys are currently broken")

View File

@ -1225,7 +1225,7 @@ def store_hands_players_stud_tourney(cursor, hands_id, player_ids, start_cashes,
return result
#end def store_hands_players_stud_tourney
def calculateHudImport(player_ids, category, action_types, actionTypeByNo, winnings, totalWinnings):
def generateHudData(player_ids, category, action_types, actionTypeByNo, winnings, totalWinnings, positions):
"""calculates data for the HUD during import. IMPORTANT: if you change this method make sure to also change the following storage method and table_viewer.prepare_data if necessary"""
#setup subarrays of the result dictionary.
VPIP=[]
@ -1254,12 +1254,41 @@ def calculateHudImport(player_ids, category, action_types, actionTypeByNo, winni
foldSbToStealChance=[]
foldedSbToSteal=[]
firstPfRaise=-1
firstPfRaiseByNo=-1
firstPfRaiserId=-1
firstPfRaiserNo=-1
firstPfCallByNo=-1
firstPfCallerId=-1
for i in range(len(actionTypeByNo[0])):
if actionTypeByNo[0][i][1]=="bet":
firstPfRaise=i
firstPfRaiseByNo=i
firstPfRaiserId=actionTypeByNo[0][i][0]
for j in range(len(player_ids)):
if player_ids[j]==firstPfRaiserId:
firstPfRaiserNo=j
break
break
for i in range(len(actionTypeByNo[0])):
if actionTypeByNo[0][i][1]=="call":
firstPfCallByNo=i
firstPfCallerId=actionTypeByNo[0][i][0]
break
cutoffId=-1
buttonId=-1
sbId=-1
bbId=-1
for player in range(len(positions)):
if positions==1:
cutoffId=player_ids[player]
if positions==0:
buttonId=player_ids[player]
if positions=='S':
sbId=player_ids[player]
if positions=='B':
bbId=player_ids[player]
#run a loop for each player preparing the actual values that will be commited to SQL
for player in range (len(player_ids)):
#set default values
myVPIP=False
@ -1313,6 +1342,31 @@ def calculateHudImport(player_ids, category, action_types, actionTypeByNo, winni
if pfRaise>firstPfRaise:
myPF3B4B=True
#myStealAttemptChance myStealAttempted myFoldBbToStealChance myFoldedBbToSteal myFoldSbToStealChance myFoldedSbToSteal
#steal calculations
if len(player_ids)>=5: #no point otherwise
if positions[player]==1:
if firstPfRaiserId==player_ids[player]:
myStealAttemptChance=True
myStealAttempted=True
elif firstPfRaiserId==buttonId or firstPfRaiserId==sbId or firstPfRaiserId==bbId or firstPfRaiserId==-1:
myStealAttemptChance=True
if positions[player]==0:
if firstPfRaiserId==player_ids[player]:
myStealAttemptChance=True
myStealAttempted=True
elif firstPfRaiserId==sbId or firstPfRaiserId==bbId or firstPfRaiserId==-1:
myStealAttemptChance=True
if positions[player]==S:
if firstPfRaiserId==player_ids[player]:
myStealAttemptChance=True
myStealAttempted=True
elif firstPfRaiserId==bbId or firstPfRaiserId==-1:
myStealAttemptChance=True
if positions[player]==B:
pass
#calculate saw* values
if (len(action_types[1][player])>0):
mySawFlop=True

View File

@ -32,9 +32,9 @@ otherRaisedRiverFold: 1
wonWhenSeenFlop: 0.0
wonAtSD: 0.0
stealAttemptChance: not yet implemented
stealAttempted: not yet implemented
foldBbToStealChance: not yet implemented
foldedBbToSteal: not yet implemented
foldSbToStealChance: not yet implemented
foldedSbToSteal: not yet implemented
stealAttemptChance: 0
stealAttempted: 0
foldBbToStealChance: 0
foldedBbToSteal: 0
foldSbToStealChance: 0
foldedSbToSteal: 0

View File

@ -0,0 +1,62 @@
PokerStars Game #19546605871: Hold'em Limit ($0.25/$0.50) - 2008/08/11 - 20:15:41 (ET)
Table 'Pyxis' 10-max Seat #1 is the button
Seat 1: player10 ($7.75 in chips)
Seat 2: player1 ($11.55 in chips)
Seat 3: player2 ($8.25 in chips)
Seat 4: player3 ($0.90 in chips)
Seat 5: player4 ($10003.50 in chips)
Seat 6: player5 ($13.50 in chips)
Seat 7: player6 ($8 in chips)
Seat 8: player7 ($11.80 in chips)
Seat 9: player8 ($11.05 in chips)
Seat 10: player9 ($11.85 in chips)
player1: posts small blind $0.10
player1 said, "little holy water on the river lol"
player2: posts big blind $0.25
*** HOLE CARDS ***
Dealt to player6 [Ad Ts]
player3: calls $0.25
player4: folds
player5: raises $0.25 to $0.50
player6: calls $0.50
player7: folds
player8: folds
player9: folds
player10: folds
player1: folds
player2: folds
player3: raises $0.25 to $0.75
player5: calls $0.25
player6: calls $0.25
*** FLOP *** [Js 5d 4c]
player3: bets $0.15 and is all-in
player5: calls $0.15
player6: calls $0.15
*** TURN *** [Js 5d 4c] [4s]
player5: bets $0.50
player6: calls $0.50
*** RIVER *** [Js 5d 4c 4s] [6d]
player5: bets $0.50
player6: calls $0.50
*** SHOW DOWN ***
player5: shows [Qc Ac] (a pair of Fours)
player6: mucks hand
player5 collected $1.90 from side pot
player3: shows [9c 7c] (a pair of Fours - lower kicker)
player5 collected $2.95 from main pot
*** SUMMARY ***
Total pot $5.05 Main pot $2.95. Side pot $1.90. | Rake $0.20
Board [Js 5d 4c 4s 6d]
Seat 1: player10 (button) folded before Flop (didn't bet)
Seat 2: player1 (small blind) folded before Flop
Seat 3: player2 (big blind) folded before Flop
Seat 4: player3 showed [9c 7c] and lost with a pair of Fours
Seat 5: player4 folded before Flop (didn't bet)
Seat 6: player5 showed [Qc Ac] and won ($4.85) with a pair of Fours
Seat 7: player6 mucked [Ad Ts]
Seat 8: player7 folded before Flop (didn't bet)
Seat 9: player8 folded before Flop (didn't bet)
Seat 10: player9 folded before Flop (didn't bet)

View File

@ -0,0 +1,42 @@
PokerStars Game #19546637866: Hold'em Limit ($0.25/$0.50) - 2008/08/11 - 20:17:04 (ET)
Table 'Pyxis' 10-max Seat #2 is the button
Seat 1: player1 ($7.75 in chips)
Seat 2: player2 ($11.45 in chips)
Seat 5: player3 ($10003.50 in chips)
Seat 6: player4 ($16.45 in chips)
Seat 7: player5 ($6.10 in chips)
Seat 8: player6 ($11.80 in chips)
Seat 9: player7 ($11.05 in chips)
Seat 10: player8 ($11.85 in chips)
player9 leaves the table
player10: is sitting out
player10 leaves the table
player3: posts small blind $0.10
player4: posts big blind $0.25
*** HOLE CARDS ***
Dealt to player5 [Jh 5d]
Mac Fun K joins the table at seat #4
player5: folds
player6: folds
player7: folds
player8: folds
player1: raises $0.25 to $0.50
player2: folds
player3: folds
player4: folds
Uncalled bet ($0.25) returned to player1
player1 collected $0.60 from pot
player1: doesn't show hand
*** SUMMARY ***
Total pot $0.60 | Rake $0
Seat 1: player1 collected ($0.60)
Seat 2: player2 (button) folded before Flop (didn't bet)
Seat 5: player3 (small blind) folded before Flop
Seat 6: player4 (big blind) folded before Flop
Seat 7: player5 folded before Flop (didn't bet)
Seat 8: player6 folded before Flop (didn't bet)
Seat 9: player7 folded before Flop (didn't bet)
Seat 10: player8 folded before Flop (didn't bet)

View File

@ -18,8 +18,8 @@
echo "Please note for this to really work you need to work on an empty database"
rm *.found.txt
../pyfpdb/fpdb_import.py -p$1 --file=ps-holdem-ring-001to003.txt -x
../pyfpdb/fpdb_import.py -p$1 --file=ps-holdem-ring-001to003.txt -x
../pyfpdb/fpdb_import.py -p$1 --file=ps-lhe-ring-3hands.txt -x
../pyfpdb/fpdb_import.py -p$1 --file=ps-lhe-ring-3hands.txt -x
#../pyfpdb/fpdb_import.py -p$1 --file=ftp-stud-hilo-ring-001.txt -x
#../pyfpdb/fpdb_import.py -p$1 --file=ftp-omaha-hi-pl-ring-001-005.txt -x