]> git.donarmstrong.com Git - neurodebian.git/blobdiff - survey/makestats
Also for stats report which repo and which job number use our setup
[neurodebian.git] / survey / makestats
index 0959c3dc265805ae6e70a8982a686515b5fa7da8..c67a3ad72cca630a895c8eab704c6897ff551e20 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/python
+# emacs: -*- coding: utf-8; mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
 
 from glob import glob
 try:
@@ -14,6 +15,14 @@ import pylab as pl
 import numpy as np
 import time
 
+from common import entries_to_refresh
+fresh_keys = [k
+              for k, (regex, b) in
+                    reduce(list.__add__,[x.items()
+                                         for x in entries_to_refresh['sw_other_name'].values()],
+                           [])
+              if b]
+
 # uniform colors for OS results
 os_colors = ['#AA2029', '#D1942B', '#7FB142', '#69A7CE']
 os_order = ['linux', 'mac', 'win', 'otheros']
@@ -152,13 +161,18 @@ class DB(dict):
                 missing += 1
         return val, missing
 
-    def get_counts(self, key):
+    def get_counts(self, key, predef_keys=None):
         # return a dict with field values as keys and respective submission 
         # count as value
         vals = self.get_not_none(key)[0]
         uniq = np.unique(vals)
         counts = dict(zip(uniq, [vals.count(u) for u in uniq]))
-        return counts
+        if not predef_keys is None:
+            ret = dict(zip(predef_keys, [0] * len(predef_keys)))
+        else:
+            ret = {}
+        ret.update(counts)
+        return ret
 
     def select_match(self, key, values):
         # return a db with all submissions were a field id has one of the
@@ -196,11 +210,12 @@ class DB(dict):
                 resource_categories, time_categories,
                 DB.datamod_dict, DB.position_dict, DB.employer_dict,
                 DB.vm_dict, DB.ratings_dict]
+        suffix = u'$^†$' if id in fresh_keys else ''
         for src in srcs:
             if id in src:
-                return src[id]
+                return src[id] + suffix
         # not found, nothing nicer
-        return id
+        return id + suffix
 
 
 def mkpic_os_per_env(db, destdir):