Coverage for PokerStarsStructures.py: 0%
15 statements
« prev ^ index » next coverage.py v7.6.3, created at 2024-10-14 11:07 +0000
« prev ^ index » next coverage.py v7.6.3, created at 2024-10-14 11:07 +0000
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3#
4# Copyright 2010-2013, Chaz Littlejohn
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20########################################################################
23from datetime import datetime
24import pytz
27class PokerStarsStructures(object):
28 def __init__(self):
29 self.versions = [
30 pytz.utc.localize(datetime.strptime(d, "%Y/%m/%d %H:%M:%S"))
31 for d in ("2011/05/05 00:00:00", "2011/05/20 00:00:00")
32 ]
33 self.versions.append(datetime.utcnow().replace(tzinfo=pytz.utc))
34 self.SnG_Structures = []
35 self.SnG_Structures.append(
36 {
37 (150, 25, 9): "Turbo", # 7-10 handed, under 45 entrants
38 # Not unique (300, 40, 9): 'Turbo', #7-10 handed, under 45 entrants
39 (600, 50, 9): "Turbo", # 7-10 handed, under 45 entrants
40 (1500, 100, 9): "Turbo", # 7-10 handed, under 45 entrants
41 (2500, 200, 9): "Turbo", # 7-10 handed, under 45 entrants
42 (3500, 300, 9): "Turbo", # 7-10 handed, under 45 entrants
43 (5500, 500, 9): "Turbo", # 7-10 handed, under 45 entrants
44 (10492, 908, 9): "Turbo", # 7-10 handed, under 45 entrants
45 (21000, 1500, 9): "Turbo", # 7-10 handed, under 45 entrants
46 (32500, 2000, 9): "Turbo", # 7-10 handed, under 45 entrants
47 (52500, 3000, 9): "Turbo", # 7-10 handed, under 45 entrants
48 (105000, 5000, 9): "Turbo", # 7-10 handed, under 45 entrants
49 (210000, 9000, 9): "Turbo", # 7-10 handed, under 45 entrants
50 (100, 20, 9): "Normal", # 7-10 handed, under 45 entrants
51 (300, 40, 9): "Normal", # 7-10 handed, under 45 entrants #Not unique
52 (545, 55, 9): "Normal", # 7-10 handed, under 45 entrants
53 (1000, 100, 9): "Normal", # 7-10 handed, under 45 entrants
54 (2000, 200, 9): "Normal", # 7-10 handed, under 45 entrants
55 (3000, 300, 9): "Normal", # 7-10 handed, under 45 entrants
56 (5000, 500, 9): "Normal", # 7-10 handed, under 45 entrants
57 (10000, 900, 9): "Normal", # 7-10 handed, under 45 entrants
58 (20000, 1500, 9): "Normal", # 7-10 handed, under 45 entrants
59 (30000, 2000, 9): "Normal", # 7-10 handed, under 45 entrants
60 (50000, 3000, 9): "Normal", # 7-10 handed, under 45 entrants
61 (100000, 5000, 9): "Normal", # 7-10 handed, under 45 entrants
62 (200000, 9000, 9): "Normal", # 7-10 handed, under 45 entrants
63 (300, 25, 6): "Turbo", # 6-handed, Under 30 Entrants
64 # Not unique (600, 60, 6): 'Turbo', #6-handed, Under 30 Entrants
65 # Not unique (1200, 100, 6): 'Turbo', #6-handed, Under 30 Entrants
66 # Not unique (2300, 200, 6): 'Turbo', #6-handed, Under 30 Entrants
67 (3600, 300, 6): "Turbo", # 6-handed, Under 30 Entrants
68 (5500, 500, 6): "Turbo", # 6-handed, Under 30 Entrants
69 (7200, 600, 6): "Turbo", # 6-handed, Under 30 Entrants
70 (11000, 900, 6): "Turbo", # 6-handed, Under 30 Entrants
71 (22000, 1500, 6): "Turbo", # 6-handed, Under 30 Entrants
72 (53500, 3000, 6): "Turbo", # 6-handed, Under 30 Entrants
73 (106000, 5000, 6): "Turbo", # 6-handed, Under 30 Entrants
74 (100, 20, 6): "Normal", # 6-handed, Under 30 Entrants
75 (300, 40, 6): "Normal", # 6-handed, Under 30 Entrants
76 (600, 60, 6): "Normal", # 6-handed, Under 30 Entrants #Not unique
77 (1200, 100, 6): "Normal", # 6-handed, Under 30 Entrants #Not unique
78 (2300, 200, 6): "Normal", # 6-handed, Under 30 Entrants #Not unique
79 (3500, 300, 6): "Normal", # 6-handed, Under 30 Entrants
80 (5060, 440, 6): "Normal", # 6-handed, Under 30 Entrants
81 (7000, 600, 6): "Normal", # 6-handed, Under 30 Entrants
82 (11200, 900, 6): "Normal", # 6-handed, Under 30 Entrants
83 (30500, 2000, 6): "Normal", # 6-handed, Under 30 Entrants
84 (600, 25, 2): "Turbo", # Heads Up
85 (1100, 50, 2): "Turbo", # Heads Up
86 (2200, 100, 2): "Turbo", # Heads Up
87 (3300, 150, 2): "Turbo", # Heads Up
88 (5500, 250, 2): "Turbo", # Heads Up
89 (11000, 500, 2): "Turbo", # Heads Up
90 (22000, 1000, 2): "Turbo", # Heads Up
91 (33000, 1500, 2): "Turbo", # Heads Up
92 (55000, 2000, 2): "Turbo", # Heads Up
93 (110000, 3000, 2): "Turbo", # Heads Up
94 (220000, 5000, 2): "Turbo", # Heads Up
95 (550000, 10000, 2): "Turbo", # Heads Up
96 (200, 20, 2): "Normal", # Heads Up
97 (500, 25, 2): "Normal", # Heads Up
98 (1000, 50, 2): "Normal", # Heads Up
99 (2000, 100, 2): "Normal", # Heads Up
100 (3000, 150, 2): "Normal", # Heads Up
101 (5000, 250, 2): "Normal", # Heads Up
102 (10000, 500, 2): "Normal", # Heads Up
103 (20000, 1000, 2): "Normal", # Heads Up
104 (30000, 1500, 2): "Normal", # Heads Up
105 (50000, 2000, 2): "Normal", # Heads Up
106 (100000, 3000, 2): "Normal", # Heads Up
107 (200000, 5000, 2): "Normal", # Heads Up
108 (500000, 10000, 2): "Normal", # Heads Up
109 (50, 5, 45): "Turbo", # 45 Entrants
110 (100, 10, 45): "Turbo", # 45 Entrants
111 (300, 25, 45): "Turbo", # 45 Entrants
112 (600, 50, 45): "Turbo", # 45 Entrants
113 (1100, 100, 45): "Turbo", # 45 Entrants
114 (2500, 200, 45): "Turbo", # 45 Entrants
115 (3500, 300, 45): "Turbo", # 45 Entrants
116 (5500, 500, 45): "Turbo", # 45 Entrants
117 (10500, 900, 45): "Turbo", # 45 Entrants
118 (25, 0, 45): "Normal", # 45 Entrants
119 (100, 20, 45): "Normal", # 45 Entrants
120 (500, 50, 45): "Normal", # 45 Entrants
121 (1000, 100, 45): "Normal", # 45 Entrants
122 (2000, 200, 45): "Normal", # 45 Entrants
123 (50, 5, 90): "Turbo", # 90 Entrants
124 (100, 10, 90): "Turbo", # 90 Entrants
125 (300, 25, 90): "Turbo", # 90 Entrants
126 (600, 50, 90): "Turbo", # 90 Entrants
127 (1100, 100, 90): "Turbo", # 90 Entrants
128 (5500, 500, 90): "Turbo", # 90 Entrants
129 (100, 8, 10): "Turbo", # Fifty50
130 (500, 24, 10): "Turbo", # Fifty50
131 (1000, 48, 10): "Turbo", # Fifty50
132 (2000, 96, 10): "Turbo", # Fifty50
133 (3000, 144, 10): "Turbo", # Fifty50
134 (5000, 240, 10): "Turbo", # Fifty50
135 (10000, 430, 10): "Turbo", # Fifty50
136 (100, 11, 10): "Normal", # Fifty50
137 (500, 30, 10): "Normal", # Fifty50
138 (1000, 60, 10): "Normal", # Fifty50
139 (2000, 120, 10): "Normal", # Fifty50
140 (3000, 180, 10): "Normal", # Fifty50
141 (5000, 300, 10): "Normal", # Fifty50
142 (10000, 540, 10): "Normal", # Fifty50
143 (25, 0, 90): "Normal", # 90 Entrants
144 (200, 20, 90): "Normal", # 90 Entrants
145 (500, 50, 90): "Normal", # 90 Entrants
146 (800, 80, 90): "Normal", # 90 Entrants
147 (200, 20, 180): "Turbo", # 180 Entrants
148 (700, 70, 180): "Turbo", # 180 Entrants
149 (1100, 100, 180): "Turbo", # 180 Entrants
150 (3300, 300, 180): "Turbo", # 180 Entrants
151 (400, 40, 180): "Normal", # 180 Entrants
152 (1000, 100, 180): "Normal", # 180 Entrants
153 (2000, 200, 180): "Normal", # 180 Entrants
154 (125, 10, 27): "Normal", # 27 Player Knockout
155 (125, 15, 90): "Normal", # 90 Player Knockout
156 (625, 50, 90): "Normal", # 90 Player Knockout
157 (1250, 100, 90): "Normal", # 90 Player Knockout
158 (300, 30, 180): "Normal", # 180 Player Rebuy
159 }
160 )
161 self.SnG_Structures.append(
162 {
163 (100, 8, 9, 9): "Hyper", # 7-10 handed, under 45 entrants
164 (500, 23, 9, 9): "Hyper", # 7-10 handed, under 45 entrants
165 (500, 21, 6, 6): "Hyper", # 6-handed, Under 45 Entrants
166 (500, 11, 2, 2): "Hyper", # Heads Up
167 }
168 )
169 self.SnG_Structures.append(
170 {
171 (132, 18, 9): "Turbo", # 7-10 handed, under 45 entrants
172 (316, 34, 9): "Turbo", # 7-10 handed, under 45 entrants
173 (645, 55, 9): "Turbo", # 7-10 handed, under 45 entrants
174 (1389, 111, 9): "Turbo", # 7-10 handed, under 45 entrants
175 (2778, 222, 9): "Turbo", # 7-10 handed, under 45 entrants
176 (5556, 444, 9): "Turbo", # 7-10 handed, under 45 entrants
177 (9280, 720, 9): "Turbo", # 7-10 handed, under 45 entrants
178 (18780, 1220, 9): "Turbo", # 7-10 handed, under 45 entrants
179 (28300, 1700, 9): "Turbo", # 7-10 handed, under 45 entrants
180 (47400, 2600, 9): "Turbo", # 7-10 handed, under 45 entrants
181 (95700, 4300, 9): "Turbo", # 7-10 handed, under 45 entrants
182 (192300, 7700, 9): "Turbo", # 7-10 handed, under 45 entrants
183 (129, 21, 9): "Normal", # 7-10 handed, under 45 entrants
184 (311, 39, 9): "Normal", # 7-10 handed, under 45 entrants
185 (637, 63, 9): "Normal", # 7-10 handed, under 45 entrants
186 (1370, 130, 9): "Normal", # 7-10 handed, under 45 entrants
187 (2740, 260, 9): "Normal", # 7-10 handed, under 45 entrants
188 (5480, 520, 9): "Normal", # 7-10 handed, under 45 entrants
189 (9215, 785, 9): "Normal", # 7-10 handed, under 45 entrants
190 (18650, 1350, 9): "Normal", # 7-10 handed, under 45 entrants
191 (28100, 1900, 9): "Normal", # 7-10 handed, under 45 entrants
192 (47175, 2825, 9): "Normal", # 7-10 handed, under 45 entrants
193 (132, 18, 6): "Turbo", # 6-handed, Under 30 Entrants
194 (319, 31, 6): "Turbo", # 6-handed, Under 30 Entrants
195 (648, 52, 6): "Turbo", # 6-handed, Under 30 Entrants
196 (1392, 108, 6): "Turbo", # 6-handed, Under 30 Entrants
197 (2784, 216, 6): "Turbo", # 6-handed, Under 30 Entrants
198 (5568, 432, 6): "Turbo", # 6-handed, Under 30 Entrants
199 (9325, 675, 6): "Turbo", # 6-handed, Under 30 Entrants
200 (18820, 1180, 6): "Turbo", # 6-handed, Under 30 Entrants
201 (28370, 1630, 6): "Turbo", # 6-handed, Under 30 Entrants
202 (47500, 2500, 6): "Turbo", # 6-handed, Under 30 Entrants
203 (96000, 4000, 6): "Turbo", # 6-handed, Under 30 Entrants
204 (192800, 7200, 6): "Turbo", # 6-handed, Under 30 Entrants
205 (129, 21, 6): "Normal", # 6-handed, Under 30 Entrants
206 (313, 37, 6): "Normal", # 6-handed, Under 30 Entrants
207 (639, 61, 6): "Normal", # 6-handed, Under 30 Entrants
208 (1379, 121, 6): "Normal", # 6-handed, Under 30 Entrants
209 (2758, 242, 6): "Normal", # 6-handed, Under 30 Entrants
210 (5516, 484, 6): "Normal", # 6-handed, Under 30 Entrants
211 (9260, 740, 6): "Normal", # 6-handed, Under 30 Entrants
212 (18690, 1310, 6): "Normal", # 6-handed, Under 30 Entrants
213 (28170, 1830, 6): "Normal", # 6-handed, Under 30 Entrants
214 (47275, 2725, 6): "Normal", # 6-handed, Under 30 Entrants
215 (140, 10, 2): "Turbo", # Heads Up
216 (332, 18, 2): "Turbo", # Heads Up
217 (671, 29, 2): "Turbo", # Heads Up
218 (1439, 61, 2): "Turbo", # Heads Up
219 (2878, 122, 2): "Turbo", # Heads Up
220 (5767, 233, 2): "Turbo", # Heads Up
221 (9632, 368, 2): "Turbo", # Heads Up
222 (19385, 615, 2): "Turbo", # Heads Up
223 (29125, 875, 2): "Turbo", # Heads Up
224 (48760, 1240, 2): "Turbo", # Heads Up
225 (97920, 2080, 2): "Turbo", # Heads Up
226 (196250, 3750, 2): "Turbo", # Heads Up
227 (493700, 6300, 2): "Turbo", # Heads Up
228 (138, 12, 2): "Normal", # Heads Up
229 (329, 21, 2): "Normal", # Heads Up
230 (667, 33, 2): "Normal", # Heads Up
231 (1429, 71, 2): "Normal", # Heads Up
232 (2857, 143, 2): "Normal", # Heads Up
233 (5728, 272, 2): "Normal", # Heads Up
234 (9569, 431, 2): "Normal", # Heads Up
235 (19275, 725, 2): "Normal", # Heads Up
236 (28985, 1015, 2): "Normal", # Heads Up
237 (48540, 1460, 2): "Normal", # Heads Up
238 (97560, 2440, 2): "Normal", # Heads Up
239 (195600, 4400, 2): "Normal", # Heads Up
240 (492600, 7400, 2): "Normal", # Heads Up
241 (45, 5, 45): "Turbo", # 45 Entrants
242 (136, 14, 45): "Turbo", # 45 Entrants
243 (319, 31, 45): "Turbo", # 45 Entrants
244 (918, 82, 45): "Turbo", # 45 Entrants
245 (2765, 235, 45): "Turbo", # 45 Entrants
246 (136, 14, 48): "Turbo", # 48 Entrants
247 (136, 14, 36): "Turbo", # 36 Entrants
248 (23, 2, 45): "Normal", # 45 Entrants
249 (91, 9, 45): "Normal", # 45 Entrants
250 (546, 54, 45): "Normal", # 45 Entrants
251 (45, 5, 90): "Turbo", # 90 Entrants
252 (91, 9, 90): "Turbo", # 90 Entrants
253 (139, 11, 10): "Turbo", # Fifty50
254 (330, 20, 10): "Turbo", # Fifty50
255 (668, 32, 10): "Turbo", # Fifty50
256 (1431, 69, 10): "Turbo", # Fifty50
257 (2863, 137, 10): "Turbo", # Fifty50
258 (5725, 275, 10): "Turbo", # Fifty50
259 (9586, 414, 10): "Turbo", # Fifty50
260 (19305, 695, 10): "Turbo", # Fifty50
261 (29160, 840, 10): "Turbo", # Fifty50
262 (48720, 1280, 10): "Turbo", # Fifty50
263 (135, 15, 10): "Normal", # Fifty50
264 (326, 24, 10): "Normal", # Fifty50
265 (660, 40, 10): "Normal", # Fifty50
266 (1415, 85, 10): "Normal", # Fifty50
267 (2830, 170, 10): "Normal", # Fifty50
268 (5660, 340, 10): "Normal", # Fifty50
269 (9490, 510, 10): "Normal", # Fifty50
270 (19135, 865, 10): "Normal", # Fifty50
271 (23, 2, 90): "Normal", # 90 Entrants
272 (228, 22, 90): "Normal", # 90 Entrants
273 (228, 22, 180): "Turbo", # 180 Entrants
274 (734, 66, 180): "Turbo", # 180 Entrants
275 (1377, 123, 180): "Turbo", # 180 Entrants
276 (3213, 287, 180): "Turbo", # 180 Entrants
277 (410, 40, 180): "Normal", # 180 Entrants
278 (1005, 95, 180): "Normal", # 180 Entrants
279 (9, 1, 240): "Normal", # 240 Entrants
280 (9, 1, 360): "Turbo", # 360 Entrants
281 (45, 5, 360): "Turbo", # 360 Entrants
282 (135, 15, 90): "Normal", # 90 Player Knockout
283 (650, 50, 90): "Normal", # 90 Player Knockout
284 (319, 31, 180): "Normal", # 180 Player Rebuy
285 (139, 11, 9): "Hyper", # 7-10 handed, under 45 entrants
286 (331, 19, 9): "Hyper", # 7-10 handed, under 45 entrants
287 (670, 30, 9): "Hyper", # 7-10 handed, under 45 entrants
288 (1439, 61, 9): "Hyper", # 7-10 handed, under 45 entrants
289 (2877, 123, 9): "Hyper", # 7-10 handed, under 45 entrants
290 (5754, 246, 9): "Hyper", # 7-10 handed, under 45 entrants
291 (9632, 368, 9): "Hyper", # 7-10 handed, under 45 entrants
292 (19318, 682, 9): "Hyper", # 7-10 handed, under 45 entrants
293 (140, 10, 6): "Hyper", # 6-handed, Under 30 Entrants
294 (332, 18, 6): "Hyper", # 6-handed, Under 30 Entrants
295 (671, 29, 6): "Hyper", # 6-handed, Under 30 Entrants
296 (1441, 59, 6): "Hyper", # 6-handed, Under 30 Entrants
297 (2883, 117, 6): "Hyper", # 6-handed, Under 30 Entrants
298 (5766, 234, 6): "Hyper", # 6-handed, Under 30 Entrants
299 (9649, 351, 6): "Hyper", # 6-handed, Under 30 Entrants
300 (19352, 648, 6): "Hyper", # 6-handed, Under 30 Entrants
301 (29140, 860, 6): "Hyper", # 6-handed, Under 30 Entrants
302 (48752, 1248, 6): "Hyper", # 6-handed, Under 30 Entrants
303 (144, 6, 2): "Hyper", # Heads Up
304 (340, 10, 2): "Hyper", # Heads Up
305 (685, 15, 2): "Hyper", # Heads Up
306 (1469, 31, 2): "Hyper", # Heads Up
307 (2937, 63, 2): "Hyper", # Heads Up
308 (5874, 126, 2): "Hyper", # Heads Up
309 (9812, 188, 2): "Hyper", # Heads Up
310 (19666, 334, 2): "Hyper", # Heads Up
311 (29551, 449, 2): "Hyper", # Heads Up
312 (49335, 665, 2): "Hyper", # Heads Up
313 (98880, 1120, 2): "Hyper", # Heads Up
314 (91, 9, 180): "Hyper", # 180 Entrants
315 (2, 0, 990): "Hyper", # 990 Entrants
316 }
317 )
319 def lookupSnG(self, key, startTime):
320 for i in range(len(self.versions)):
321 if startTime < self.versions[i]:
322 struct = self.SnG_Structures[i].get(key)
323 return struct