Commit bc49fafa authored by Marco Clemencic's avatar Marco Clemencic
Browse files

fixed Python formatting (updated autopep8)

parent be076672
......@@ -103,17 +103,25 @@ rhisto1.Print()
rhisto2.Print()
# get some "extra infomration"
print ' Histo1 : mean /err: %10f +- %10f ' % (histo1.mean(), histo1.meanErr())
print ' Histo1 : rms /err: %10f +- %10f ' % (histo1.rms(), histo1.rmsErr())
print ' Histo1 : skewness/err: %10f +- %10f ' % (histo1.skewness(), histo1.skewnessErr())
print ' Histo1 : kurtosis/err: %10f +- %10f ' % (histo1.kurtosis(), histo1.kurtosisErr())
print ' Histo1 : mean /err: %10f +- %10f ' % (
histo1.mean(), histo1.meanErr())
print ' Histo1 : rms /err: %10f +- %10f ' % (
histo1.rms(), histo1.rmsErr())
print ' Histo1 : skewness/err: %10f +- %10f ' % (
histo1.skewness(), histo1.skewnessErr())
print ' Histo1 : kurtosis/err: %10f +- %10f ' % (
histo1.kurtosis(), histo1.kurtosisErr())
print ' Histo1 : path in THS : "%s"' % histo1.path()
print ' Histo2 : mean /err: %10f +- %10f ' % (histo2.mean(), histo2.meanErr())
print ' Histo2 : rms /err: %10f +- %10f ' % (histo2.rms(), histo2.rmsErr())
print ' Histo2 : skewness/err: %10f +- %10f ' % (histo2.skewness(), histo2.skewnessErr())
print ' Histo2 : kurtosis/err: %10f +- %10f ' % (histo2.kurtosis(), histo2.kurtosisErr())
print ' Histo2 : mean /err: %10f +- %10f ' % (
histo2.mean(), histo2.meanErr())
print ' Histo2 : rms /err: %10f +- %10f ' % (
histo2.rms(), histo2.rmsErr())
print ' Histo2 : skewness/err: %10f +- %10f ' % (
histo2.skewness(), histo2.skewnessErr())
print ' Histo2 : kurtosis/err: %10f +- %10f ' % (
histo2.kurtosis(), histo2.kurtosisErr())
print ' Histo2 : path in THS : "%s"' % histo2.path()
......
......@@ -119,7 +119,8 @@ if len(sys.argv) > 1:
for neif in neif_l:
print "Events in flight: %s" % neif
for tn in nts:
print "%s %s %s" % (tn, xtractTiming(neif, tn, False), xtractTiming(neif, tn, True))
print "%s %s %s" % (tn, xtractTiming(
neif, tn, False), xtractTiming(neif, tn, True))
len_nt = len(nts) + 1
......
......@@ -29,4 +29,5 @@ if __name__ == "__main__":
config = prepareConfig("../options/BrunelScenario.py", n_threads=n_threads,
n_parallel_events=n_events, n_parallel_algorithms=n_algos)
# config.replace(".py",".log"))
print "/usr/bin/time -f %%S -o %s.time `alias gaudirun` %s > %s" % (config.replace(".py", ""), config, "/dev/null")
print "/usr/bin/time -f %%S -o %s.time `alias gaudirun` %s > %s" % (
config.replace(".py", ""), config, "/dev/null")
......@@ -66,7 +66,8 @@ class RealTimeValue(object):
time = float(self.timings[capAlgoName])
else:
time = self.defaultTime
print "WARNING: TimiNg for %s (or %s) not found in the provided library, using default one: %s" % (algoName, capAlgoName, time)
print "WARNING: TimiNg for %s (or %s) not found in the provided library, using default one: %s" % (
algoName, capAlgoName, time)
time = time * self.factor
......@@ -161,20 +162,25 @@ class CruncherSequence(object):
import pprint
print "\n===== Statistics on Algorithms ====="
print "Total number of algorithm nodes: ", len(self.unique_algos) + sum([self.dupl_algos[i] - 1 for i in self.dupl_algos])
print "Total number of algorithm nodes: ", len(
self.unique_algos) + sum([self.dupl_algos[i] - 1 for i in self.dupl_algos])
print "Number of unique algorithms: ", len(self.unique_algos)
print " -->", len(self.dupl_algos), "of them being re-used with the following distribution: ", [self.dupl_algos[i] for i in self.dupl_algos]
print " -->", len(self.dupl_algos), "of them being re-used with the following distribution: ", [
self.dupl_algos[i] for i in self.dupl_algos]
# pprint.pprint(dupl_algos)
print "\n===== Statistics on Sequencers ====="
print "Total number of sequencers: ", len(self.unique_sequencers) + sum([self.dupl_seqs[i] - 1 for i in self.dupl_seqs])
print "Total number of sequencers: ", len(
self.unique_sequencers) + sum([self.dupl_seqs[i] - 1 for i in self.dupl_seqs])
print "Number of unique sequencers: ", len(self.unique_sequencers)
print " -->", len(self.dupl_seqs), "of them being re-used with the following distribution: ", [self.dupl_seqs[i] for i in self.dupl_seqs]
print " -->", len(self.dupl_seqs), "of them being re-used with the following distribution: ", [
self.dupl_seqs[i] for i in self.dupl_seqs]
# pprint.pprint(dupl_seqs)
print "Number of OR-sequencers: ", len(self.OR_sequencers)
print "\n===== Statistics on DataObjects ====="
print "Number of unique DataObjects: ", len(self.unique_data_objects)
print "Number of unique DataObjects: ", len(
self.unique_data_objects)
# pprint.pprint(self.unique_data_objects)
print
......
......@@ -33,7 +33,8 @@ if __name__ == "__main__":
if name not in cfgDb:
print "Component %s not found." % (name)
sys.exit()
print "\nDumping component information for %s:\n%s" % (name, (35 + len(name)) * "=")
print "\nDumping component information for %s:\n%s" % (
name, (35 + len(name)) * "=")
print " Library: %s" % (cfgDb[name]["lib"])
print " Package: %s" % (cfgDb[name]["package"])
print "\nProperties:\n%s" % (11 * "-")
......
......@@ -192,7 +192,8 @@ class WorkManager(object):
print 'Job execution statistics:'
print 'job count | % of all jobs | job time sum | time per job | job server'
for name, stat in self.stats.items():
print ' %d | %6.2f | %8.3f | %8.3f | %s' % (stat.njob, 100. * stat.njob / njobs, stat.time, stat.time / stat.njob, name)
print ' %d | %6.2f | %8.3f | %8.3f | %s' % (
stat.njob, 100. * stat.njob / njobs, stat.time, stat.time / stat.njob, name)
def _mergeStatistics(self, stat):
if stat.name not in self.stats:
......
......@@ -310,13 +310,15 @@ def CheckFileRecords(par, ser):
diff2 = set(parFSR["EventCountFSR"].iteritems()) - \
set(serFSR["EventCountFSR"].iteritems())
print "\nDifferent entries in TimeSpanFSR: \t" + str(len(diff1)) + "\nDifferent entries in EventCountFSR:\t" + str(len(diff2))
print "\nDifferent entries in TimeSpanFSR: \t" + \
str(len(diff1)) + "\nDifferent entries in EventCountFSR:\t" + str(len(diff2))
for k in ["LumiFSRBeamCrossing", "LumiFSRBeam2", "LumiFSRNoBeam"]:
diff3 = set(parFSR[k]["key"]) - set(serFSR[k]["key"])
diff4 = set(parFSR[k]["incr"]) - set(serFSR[k]["incr"])
diff5 = set(parFSR[k]["integral"]) - set(serFSR[k]["integral"])
print "Different entries in " + str(k) + ": \tkey: " + str(len(diff3)) + " increment: " + str(len(diff4)) + " integral: " + str(len(diff5))
print "Different entries in " + str(k) + ": \tkey: " + str(
len(diff3)) + " increment: " + str(len(diff4)) + " integral: " + str(len(diff5))
def LumiFSR(lumi):
......@@ -414,13 +416,15 @@ def CompareFSR(pout, sout):
diff2 = set(parFSR["EventCountFSR"].iteritems()) - \
set(serFSR["EventCountFSR"].iteritems())
print "\nDifferent entries in TimeSpanFSR: \t" + str(len(diff1)) + "\nDifferent entries in EventCountFSR:\t" + str(len(diff2))
print "\nDifferent entries in TimeSpanFSR: \t" + \
str(len(diff1)) + "\nDifferent entries in EventCountFSR:\t" + str(len(diff2))
for k in ["LumiFSRBeamCrossing", "LumiFSRBeam2", "LumiFSRNoBeam"]:
diff3 = set(parFSR[k]['key']) - set(serFSR[k]['key'])
diff4 = set(parFSR[k]['incr']) - set(serFSR[k]['incr'])
diff5 = set(parFSR[k]['integral']) - set(serFSR[k]["integral"])
print "Different entries in " + str(k) + ": \tkey: " + str(len(diff3)) + " increment: " + str(len(diff4)) + " integral: " + str(len(diff5))
print "Different entries in " + str(k) + ": \tkey: " + str(
len(diff3)) + " increment: " + str(len(diff4)) + " integral: " + str(len(diff5))
print "\nParallel: \n" + str(parFSR)
print "\nSerial: \n" + str(serFSR)
......
......@@ -103,8 +103,10 @@ def comparePaths(t1, t2):
print '\n' + '=' * 80
print 'Comparison of Paths : Reference vs Test ROOT files'
print '-' * 80
print 'Number of paths in Reference file : %i (objects, histos) = ( %i, %i )' % (len(dsks), os, hs)
print 'Number of paths in Test file : %i (objects, histos) = ( %i, %i )' % (len(dpks), op, hp)
print 'Number of paths in Reference file : %i (objects, histos) = ( %i, %i )' % (
len(dsks), os, hs)
print 'Number of paths in Test file : %i (objects, histos) = ( %i, %i )' % (
len(dpks), op, hp)
matching = sset.intersection(pset)
matchingHistos = 0
for n in matching:
......@@ -117,7 +119,8 @@ def comparePaths(t1, t2):
for n in uSer:
if ds[n].__class__.__name__ in histos:
uniqueReferenceHistos += 1
print 'Paths unique to Reference file : %i ( %i Histos )' % (len(uSer), uniqueReferenceHistos)
print 'Paths unique to Reference file : %i ( %i Histos )' % (
len(uSer), uniqueReferenceHistos)
if uSer:
for n in uSer:
print '\t%s : \t%s' % (ds[n], n)
......@@ -126,7 +129,8 @@ def comparePaths(t1, t2):
for n in uPar:
if dp[n].__class__.__name__ in histos:
uniqueTestHistos += 1
print 'Paths unique to Test file : %i ( %i Histos )' % (len(uPar), uniqueTestHistos)
print 'Paths unique to Test file : %i ( %i Histos )' % (
len(uPar), uniqueTestHistos)
if uPar:
for n in uPar:
print '\t%s : \t%s' % (dp[n], n)
......@@ -295,7 +299,8 @@ def compareHistos(t1, t2, state, checkBin2BinIdentity):
if diffEntries:
diffEntries.sort()
for e in diffEntries:
print '\t\t\t%s:\t%i != %i' % (e, int(ds[e].GetEntries()), int(dp[e].GetEntries()))
print '\t\t\t%s:\t%i != %i' % (
e, int(ds[e].GetEntries()), int(dp[e].GetEntries()))
print '-' * 80
# report on Failed Kolmogorov Tests
......@@ -306,7 +311,8 @@ def compareHistos(t1, t2, state, checkBin2BinIdentity):
diffKols.sort()
for e in diffKols:
result = kTestResults[e] # DP Calculated twice ARGH!!
print '%s\t\t%s :\tK-Test Result :\t %5.16f' % (ds[e].ClassName(), e, result)
print '%s\t\t%s :\tK-Test Result :\t %5.16f' % (
ds[e].ClassName(), e, result)
print '-' * 60
# report on Failed Integral Checks
......@@ -318,7 +324,8 @@ def compareHistos(t1, t2, state, checkBin2BinIdentity):
for e in diffIntegrals:
diff = dp[e].Integral() - ds[e].Integral()
pc = (diff * 100) / ds[e].Integral()
print '%s\t\t%s:\t Diff = %5.6f\tPercent Diff to Reference : %5.6f ' % (ds[e].ClassName(), e, diff, pc)
print '%s\t\t%s:\t Diff = %5.6f\tPercent Diff to Reference : %5.6f ' % (
ds[e].ClassName(), e, diff, pc)
print '-' * 60 + '\n'
print '=' * 80 + '\n'
......@@ -331,23 +338,30 @@ def compareHistos(t1, t2, state, checkBin2BinIdentity):
if diffIdentity:
diffIdentity.sort()
for e in diffIdentity:
print '%s\t\t%s: %i different bins' % (ds[e].ClassName(), e, identityDiffBins[e])
print '%s\t\t%s: %i different bins' % (
ds[e].ClassName(), e, identityDiffBins[e])
print '-' * 80
print '\n' + '=' * 80
print 'Comparison : Reference/Test ROOT Histo files'
print '\n\t\tReference\tTest'
print '\tObjects : %i\t%i\t\t( p-s = %i )' % (referenceObjects, parallObjects, parallObjects - referenceObjects)
print '\tHistos : %i\t%i\t\t( p-s = %i )' % (referenceHistos, parallHistos, parallHistos - referenceHistos)
print '\tObjects : %i\t%i\t\t( p-s = %i )' % (referenceObjects,
parallObjects, parallObjects - referenceObjects)
print '\tHistos : %i\t%i\t\t( p-s = %i )' % (referenceHistos,
parallHistos, parallHistos - referenceHistos)
print '\t __________'
print '\tTotal : %i\t%i\n' % (referenceHistos + referenceObjects, parallHistos + parallObjects)
print 'Objects/Histos unique to Reference File : %i / %i' % (len(uniqueSerPaths) - uniqueSerHistos, uniqueSerHistos)
print 'Objects/Histos unique to Test File : %i / %i' % (len(uniqueParPaths) - uniqueParHistos, uniqueParHistos)
print '\tTotal : %i\t%i\n' % (
referenceHistos + referenceObjects, parallHistos + parallObjects)
print 'Objects/Histos unique to Reference File : %i / %i' % (
len(uniqueSerPaths) - uniqueSerHistos, uniqueSerHistos)
print 'Objects/Histos unique to Test File : %i / %i' % (
len(uniqueParPaths) - uniqueParHistos, uniqueParHistos)
print '\nMatching Histograms valid for Comparison : %i' % (mh)
print '\nOmissions\' patterns : '
for entry in gRegexBlackList:
print '\t%s' % (entry)
print '\nHistograms for Comparison (after Omissions) : %i' % (mh - len(gRegexBlackList))
print '\nHistograms for Comparison (after Omissions) : %i' % (
mh - len(gRegexBlackList))
print '\n\tHISTOGRAM TESTS : '
print '\t\tKOLMOGOROV TEST : %i' % (kTested)
print '\t\tINTEGRAL TEST : %i' % (otherTest)
......
......@@ -608,7 +608,8 @@ def main():
print " No file found \n"
exit()
print "Converting *Test.xml files from %s to HTML format in %s" % (options.inputDirectory, options.outputDirectory)
print "Converting *Test.xml files from %s to HTML format in %s" % (
options.inputDirectory, options.outputDirectory)
# verify or create the output directory
output = options.outputDirectory
if not os.path.isdir(output):
......
......@@ -9,7 +9,8 @@ import sys
def usage():
print "Invalid arguments\nProper syntax is :\n %s <log file> <callgrind file>" % sys.argv[0]
print "Invalid arguments\nProper syntax is :\n %s <log file> <callgrind file>" % sys.argv[
0]
if len(sys.argv) != 3:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment