From d28bdf7c6005d6cf59109ef0efd150a60efd5b38 Mon Sep 17 00:00:00 2001 From: sqlcoder Date: Tue, 28 Apr 2009 22:47:05 +0100 Subject: [PATCH] added a few more stats with no decimal places --- pyfpdb/Stats.py | 83 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/pyfpdb/Stats.py b/pyfpdb/Stats.py index 368552bc..42cd503e 100644 --- a/pyfpdb/Stats.py +++ b/pyfpdb/Stats.py @@ -184,6 +184,27 @@ def wtsd(stat_dict, player): '% went to showdown' ) +def wtsd_0(stat_dict, player): + """ Went to SD when saw flop/4th.""" + stat = 0.0 + try: + stat = float(stat_dict[player]['sd'])/float(stat_dict[player]['saw_f']) + return (stat, + '%2.0f' % (100*stat) + '%', + 'w=%2.0f' % (100*stat) + '%', + 'wtsd=%2.0f' % (100*stat) + '%', + '(%d/%d)' % (stat_dict[player]['sd'], stat_dict[player]['saw_f']), + '% went to showdown' + ) + except: + return (stat, + '%2.0f' % (0) + '%', + 'w=%2.0f' % (0) + '%', + 'wtsd=%2.0f' % (0) + '%', + '(%d/%d)' % (0, 0), + '% went to showdown' + ) + def wmsd(stat_dict, player): """ Won $ at showdown.""" stat = 0.0 @@ -205,6 +226,27 @@ def wmsd(stat_dict, player): '% won money at showdown' ) +def wmsd_0(stat_dict, player): + """ Won $ at showdown.""" + stat = 0.0 + try: + stat = float(stat_dict[player]['wmsd'])/float(stat_dict[player]['sd']) + return (stat, + '%2.0f' % (100*stat) + '%', + 'w=%2.0f' % (100*stat) + '%', + 'wmsd=%2.0f' % (100*stat) + '%', + '(%5.1f/%d)' % (float(stat_dict[player]['wmsd']), stat_dict[player]['sd']), + '% won money at showdown' + ) + except: + return (stat, + '%2.0f' % (0) + '%', + 'w=%2.0f' % (0) + '%', + 'wmsd=%2.0f' % (0) + '%', + '(%d/%d)' % (0, 0), + '% won money at showdown' + ) + def profit100_0(stat_dict, player): """ Profit won per 100 hands (no decimal places).""" stat = 0.0 @@ -306,6 +348,27 @@ def steal(stat_dict, player): ) except: return (stat, 'NA', 'st=NA', 'steal=NA', '(0/0)', '% steal attempted') + +def steal_0(stat_dict, player): + """ Steal %.""" + stat = 0.0 + try: + stat = float(stat_dict[player]['steal'])/float(stat_dict[player]['steal_opp']) + return (stat, + '%2.0f' % (100*stat) + '%', + 'st=%2.0f' % (100*stat) + '%', + 'steal=%2.0f' % (100*stat) + '%', + '(%d/%d)' % (stat_dict[player]['steal'], stat_dict[player]['steal_opp']), + '% steal attempted' + ) + except: + return (stat, + '%2.0f' % (0) + '%', + 'st=%2.0f' % (0) + '%', + 'steal=%2.0f' % (0) + '%', + '(%d/%d)' % (0, 0), + '% steal attempted' + ) def f_SB_steal(stat_dict, player): """ Folded SB to steal.""" @@ -347,6 +410,26 @@ def f_BB_steal(stat_dict, player): '(0/0)', '% folded BB to steal') +def f_BB_steal_0(stat_dict, player): + """ Folded BB to steal.""" + stat = 0.0 + try: + stat = float(stat_dict[player]['bbnotdef'])/float(stat_dict[player]['bbstolen']) + return (stat, + '%2.0f' % (100*stat) + '%', + 'fBB=%2.0f' % (100*stat) + '%', + 'fBB_s=%2.0f' % (100*stat) + '%', + '(%d/%d)' % (stat_dict[player]['bbnotdef'], stat_dict[player]['bbstolen']), + '% folded BB to steal' + ) + except: + return (stat, + 'NA', + 'fBB=NA', + 'fBB_s=NA', + '(0/0)', + '% folded BB to steal') + def three_B_0(stat_dict, player): """ Three bet preflop/3rd.""" stat = 0.0