pokerstats 2.0.18 → 2.0.19
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/pokerstats/hand_history.rb +1 -1
- data/lib/pokerstats/player_statistics.rb +1 -1
- data/pokerstats.gemspec +1 -1
- data/spec/player_statistics_spec.rb +127 -97
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.19
|
@@ -29,7 +29,7 @@ module Pokerstats
|
|
29
29
|
begin
|
30
30
|
@parser.parse(each_line)
|
31
31
|
rescue => e
|
32
|
-
raise "#{@source}:#{position}: #{e.message}"
|
32
|
+
raise HandHistoryParseError, "#{@source}:#{position}: #{e.message}"
|
33
33
|
end
|
34
34
|
end
|
35
35
|
@stats.update_hand :session_filename => source, :starting_at => position
|
@@ -21,7 +21,7 @@ module Pokerstats
|
|
21
21
|
|
22
22
|
def aggregate_three_part_statistic each_player, reports, aggregate_stat, hand_stat
|
23
23
|
# puts "a3ps(#{each_player},reports,#{aggregate_stat.inspect},#{hand_stat.inspect}) where reports[][]=#{reports[each_player][hand_stat].inspect}" if each_player == "wizardwerdna"
|
24
|
-
raise "diddledoo#{hand_stat}" unless reports[each_player].keys.include?(hand_stat)
|
24
|
+
raise "diddledoo#{hand_stat}" + reports[each_player].to_yaml unless reports[each_player].keys.include?(hand_stat)
|
25
25
|
t_stat_opportunity = ((aggregate_stat.to_s) + "_opportunity").to_sym
|
26
26
|
t_stat_opportunity_taken = ((aggregate_stat.to_s) + "_opportunity_taken").to_sym
|
27
27
|
@aggregate_statistics[each_player][t_stat_opportunity] ||=0
|
data/pokerstats.gemspec
CHANGED
@@ -7,44 +7,54 @@ include Pokerstats
|
|
7
7
|
|
8
8
|
TEST = [
|
9
9
|
{"andy" => {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
10
|
+
:is_blind_attack_opportunity => false,
|
11
|
+
:is_blind_attack_opportunity_taken => nil,
|
12
|
+
:is_blind_defense_opportunity => false,
|
13
|
+
:is_blind_defense_opportunity_taken => nil,
|
14
|
+
:is_cbet_opportunity => true,
|
15
|
+
:is_cbet_opportunity_taken => true,
|
16
|
+
:posted => 1,
|
17
|
+
:paid => 2,
|
18
|
+
:won => 3,
|
19
|
+
:cards => nil,
|
20
|
+
:preflop_passive => 1,
|
21
|
+
:preflop_aggressive => 2,
|
22
|
+
:postflop_passive => 3,
|
23
|
+
:postflop_aggressive => 4,
|
24
|
+
:is_pfr_opportunity => true,
|
25
|
+
:is_pfr_opportunity_taken => true,
|
26
|
+
:cbet_flop => true,
|
27
|
+
:preflop_3bet => true,
|
28
|
+
:call_cbet_flop => true,
|
29
|
+
:fold_to_cbet_flop => true,
|
30
|
+
:preflop_3bet => true,
|
31
|
+
:call_preflop_3bet => true,
|
32
|
+
:fold_to_preflop_3bet => true
|
28
33
|
},
|
29
34
|
"judi" => {
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
35
|
+
:is_blind_attack_opportunity => true,
|
36
|
+
:is_blind_attack_opportunity_taken => false,
|
37
|
+
:is_blind_defense_opportunity => true,
|
38
|
+
:is_blind_defense_opportunity_taken => true,
|
39
|
+
:is_cbet_opportunity => true,
|
40
|
+
:is_cbet_opportunity_taken => false,
|
41
|
+
:posted => 10,
|
42
|
+
:paid => 20,
|
43
|
+
:won => 30,
|
44
|
+
:cards => nil,
|
45
|
+
:preflop_passive => 10,
|
46
|
+
:preflop_aggressive => 20,
|
47
|
+
:postflop_passive => 30,
|
48
|
+
:postflop_aggressive => 40,
|
49
|
+
:is_pfr_opportunity => true,
|
50
|
+
:is_pfr_opportunity_taken => false,
|
51
|
+
:cbet_flop => false,
|
52
|
+
:preflop_3bet => false,
|
53
|
+
:call_cbet_flop => true,
|
54
|
+
:fold_to_cbet_flop => true,
|
55
|
+
:preflop_3bet => true,
|
56
|
+
:call_preflop_3bet => true,
|
57
|
+
:fold_to_preflop_3bet => true
|
48
58
|
}
|
49
59
|
},
|
50
60
|
{"andy" => {
|
@@ -64,69 +74,89 @@ TEST = [
|
|
64
74
|
:postflop_aggressive => 8,
|
65
75
|
:is_pfr_opportunity => true,
|
66
76
|
:is_pfr_opportunity_taken => true,
|
67
|
-
:
|
68
|
-
:
|
77
|
+
:cbet_flop => false,
|
78
|
+
:preflop_3bet => true,
|
79
|
+
:call_cbet_flop => true,
|
80
|
+
:fold_to_cbet_flop => true,
|
81
|
+
:preflop_3bet => true,
|
82
|
+
:call_preflop_3bet => true,
|
83
|
+
:fold_to_preflop_3bet => true
|
69
84
|
},
|
70
85
|
"judi" => {
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
86
|
+
:is_blind_attack_opportunity => true,
|
87
|
+
:is_blind_attack_opportunity_taken => false,
|
88
|
+
:is_blind_defense_opportunity => true,
|
89
|
+
:is_blind_defense_opportunity_taken => true,
|
90
|
+
:is_cbet_opportunity => false,
|
91
|
+
:is_cbet_opportunity_taken => nil,
|
92
|
+
:posted => 20,
|
93
|
+
:paid => 30,
|
94
|
+
:won => 40,
|
95
|
+
:cards => nil,
|
96
|
+
:preflop_passive => 20,
|
97
|
+
:preflop_aggressive => 40,
|
98
|
+
:postflop_passive => 60,
|
99
|
+
:postflop_aggressive => 80,
|
100
|
+
:is_pfr_opportunity => true,
|
101
|
+
:is_pfr_opportunity_taken => false,
|
102
|
+
:cbet_flop => nil,
|
103
|
+
:preflop_3bet => false,
|
104
|
+
:call_cbet_flop => true,
|
105
|
+
:fold_to_cbet_flop => true,
|
106
|
+
:preflop_3bet => true,
|
107
|
+
:call_preflop_3bet => true,
|
108
|
+
:fold_to_preflop_3bet => true
|
89
109
|
}
|
90
110
|
},
|
91
111
|
{"andy" => {
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
112
|
+
:is_blind_attack_opportunity => false,
|
113
|
+
:is_blind_attack_opportunity_taken => nil,
|
114
|
+
:is_blind_defense_opportunity => true,
|
115
|
+
:is_blind_defense_opportunity_taken => false,
|
116
|
+
:is_cbet_opportunity => false,
|
117
|
+
:is_cbet_opportunity_taken => nil,
|
118
|
+
:posted => 3,
|
119
|
+
:paid => 6,
|
120
|
+
:won => 9,
|
121
|
+
:cards => nil,
|
122
|
+
:preflop_passive => 3,
|
123
|
+
:preflop_aggressive => 6,
|
124
|
+
:postflop_passive => 9,
|
125
|
+
:postflop_aggressive => 12,
|
126
|
+
:is_pfr_opportunity => true,
|
127
|
+
:is_pfr_opportunity_taken => true,
|
128
|
+
:cbet_flop => nil,
|
129
|
+
:preflop_3bet => true,
|
130
|
+
:call_cbet_flop => true,
|
131
|
+
:fold_to_cbet_flop => true,
|
132
|
+
:preflop_3bet => true,
|
133
|
+
:call_preflop_3bet => true,
|
134
|
+
:fold_to_preflop_3bet => true
|
110
135
|
},
|
111
136
|
"judi" => {
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
137
|
+
:is_blind_attack_opportunity => true,
|
138
|
+
:is_blind_attack_opportunity_taken => true,
|
139
|
+
:is_blind_defense_opportunity => true,
|
140
|
+
:is_blind_defense_opportunity_taken => true,
|
141
|
+
:is_cbet_opportunity => false,
|
142
|
+
:is_cbet_opportunity_taken => nil,
|
143
|
+
:posted => 30,
|
144
|
+
:paid => 0,
|
145
|
+
:won => 0,
|
146
|
+
:cards => nil,
|
147
|
+
:preflop_passive => 30,
|
148
|
+
:preflop_aggressive => 60,
|
149
|
+
:postflop_passive => 90,
|
150
|
+
:postflop_aggressive => 120,
|
151
|
+
:is_pfr_opportunity => true,
|
152
|
+
:is_pfr_opportunity_taken => false,
|
153
|
+
:cbet_flop => nil,
|
154
|
+
:preflop_3bet => false,
|
155
|
+
:call_cbet_flop => true,
|
156
|
+
:fold_to_cbet_flop => true,
|
157
|
+
:preflop_3bet => true,
|
158
|
+
:call_preflop_3bet => true,
|
159
|
+
:fold_to_preflop_3bet => true
|
130
160
|
}
|
131
161
|
}
|
132
162
|
]
|
@@ -150,8 +180,8 @@ PS_RESULT = {
|
|
150
180
|
:t_postflop_aggressive => 24,
|
151
181
|
:t_pfr_opportunity => 3,
|
152
182
|
:t_pfr_opportunity_taken => 3,
|
153
|
-
:
|
154
|
-
:
|
183
|
+
:t_preflop_3bet_opportunity => 3,
|
184
|
+
:t_preflop_3bet_opportunity_taken => 3,
|
155
185
|
:t_flop_cbet_opportunity => 2,
|
156
186
|
:t_flop_cbet_opportunity_taken => 1
|
157
187
|
},
|
@@ -173,8 +203,8 @@ PS_RESULT = {
|
|
173
203
|
:t_postflop_aggressive => 240,
|
174
204
|
:t_pfr_opportunity => 3,
|
175
205
|
:t_pfr_opportunity_taken => 0,
|
176
|
-
:
|
177
|
-
:
|
206
|
+
:t_preflop_3bet_opportunity => 3,
|
207
|
+
:t_preflop_3bet_opportunity_taken => 0,
|
178
208
|
:t_cbet_opportunity => 1,
|
179
209
|
:t_cbet_opportunity_taken => 0
|
180
210
|
}
|
@@ -248,6 +278,6 @@ describe PlayerStatistics, "when aggregating statistics" do
|
|
248
278
|
should_correctly_aggregate @reports, [:t_pfr_opportunity, :t_pfr_opportunity_taken]
|
249
279
|
end
|
250
280
|
it 'should correctly aggregate ternary statistics' do
|
251
|
-
should_correctly_aggregate @reports, [:
|
281
|
+
should_correctly_aggregate @reports, [:t_preflop_3bet, :t_cbet_flop]
|
252
282
|
end
|
253
283
|
end
|