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 CHANGED
@@ -1 +1 @@
1
- 2.0.18
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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{pokerstats}
8
- s.version = "2.0.18"
8
+ s.version = "2.0.19"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andrew C. Greenberg"]
@@ -7,44 +7,54 @@ include Pokerstats
7
7
 
8
8
  TEST = [
9
9
  {"andy" => {
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
- :flop_cbet => true,
27
- :flop_2bet => true
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
- :is_blind_attack_opportunity => true,
31
- :is_blind_attack_opportunity_taken => false,
32
- :is_blind_defense_opportunity => true,
33
- :is_blind_defense_opportunity_taken => true,
34
- :is_cbet_opportunity => true,
35
- :is_cbet_opportunity_taken => false,
36
- :posted => 10,
37
- :paid => 20,
38
- :won => 30,
39
- :cards => nil,
40
- :preflop_passive => 10,
41
- :preflop_aggressive => 20,
42
- :postflop_passive => 30,
43
- :postflop_aggressive => 40,
44
- :is_pfr_opportunity => true,
45
- :is_pfr_opportunity_taken => false,
46
- :flop_cbet => false,
47
- :flop_2bet => false
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
- :flop_cbet => false,
68
- :flop_2bet => true
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
- :is_blind_attack_opportunity => true,
72
- :is_blind_attack_opportunity_taken => false,
73
- :is_blind_defense_opportunity => true,
74
- :is_blind_defense_opportunity_taken => true,
75
- :is_cbet_opportunity => false,
76
- :is_cbet_opportunity_taken => nil,
77
- :posted => 20,
78
- :paid => 30,
79
- :won => 40,
80
- :cards => nil,
81
- :preflop_passive => 20,
82
- :preflop_aggressive => 40,
83
- :postflop_passive => 60,
84
- :postflop_aggressive => 80,
85
- :is_pfr_opportunity => true,
86
- :is_pfr_opportunity_taken => false,
87
- :flop_cbet => nil,
88
- :flop_2bet => false
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
- :is_blind_attack_opportunity => false,
93
- :is_blind_attack_opportunity_taken => nil,
94
- :is_blind_defense_opportunity => true,
95
- :is_blind_defense_opportunity_taken => false,
96
- :is_cbet_opportunity => false,
97
- :is_cbet_opportunity_taken => nil,
98
- :posted => 3,
99
- :paid => 6,
100
- :won => 9,
101
- :cards => nil,
102
- :preflop_passive => 3,
103
- :preflop_aggressive => 6,
104
- :postflop_passive => 9,
105
- :postflop_aggressive => 12,
106
- :is_pfr_opportunity => true,
107
- :is_pfr_opportunity_taken => true,
108
- :flop_cbet => nil,
109
- :flop_2bet => true
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
- :is_blind_attack_opportunity => true,
113
- :is_blind_attack_opportunity_taken => true,
114
- :is_blind_defense_opportunity => true,
115
- :is_blind_defense_opportunity_taken => true,
116
- :is_cbet_opportunity => false,
117
- :is_cbet_opportunity_taken => nil,
118
- :posted => 30,
119
- :paid => 0,
120
- :won => 0,
121
- :cards => nil,
122
- :preflop_passive => 30,
123
- :preflop_aggressive => 60,
124
- :postflop_passive => 90,
125
- :postflop_aggressive => 120,
126
- :is_pfr_opportunity => true,
127
- :is_pfr_opportunity_taken => false,
128
- :flop_cbet => nil,
129
- :flop_2bet => false
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
- :t_flop_2bet_opportunity => 3,
154
- :t_flop_2bet_opportunity_taken => 3,
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
- :t_flop_2bet_opportunity => 3,
177
- :t_flop_2bet_opportunity_taken => 0,
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, [:t_flop_2bet, :t_flop_cbet]
281
+ should_correctly_aggregate @reports, [:t_preflop_3bet, :t_cbet_flop]
252
282
  end
253
283
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pokerstats
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.18
4
+ version: 2.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew C. Greenberg