Added some stupid error checking to the get_results utility function
Files that can't be loaded are now skipped with a warning; this is good
enough for this function, which hides a lot of the underlying details
anyway
@@ -108,4 +108,9 @@ def get_results(dataset, limit, count, distance, query_dataset = None):
query_dataset):
if m["query_dataset"] == query_dataset:
with gzip.open(fn, "r") as fp:
+ try:
yield json.load(fp)
+ except ValueError:
+ print """\
+warning: loading results file %s failed, skipping""" % fn
+ continue
