self.printdata(printmode=printmode)
def graph(self, graphdir):
- from os.path import expanduser, join as joinpath
+ from os.path import expanduser, isdir, join as joinpath
from barchart import BarChart
- from matplotlib.numerix import Float, zeros
- import re
+ from matplotlib.numerix import Float, array, zeros
+ import os, re
confgroups = self.jobfile.groups()
ngroups = len(confgroups)
raise AttributeError, 'No group selected for graph bars'
directory = expanduser(graphdir)
+ if not isdir(directory):
+ os.mkdir(directory)
html = file(joinpath(directory, '%s.html' % self.name), 'w')
print >>html, '<html>'
print >>html, '<title>Graphs for %s</title>' % self.name
for g,gopt in enumerate(groupopts):
for b,bopt in enumerate(baropts):
job = self.jobfile.job(options + [ gopt, bopt ])
+ if not job:
+ continue
val = self.info.get(job, self.stat)
if val is None:
data[g][b] = val
+ data = array(data)
+ if data.sum() == 0:
+ continue
+
bar_descs = [ opt.desc for opt in baropts ]
group_descs = [ opt.desc for opt in groupopts ]
if stacked: