Blame view

print_scores.py 730 Bytes
b6d0165d1   Killian   Initial commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  import sys
  import glob
  import shelve
  import numpy as np
  scores_ordoned={}
  files= glob.glob(sys.argv[1]+"/**.bak")
  files.sort()
  for j,i in enumerate(files):
          #if "MINIAE" not in i :
               #   continue
      scores={}
      fname= i.split("/")[-1][:-11]
      data=shelve.open(i[:-4])
  #    print i[:-4]
      for key,table in data.iteritems():
          scores[key]=round(table[1][np.argmax([x[0] for x in table[0]])][0],3)
      keys = scores.keys()
      keys.sort()
      scores_to_print=[fname]
      for key in keys:
          scores_to_print.append(" ".join([key,str(round(scores[key],4))]))
     # if len(scores_to_print) < 4  :
          #       print keys,scores_to_print,data.keys()
      print ";".join(scores_to_print)
  data.close()