Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added force no incremental option to goals

  • Loading branch information...
commit 807d32d2914dab51d64d39851562ef7dd6ad3d83 1 parent a6e779f
@rrenaud rrenaud authored
Showing with 13 additions and 7 deletions.
  1. +12 −6 goals.py
  2. +1 −1  utils.py
View
18 goals.py
@@ -1,11 +1,12 @@
#!/usr/bin/python
import pymongo
-import game
import card_info
import collections
-import name_merger
+import game
import incremental_scanner
+import name_merger
+import utils
# BOM: Bought only money and Victory.
# BOMMinator: Won buying only money and Victory.
@@ -169,14 +170,19 @@ def main():
checker_output[goal]
goal_check_funcs.append((goal, globals()[name]))
+ parser = utils.incremental_max_parser()
+ args = parser.parse_args()
+
+ scanner = incremental_scanner.IncrementalScanner('goals', c.test)
+ if not args.incremental:
+ scanner.reset()
+ output_collection.remove()
output_collection.ensure_index('attainers.player')
output_collection.ensure_index('goal')
- scanner = incremental_scanner.IncrementalScanner('goals', c.test)
+
print 'starting with id', scanner.get_max_game_id(), 'and num games', \
scanner.get_num_games()
- for idx, g in enumerate(scanner.scan(games_collection, {})):
- if idx % 1000 == 0:
- print idx
+ for g in utils.progress_meter(scanner.scan(games_collection, {})):
total_checked += 1
game_val = game.Game(g)
for goal_name, goal_checker in goal_check_funcs:
View
2  utils.py
@@ -82,7 +82,7 @@ def includes_day(args, str_yyyymmdd):
assert len(str_yyyymmdd) == 8, '%s not 8 chars' % str_yyyymmdd
return args.startdate <= str_yyyymmdd <= args.enddate
-def progress_meter(iterable, chunksize):
+def progress_meter(iterable, chunksize=1000):
""" Prints progress through iterable at chunksize intervals."""
scan_start = time.time()
since_last = time.time()
Please sign in to comment.
Something went wrong with that request. Please try again.