Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Validation/RecoTrack/python/plotting/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def _formatPlotSets(self):

fileTable = []

sections = self._orderSets(self._plotSets.keys())
sections = self._orderSets(list(self._plotSets.keys()))
for isec, section in enumerate(sections):
leg = self._appendLegend(section)

Expand Down Expand Up @@ -489,7 +489,7 @@ def _allNone(row):
return False
return True

sections = self._orderSets(self._tables.keys())
sections = self._orderSets(list(self._tables.keys()))
for isec, section in enumerate(sections):
leg = self._appendLegend(section)

Expand Down Expand Up @@ -625,7 +625,7 @@ def write(self, baseDir):
#print "TrackingPageSet.write"
ret = []

keys = self._orderPages(self._pages.keys())
keys = self._orderPages(list(self._pages.keys()))
for key in keys:
page = self._pages[key]
if page.isEmpty():
Expand Down Expand Up @@ -815,7 +815,7 @@ def addTable(self, *args, **kwargs):

def write(self):
# Reorder sections such that Fast vs. Full becomes just after the corresponding Fast
keys = self._sections.iterkeys()
keys = self._sections.keys()
newkeys = []
for key in keys:
if not key[1]:
Expand Down
9 changes: 4 additions & 5 deletions Validation/RecoTrack/python/plotting/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ def create(self, tdirectory):
# the iteration timing plots), so let's test them all
for lab in labels:
if lab in values:
ivalue = values.keys().index(lab)
ivalue = list(values.keys()).index(lab)
break
binIndexOrder.append( (ivalue, i) )

Expand Down Expand Up @@ -1934,9 +1934,9 @@ def _modifyHisto(th1, profileX):
return th1

if self._fallback is not None:
self._histograms = map(_modifyHisto, self._histograms, profileX)
self._histograms = list(map(_modifyHisto, self._histograms, profileX))
else:
self._histograms = map(lambda h: _modifyHisto(h, self._profileX), self._histograms)
self._histograms =list(map(lambda h: _modifyHisto(h, self._profileX), self._histograms))
if requireAllHistograms and None in self._histograms:
self._histograms = [None]*len(self._histograms)

Expand Down Expand Up @@ -2737,8 +2737,7 @@ def __init__(self, name, possibleDqmFolders, dqmSubFolders, plotFolder, fallback
if sf_translated is not None and not sf_translated in subfolders:
subfolders[sf_translated] = DQMSubFolder(sf, sf_translated)

self._dqmSubFolders = subfolders.values()
self._dqmSubFolders.sort(key=lambda sf: sf.subfolder)
self._dqmSubFolders = sorted(subfolders.values(), key=lambda sf: sf.subfolder)

self._fallbackNames = fallbackNames
self._fallbackDqmSubFolders = fallbackDqmSubFolders
Expand Down
18 changes: 9 additions & 9 deletions Validation/RecoTrack/python/plotting/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys
import shutil
import subprocess
import urllib
import urllib.request

import ROOT
ROOT.gROOT.SetBatch(True)
Expand Down Expand Up @@ -720,7 +720,7 @@ def download(self):
"""Download DQM files. Requires grid certificate and asks your password for it."""
filenames = [s.filename(self._newRelease) for s in self._fullsimSamples+self._fastsimSamples]
if self._newFileModifier is not None:
filenames = map(self._newFileModifier, filenames)
filenames = list(map(self._newFileModifier, filenames))
filenames = [f for f in filenames if not os.path.exists(f)]
if len(filenames) == 0:
print("All files already downloaded")
Expand Down Expand Up @@ -987,7 +987,7 @@ def _doPlots(self, sample, harvestedFile, plotterFolder, dqmSubFolder, htmlRepor

# Move plots to new directory
print("Created plots and %s in %s" % (valname, newdir))
return map(lambda n: n.replace(newdir, newsubdir), fileList)
return list(map(lambda n: n.replace(newdir, newsubdir), fileList))

def _doPlotsFastFull(self, fastSample, fullSample, plotterFolder, dqmSubFolder, htmlReport):
"""Do the real plotting work for FastSim vs. FullSim for a given algorithm, quality flag, and sample."""
Expand Down Expand Up @@ -1053,7 +1053,7 @@ def _doPlotsFastFull(self, fastSample, fullSample, plotterFolder, dqmSubFolder,

# Move plots to new directory
print("Created plots in %s" % (newdir))
return map(lambda n: n.replace(newdir, newsubdir), fileList)
return list(map(lambda n: n.replace(newdir, newsubdir), fileList))

def _doPlotsPileup(self, pu140Sample, pu200Sample, plotterFolder, dqmSubFolder, htmlReport):
"""Do the real plotting work for two pileup scenarios for a given algorithm, quality flag, and sample."""
Expand Down Expand Up @@ -1120,7 +1120,7 @@ def _doPlotsPileup(self, pu140Sample, pu200Sample, plotterFolder, dqmSubFolder,

# Move plots to new directory
print("Created plots in %s" % (newdir))
return map(lambda n: n.replace(newdir, newsubdir), fileList)
return list(map(lambda n: n.replace(newdir, newsubdir), fileList))


def _copySubDir(oldfile, newfile, basenames, dirname):
Expand Down Expand Up @@ -1300,10 +1300,10 @@ def _doPlots(self, plotterFolder, dqmSubFolder):
downloadables = ["index.php", "res/jquery-ui.js", "res/jquery.js", "res/style.css", "res/style.js", "res/theme.css"]
for d in downloadables:
if not os.path.exists("%s/%s" % (newdir,d)):
urllib.urlretrieve("https://raw.githubusercontent.com/musella/php-plots/master/%s"%d, "%s/%s"%(newdir,d))
urllib.request.urlretrieve("https://raw.githubusercontent.com/musella/php-plots/master/%s"%d, "%s/%s"%(newdir,d))

print("Created plots in %s" % newdir)
return map(lambda n: n.replace(newdir, newsubdir), fileList)
return list(map(lambda n: n.replace(newdir, newsubdir), fileList))

class SeparateValidation:
#Similar to the SimpleValidation
Expand Down Expand Up @@ -1389,7 +1389,7 @@ def _doPlots(self, plotterFolder, dqmSubFolder):
downloadables = ["index.php", "res/jquery-ui.js", "res/jquery.js", "res/style.css", "res/style.js", "res/theme.css"]
for d in downloadables:
if not os.path.exists("%s/%s" % (link,d)):
urllib.urlretrieve("https://raw.githubusercontent.com/rovere/php-plots/master/%s"%d, "%s/%s"%(link,d))
urllib.request.urlretrieve("https://raw.githubusercontent.com/rovere/php-plots/master/%s"%d, "%s/%s"%(link,d))

print("Created separated plots in %s" % newdir)
return map(lambda n: n.replace(newdir, newsubdir), linkList)
return list(map(lambda n: n.replace(newdir, newsubdir), linkList))