Skip to content

Commit

Permalink
Update python code to latest standards?
Browse files Browse the repository at this point in the history
  • Loading branch information
ericvaandering committed Jul 10, 2017
1 parent 299f96d commit 2696152
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,15 +298,15 @@ def _request_dataset_information(self):
for d in self._datasets: print_msg("\t"+d)
print_msg("This may take a while...")

result = pool.map_async(get_events_per_dataset, self._datasets).get(sys.maxint)
result = pool.map_async(get_events_per_dataset, self._datasets).get(sys.maxsize)
self._events_in_dataset = sum(result)

get_file_info = functools.partial(_get_properties,
properties = ["name", "nevents"],
filters = ["nevents > 0"],
entity = "dataset",
sub_entity = "file")
result = pool.map_async(get_file_info, self._datasets).get(sys.maxint)
result = pool.map_async(get_file_info, self._datasets).get(sys.maxsize)
self._file_info = {}
for item in result: self._file_info.update(dict(item))
self._files = sorted(self._file_info.keys())
Expand Down
4 changes: 2 additions & 2 deletions CondCore/Utilities/python/tier0.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def unique(seq, keepstr=True):
except TypeError: # hashing didn't work, see if seq is sortable
try:
from itertools import groupby
s = sorted(enumerate(seq),key=lambda (i,v):(v,i))
return t(g.next() for k,g in groupby(s, lambda (i,v): v))
s = sorted(enumerate(seq),key=lambda i_v1:(i_v1[1],i_v1[0]))
return t(next(g) for k,g in groupby(s, lambda i_v: i_v[1]))
except: # not sortable, use brute force
seen = []
return t(c for c in seq if not (c in seen or seen.append(c)))
Expand Down
2 changes: 1 addition & 1 deletion EventFilter/RPCRawToDigi/test/testRPCTwinMux_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
runlist = LumiList(runs = options.runList)
lumilist = lumilist & runlist
if not len(lumilist) :
raise RuntimeError, "The resulting LumiList is empty"
raise RuntimeError("The resulting LumiList is empty")

process = cms.Process("testRPCTwinMux")

Expand Down
2 changes: 1 addition & 1 deletion PhysicsTools/PatAlgos/python/tools/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def flattenRevDeps(flatgraph, revdepgraph, tip):
for j,m2 in enumerate(modulelist):
if j <= i: continue
if m2 in flatdeps and m1 in flatdeps[m2]:
raise RuntimeError, "BAD ORDER %s BEFORE %s" % (m1,m2)
raise RuntimeError("BAD ORDER %s BEFORE %s" % (m1,m2))
modules = [ getattr(process,p) for p in modulelist ]
#return cms.Sequence(sum(modules[1:],modules[0]))
task = cms.Task()
Expand Down
4 changes: 2 additions & 2 deletions SimTransport/HectorProducer/python/FastSimWithCTPPS_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ def customise(process):
# output
outputModule = None
outdict = process.outputModules_()
if outdict.has_key("AODSIMoutput"):
if "AODSIMoutput" in outdict:
process.AODSIMoutput.outputCommands.extend(cms.untracked.vstring('keep *_CTPPSSimHits_*_*','keep *_CTPPSFastRecHits_*_*'
,'keep *_CTPPSFastTracks_*_*'))
process.reconstruction_step.replace(process.reconstruction,process.reconstruction*process.CTPPSFastRecHits*process.CTPPSFastTracks)
elif outdict.has_key("FASTPUoutput"):
elif "FASTPUoutput" in outdict:
process.FASTPUoutput.outputCommands.extend(cms.untracked.vstring('keep *_CTPPSSimHits_*_*'))


Expand Down

0 comments on commit 2696152

Please sign in to comment.