source = None
display_run = 0
+global globalTicks
+globalTicks = None
def issequence(t):
return isinstance(t, types.TupleType) or isinstance(t, types.ListType)
return 1
class Statistic(object):
+
def __init__(self, data):
self.__dict__.update(data.__dict__)
if not self.__dict__.has_key('value'):
self.__dict__['bins'] = None
if not self.__dict__.has_key('ticks'):
self.__dict__['ticks'] = None
+ if 'vc' not in self.__dict__:
+ self.vc = {}
def __getattribute__(self, attr):
+ if attr == 'ticks':
+ if self.__dict__['ticks'] != globalTicks:
+ self.__dict__['value'] = None
+ self.__dict__['ticks'] = globalTicks
+ return self.__dict__['ticks']
if attr == 'value':
+ if self.__dict__['ticks'] != globalTicks:
+ if self.__dict__['ticks'] != None and \
+ len(self.__dict__['ticks']) == 1:
+ self.vc[self.__dict__['ticks'][0]] = self.__dict__['value']
+ self.__dict__['ticks'] = globalTicks
+ if len(globalTicks) == 1 and self.vc.has_key(globalTicks[0]):
+ self.__dict__['value'] = self.vc[globalTicks[0]]
+ else:
+ self.__dict__['value'] = None
if self.__dict__['value'] == None:
self.__dict__['value'] = self.getValue()
return self.__dict__['value']
if attr == 'bins':
if value is not None:
value = source.getBin(value)
- elif attr == 'ticks' and type(value) is str:
- value = [ int(x) for x in value.split() ]
+ #elif attr == 'ticks' and type(value) is str:
+ # value = [ int(x) for x in value.split() ]
self.__dict__[attr] = value
self.__dict__['value'] = None
+ self.vc = {}
else:
super(Statistic, self).__setattr__(attr, value)
from __future__ import division
import re, sys, math
+
def usage():
print '''\
Usage: %s [-E] [-F] [-d <db> ] [-g <get> ] [-h <host>] [-p]
for stat in stats:
print "%s:" % stat.name
- print "%-30s %12s %12s %4s %5s %5s %5s" % \
- ("run name", "average", "stdev", ">10%", ">1SDV", ">2SDV", "SAMP")
- print "%-30s %12s %12s %4s %5s %5s %5s" % \
- ("------------------------------", "------------",
- "------------", "----", "-----", "-----", "-----")
+ print "%-20s %12s %12s %4s %5s %5s %5s %6s" % \
+ ("run name", "average", "stdev", ">10%", ">1SDV", ">2SDV", "SAMP", "CV")
+ print "%-20s %12s %12s %4s %5s %5s %5s %6s" % \
+ ("--------------------", "------------",
+ "------------", "----", "-----", "-----", "-----", "------")
#loop through all the selected runs
for run in runs:
info.display_run = run.run;
runTicks = info.source.retTicks([ run ])
#throw away the first one, it's 0
runTicks.pop(0)
- stat.ticks = runTicks
+ info.globalTicks = runTicks
avg = float(stat)
stdev = 0
numoutsideavg = 0
#loop through all the various ticks for each run
for tick in runTicks:
- stat.ticks = str(tick)
+ #stat.ticks = str(tick)
+ info.globalTicks = [ tick ]
val = float(stat)
if (val < (avg * .9)) or (val > (avg * 1.1)):
numoutsideavg += 1
stdev = math.sqrt(stdev / len(runTicks))
for tick in runTicks:
- stat.ticks = str(tick)
+ info.globalTicks = [ tick ]
val = float(stat)
if (val < (avg - stdev)) or (val > (avg + stdev)):
numoutside1std += 1
if (val < (avg - (2*stdev))) or (val > (avg + (2*stdev))):
numoutside2std += 1
- print "%-30s %12s %12s %4s %5s %5s %5s" % \
+ print "%-20s %12s %12s %4s %5s %5s %5s %6s" % \
(run.name, "%.1f" % avg, "%.1f" % stdev,
"%d" % numoutsideavg, "%d" % numoutside1std,
- "%d" % numoutside2std, "%d" % len(runTicks))
+ "%d" % numoutside2std, "%d" % len(runTicks),
+ "%.1f" % (stdev/avg*100))
return
else:
if options.ticks:
print 'only displaying sample %s' % options.ticks
- stat.ticks = options.ticks
+ info.globalTicks = [ int(x) for x in options.ticks.split() ]
if options.binned:
print 'kernel ticks'