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

Updated formatting of some Python files and fixed the version of autopep8

parent 60ac6dcf
......@@ -60,7 +60,7 @@ coding-conventions:
stage: test
script:
- export LCG_release_area=${LCG_release_area}:/cvmfs/lhcb.cern.ch/lib/lcg/external
- sudo pip install autopep8
- sudo pip install autopep8==1.3.5
- make BUILDDIR=build apply-formatting
- git diff > apply-formatting.patch
- git diff --stat --exit-code
......
......@@ -15,7 +15,7 @@ packages = ['GaudiCoreSvc', 'GaudiCommonSvc', 'GaudiSvc', 'GaudiAlg',
'GaudiAud', 'GaudiPoolDb', 'RootHistCnv', 'GaudiUtils',
'RootCnv']
#--Loop open all listed packages and populate __all__ with the names and
# --Loop open all listed packages and populate __all__ with the names and
# the local scope with the Configurable classes
for package in packages:
try:
......@@ -30,7 +30,7 @@ for package in packages:
# ignore the configurables from missing packages.
pass
#--Fix some of the name idiosyncrasies in Gaudi
# --Fix some of the name idiosyncrasies in Gaudi
aliases = {
'EventDataSvc': 'EvtDataSvc',
'DetectorDataSvc': 'DetDataSvc',
......
......@@ -228,7 +228,7 @@ class gaudimain(object):
return "\n".join(out)
def _writepickle(self, filename):
#--- Lets take the first file input file as the name of the pickle file
# --- Lets take the first file input file as the name of the pickle file
import pickle
output = open(filename, 'wb')
# Dump only the the configurables that make sense to dump (not User ones)
......@@ -379,7 +379,7 @@ class gaudimain(object):
self.log.debug('gaudiPythonInit: done')
def runSerial(self, attach_debugger):
#--- Instantiate the ApplicationMgr------------------------------
# --- Instantiate the ApplicationMgr------------------------------
if (self.mainLoop or
os.environ.get('GAUDIRUN_USE_GAUDIPYTHON')):
self.gaudiPythonInit()
......
......@@ -119,7 +119,7 @@ def getArgsFromQmt(qmtfile):
return args
#---------------------------------------------------------------------
# ---------------------------------------------------------------------
if __name__ == "__main__":
# ensure that we (and the subprocesses) use the C standard localization
if os.environ.get('LC_ALL') != 'C':
......
###############################################################
# Job options file
#==============================================================
# ==============================================================
from Gaudi.Configuration import *
from Configurables import ParentAlg, StopperAlg, Prescaler, HelloWorld, TimingAuditor
......@@ -8,9 +8,9 @@ from Configurables import ParentAlg, StopperAlg, Prescaler, HelloWorld, TimingAu
from Configurables import GaudiExamplesCommonConf
GaudiExamplesCommonConf()
#--------------------------------------------------------------
# --------------------------------------------------------------
# Testing Sequencers
#--------------------------------------------------------------
# --------------------------------------------------------------
p1 = Prescaler('Prescaler1', PercentPass=50., OutputLevel=WARNING)
p2 = Prescaler('Prescaler2', PercentPass=10., OutputLevel=WARNING)
h = HelloWorld(OutputLevel=DEBUG)
......@@ -20,9 +20,9 @@ s1 = Sequencer('Sequence1', Members=[p1, h, c1])
s2 = Sequencer('Sequence2', Members=[p2, h, c2])
top = Sequencer('TopSequence', Members=[s1, s2], StopOverride=True)
#-----------------------------------------------------------------
# -----------------------------------------------------------------
# Testing the new GaudiSequencer
#-----------------------------------------------------------------
# -----------------------------------------------------------------
sand = GaudiSequencer('ANDSequence',
Members=[HelloWorld('AND'), EventCounter('ANDCounter')],
MeasureTime=1)
......@@ -31,7 +31,7 @@ sor = GaudiSequencer('ORSequence',
MeasureTime=1,
ModeOR=1)
#-----------------------------------------------------------------
# -----------------------------------------------------------------
ApplicationMgr(TopAlg=[ParentAlg(), StopperAlg(StopCount=20),
top, sand, sor],
EvtMax=10, # events to be processed (default is 10)
......
###############################################################
# Job options file
#==============================================================
# ==============================================================
from Gaudi.Configuration import *
from Configurables import MyAlgorithm, MyTool, MyGaudiAlgorithm
......@@ -58,9 +58,9 @@ ApplicationMgr(EvtMax=10,
EvtSel='NONE',
HistogramPersistency='NONE',
TopAlg=[myalg, mygalg])
#--------------------------------------------------------------
# --------------------------------------------------------------
# Test circular tool dependencies (by Chris Jones)
#--------------------------------------------------------------
# --------------------------------------------------------------
from Configurables import TestToolAlg, TestTool
tA = TestTool('ToolA', Tools=['TestTool/ToolB'], OutputLevel=DEBUG)
......
###############################################################
# Job options file
#==============================================================
# ==============================================================
from Gaudi.Configuration import *
from Configurables import MyAlgorithm, MyGaudiAlgorithm, ToolSvc, AlgResourcePool, HiveSlimEventLoopMgr, HiveWhiteBoard
......
###############################################################
# Job options file
#==============================================================
# ==============================================================
from Gaudi.Configuration import *
from Configurables import ParentAlg, StopperAlg, Prescaler, HelloWorld, TimingAuditor
......@@ -11,9 +11,9 @@ from GaudiConfig.ControlFlow import seq
from Configurables import GaudiExamplesCommonConf
GaudiExamplesCommonConf()
#--------------------------------------------------------------
# --------------------------------------------------------------
# Testing Sequencers
#--------------------------------------------------------------
# --------------------------------------------------------------
p1 = Prescaler('Prescaler1', PercentPass=50., OutputLevel=WARNING)
p2 = Prescaler('Prescaler2', PercentPass=10., OutputLevel=WARNING)
h = HelloWorld(OutputLevel=DEBUG)
......@@ -27,9 +27,9 @@ top = s1 >> s2
#s2 = Sequencer('Sequence2', Members = [p2, h, c2] )
#top = Sequencer('TopSequence', Members = [s1, s2], StopOverride = True )
#-----------------------------------------------------------------
# -----------------------------------------------------------------
# Testing the new GaudiSequencer
#-----------------------------------------------------------------
# -----------------------------------------------------------------
sand = HelloWorld('AND') & EventCounter('ANDCounter')
sor = HelloWorld('OR') | EventCounter('ORCounter')
# sand = GaudiSequencer( 'ANDSequence',
......@@ -46,7 +46,7 @@ print '# --- Configured Control Flow Expression:'
print '#', all
print '# ---'
EventLoopMgr(PrintControlFlowExpression=True)
#-----------------------------------------------------------------
# -----------------------------------------------------------------
ApplicationMgr(TopAlg=[all],
EvtMax=10, # events to be processed (default is 10)
EvtSel='NONE', # do not use any event input
......
#!/usr/bin/env gaudirun.py
###############################################################
# Job options file
#==============================================================
# ==============================================================
from Gaudi.Configuration import *
from Configurables import MyDataAlgorithm, DataCreator
......
#///////////////////////////////////////////////////////////
# ///////////////////////////////////////////////////////////
# Job Options File in Python
theApp.TopAlg = ['RandomNumberAlg']
......@@ -8,15 +8,15 @@ MessageSvc = Service('MessageSvc')
MessageSvc.OutputLevel = 3
#--------------------------------------------------------------
# --------------------------------------------------------------
# Event related parameters
#--------------------------------------------------------------
# --------------------------------------------------------------
theApp.EvtMax = 100
theApp.EvtSel = "NONE"
#--------------------------------------------------------------
# --------------------------------------------------------------
# Other Service Options
#--------------------------------------------------------------
# --------------------------------------------------------------
# Histogram output file
theApp.HistogramPersistency = 'ROOT'
......
###############################################################
# Job options file
#==============================================================
# ==============================================================
from Gaudi.Configuration import *
from Configurables import MyGaudiAlgorithm
......
......@@ -12,9 +12,9 @@ importOptions("optsub1/dummy1.opts")
from Configurables import PropertyAlg, PropertyProxy
#--------------------------------------------------------------
# --------------------------------------------------------------
# Algorithms Private Options
#--------------------------------------------------------------
# --------------------------------------------------------------
alg = PropertyAlg(OutputLevel=3,
Int=101,
......@@ -58,9 +58,9 @@ alg = PropertyAlg(OutputLevel=3,
#proxy = PropertyProxy(String = "This is set by the proxy")
proxy = PropertyProxy()
#--------------------------------------------------------------
# --------------------------------------------------------------
# Private Application Configuration options
#--------------------------------------------------------------
# --------------------------------------------------------------
app = ApplicationMgr()
app.TopAlg = [alg]
# test for the multiple inclusion of the same alg
......@@ -68,16 +68,16 @@ app.TopAlg += [alg, proxy]
# test for the removal of an algorithm
app.TopAlg.remove(alg)
#--------------------------------------------------------------
# --------------------------------------------------------------
# Event related parameters
#--------------------------------------------------------------
# --------------------------------------------------------------
app.EvtMax = 1 # events to be processed (default is 10)
app.EvtSel = "NONE" # do not use any event input
app.HistogramPersistency = "NONE"
#--------------------------------------------------------------
# --------------------------------------------------------------
# MessageSvc Properties testing
#--------------------------------------------------------------
# --------------------------------------------------------------
msgSvc = MessageSvc()
msgSvc.setDebug += ["EventLoopMgr"]
msgSvc.setVerbose += ["MsgTest"]
......
###############################################################
# Job options file
#==============================================================
# ==============================================================
from Gaudi.Configuration import *
from Configurables import TAlgIS, TAlgDB, TemplatedAlg_int_std__vector_std__string_std__allocator_std__string_s_s_, TemplatedAlg_double_bool_
......@@ -14,7 +14,7 @@ is2 = TAlgIS('TAlgIS2', TProperty=100, RProperty=['string1', 'string2'])
db1 = TemplatedAlg_double_bool_('TAlgDB1', TProperty=10.10, RProperty=True)
db2 = TAlgDB('TAlgDB2', TProperty=10.10, RProperty=True)
#-----------------------------------------------------------------
# -----------------------------------------------------------------
ApplicationMgr(TopAlg=[is1, is2, db1, db2],
EvtMax=10, # events to be processed (default is 10)
EvtSel='NONE', # do not use any event input
......
###############################################################
# Job options file
#==============================================================
# ==============================================================
from Gaudi.Configuration import *
importOptions('AlgSequencer.py')
#--------------------------------------------------------------
# --------------------------------------------------------------
# Enable Timing Histograms
#--------------------------------------------------------------
# --------------------------------------------------------------
from Configurables import TimingAuditor, SequencerTimerTool
TIMER = TimingAuditor("TIMER")
TIMER.addTool(SequencerTimerTool, name="TIMER")
TIMER.TIMER.HistoProduce = True
#--------------------------------------------------------------
# --------------------------------------------------------------
# Enable histograms output
#--------------------------------------------------------------
# --------------------------------------------------------------
RootHistSvc().OutputFile = 'timing_histos.root'
ApplicationMgr(HistogramPersistency='ROOT')
#///////////////////////////////////////////////////////////
# ///////////////////////////////////////////////////////////
# Job Options File in Python
theApp.DLLs = ['RootHistCnv', 'HbookCnv', 'GaudiAlg', 'GaudiAud']
......@@ -9,15 +9,15 @@ MessageSvc = Service('MessageSvc')
MessageSvc.OutputLevel = 3
#--------------------------------------------------------------
# --------------------------------------------------------------
# Event related parameters
#--------------------------------------------------------------
# --------------------------------------------------------------
theApp.EvtMax = 100
theApp.EvtSel = "NONE"
#--------------------------------------------------------------
# --------------------------------------------------------------
# Other Service Options
#--------------------------------------------------------------
# --------------------------------------------------------------
# Histogram output file
theApp.HistogramPersistency = 'ROOT'
......
......@@ -39,7 +39,7 @@ evtslots = 23
evtMax = 50
cardinality = 10
threads = 10
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# The configuration of the whiteboard ------------------------------------------
# It is useful to call it EventDataSvc to replace the usual data service with
......@@ -48,7 +48,7 @@ threads = 10
whiteboard = HiveWhiteBoard("EventDataSvc",
EventSlots=evtslots)
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# Event Loop Manager -----------------------------------------------------------
# It's called slim since it has less functionalities overall than the good-old
......@@ -57,7 +57,7 @@ whiteboard = HiveWhiteBoard("EventDataSvc",
slimeventloopmgr = HiveSlimEventLoopMgr(
SchedulerName="AvalancheSchedulerSvc", OutputLevel=DEBUG)
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# AvalancheScheduler -----------------------------------------------------------
# We just decide how many algorithms in flight we want to have and how many
......@@ -67,13 +67,13 @@ slimeventloopmgr = HiveSlimEventLoopMgr(
scheduler = AvalancheSchedulerSvc(ThreadPoolSize=threads,
OutputLevel=WARNING)
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# Algo Resource Pool -----------------------------------------------------------
# Nothing special here, we just set the debug level.
AlgResourcePool(OutputLevel=DEBUG)
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# Set up of the crunchers, daily business --------------------------------------
......@@ -112,4 +112,4 @@ ApplicationMgr(EvtMax=evtMax,
TopAlg=[a1, a2, a3, a4, ctrp, ctrd],
MessageSvcType="InertMessageSvc")
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
......@@ -25,7 +25,7 @@ evtMax = 10
cardinality = 1
threads = 1
viewsPerEvt = 2
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# The configuration of the whiteboard ------------------------------------------
# It is useful to call it EventDataSvc to replace the usual data service with
......@@ -33,7 +33,7 @@ viewsPerEvt = 2
whiteboard = HiveWhiteBoard("EventDataSvc", EventSlots=evtslots)
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# Event Loop Manager -----------------------------------------------------------
# It's called slim since it has less functionalities overall than the good-old
......@@ -42,7 +42,7 @@ whiteboard = HiveWhiteBoard("EventDataSvc", EventSlots=evtslots)
slimeventloopmgr = HiveSlimEventLoopMgr(
SchedulerName="AvalancheSchedulerSvc", OutputLevel=INFO)
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# ForwardScheduler -------------------------------------------------------------
# We just decide how many algorithms in flight we want to have and how many
......@@ -51,13 +51,13 @@ slimeventloopmgr = HiveSlimEventLoopMgr(
scheduler = AvalancheSchedulerSvc(ThreadPoolSize=threads, OutputLevel=INFO)
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# Algo Resource Pool -----------------------------------------------------------
# Nothing special here, we just set the debug level.
AlgResourcePool(OutputLevel=INFO)
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# Set up of the crunchers, daily business --------------------------------------
......@@ -99,4 +99,4 @@ ApplicationMgr(EvtMax=evtMax,
TopAlg=[createViewSeq],
MessageSvcType="InertMessageSvc")
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
......@@ -27,7 +27,7 @@ evtMax = 10
cardinality = 1
threads = 1
viewsPerEvt = 2
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# The configuration of the whiteboard ------------------------------------------
# It is useful to call it EventDataSvc to replace the usual data service with
......@@ -35,7 +35,7 @@ viewsPerEvt = 2
whiteboard = HiveWhiteBoard("EventDataSvc", EventSlots=evtslots)
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# Event Loop Manager -----------------------------------------------------------
# It's called slim since it has less functionalities overall than the good-old
......@@ -44,7 +44,7 @@ whiteboard = HiveWhiteBoard("EventDataSvc", EventSlots=evtslots)
slimeventloopmgr = HiveSlimEventLoopMgr(
SchedulerName="AvalancheSchedulerSvc", OutputLevel=DEBUG)
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# ForwardScheduler -------------------------------------------------------------
# We just decide how many algorithms in flight we want to have and how many
......@@ -53,13 +53,13 @@ slimeventloopmgr = HiveSlimEventLoopMgr(
scheduler = AvalancheSchedulerSvc(ThreadPoolSize=threads, OutputLevel=INFO)
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# Algo Resource Pool -----------------------------------------------------------
# Nothing special here, we just set the debug level.
AlgResourcePool(OutputLevel=DEBUG)
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# Set up of the crunchers, daily business --------------------------------------
......@@ -112,4 +112,4 @@ ApplicationMgr(EvtMax=evtMax,
TopAlg=[createViewSeq],
MessageSvcType="InertMessageSvc")
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
......@@ -12,7 +12,7 @@ evtslots = 5
evtMax = 20
cardinality = 5
algosInFlight = 10
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# The configuration of the whiteboard ------------------------------------------
# It is useful to call it EventDataSvc to replace the usual data service with
......@@ -21,7 +21,7 @@ algosInFlight = 10
whiteboard = HiveWhiteBoard("EventDataSvc",
EventSlots=evtslots)
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# Event Loop Manager -----------------------------------------------------------
# It's called slim since it has less functionalities overall than the good-old
......@@ -29,7 +29,7 @@ whiteboard = HiveWhiteBoard("EventDataSvc",
slimeventloopmgr = HiveSlimEventLoopMgr(OutputLevel=DEBUG)
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# Avalanche Scheduler ----------------------------------------------------------
# We just decide how many algorithms in flight we want to have and how many
......@@ -39,13 +39,13 @@ slimeventloopmgr = HiveSlimEventLoopMgr(OutputLevel=DEBUG)
scheduler = AvalancheSchedulerSvc(ThreadPoolSize=algosInFlight,
OutputLevel=DEBUG)
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# Algo Resource Pool -----------------------------------------------------------
# Nothing special here, we just set the debug level.
AlgResourcePool(OutputLevel=DEBUG)
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# Set up of the crunchers, daily business --------------------------------------
......
......@@ -28,7 +28,7 @@ evtMax = 10
cardinality = 1
threads = 1
viewsPerEvt = 2
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# The configuration of the whiteboard ------------------------------------------
# It is useful to call it EventDataSvc to replace the usual data service with
......@@ -36,7 +36,7 @@ viewsPerEvt = 2
whiteboard = HiveWhiteBoard("EventDataSvc", EventSlots=evtslots)
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# Event Loop Manager -----------------------------------------------------------
# It's called slim since it has less functionalities overall than the good-old
......@@ -45,7 +45,7 @@ whiteboard = HiveWhiteBoard("EventDataSvc", EventSlots=evtslots)
slimeventloopmgr = HiveSlimEventLoopMgr(
SchedulerName="AvalancheSchedulerSvc", OutputLevel=INFO)
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# ForwardScheduler -------------------------------------------------------------
# We just decide how many algorithms in flight we want to have and how many
......@@ -54,13 +54,13 @@ slimeventloopmgr = HiveSlimEventLoopMgr(
scheduler = AvalancheSchedulerSvc(ThreadPoolSize=threads, OutputLevel=INFO)
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# Algo Resource Pool -----------------------------------------------------------
# Nothing special here, we just set the debug level.
AlgResourcePool(OutputLevel=INFO)
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# Set up of the crunchers, daily business --------------------------------------
......@@ -117,4 +117,4 @@ ApplicationMgr(EvtMax=evtMax,
TopAlg=[createViewSeq],
MessageSvcType="InertMessageSvc")
#-------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
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