CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Static Public Attributes
Config.TestModuleCommand Class Reference
Inheritance diagram for Config.TestModuleCommand:

Public Member Functions

def setUp (self)
 
def testCloneSequence (self)
 
def testConditionalTask (self)
 
def testConditionalTaskPlaceholder (self)
 
def testContains (self)
 
def testDelete (self)
 
def testExamples (self)
 
def testFinalPath (self)
 
def testFreeze (self)
 
def testGlobalReplace (self)
 
def testImplicitSchedule (self)
 
def testMaxEvents (self)
 
def testModifier (self)
 
def testOptions (self)
 
def testOverride (self)
 
def testParameterizable (self)
 
def testPath (self)
 
def testPrefers (self)
 
def testProcessAccelerator (self)
 
def testProcessDumpPython (self)
 
def testProcessExtend (self)
 
def testProcessForProcessAccelerator (self)
 
def testProcessFragment (self)
 
def testProcessInsertion (self)
 
def testPrune (self)
 
def testRefToPSet (self)
 
def testSchedule (self)
 
def testSecSource (self)
 
def testSequence (self)
 
def testSequence2 (self)
 
def testServiceInProcess (self)
 
def testSubProcess (self)
 
def testSwitchProducer (self)
 
def testTask (self)
 
def testTaskPlaceholder (self)
 
def testTypedParameterizable (self)
 
def testUsing (self)
 

Public Attributes

 maxDiff
 
 proc_mod_
 

Static Public Attributes

 a
 
 b
 
 c
 
 d
 
 e
 
 f
 
 g
 
 p
 
 p2
 
 process
 
 r
 
 s
 
 s1
 
 s2
 
 s3
 
 schedule
 
 task1
 
 task2
 
 task3
 
 task4
 
 task5
 
 tasks
 

Detailed Description

Definition at line 2273 of file Config.py.

Member Function Documentation

◆ setUp()

def Config.TestModuleCommand.setUp (   self)
Nothing to do 

Definition at line 2274 of file Config.py.

2274  def setUp(self):
2275  """Nothing to do """
2276  None

◆ testCloneSequence()

def Config.TestModuleCommand.testCloneSequence (   self)

Definition at line 3340 of file Config.py.

References l1ctLayer2EG_cff.id, and str.

3340  def testCloneSequence(self):
3341  p = Process("test")
3342  a = EDAnalyzer("MyAnalyzer")
3343  p.a = a
3344  a.setLabel("a")
3345  b = EDAnalyzer("YOurAnalyzer")
3346  p.b = b
3347  b.setLabel("b")
3348  path = Path(a * b)
3349  p.path = Path(p.a*p.b)
3350  lookuptable = {id(a): p.a, id(b): p.b}
3351  #self.assertEqual(str(path),str(path._postProcessFixup(lookuptable)))
3352  #lookuptable = p._cloneToObjectDict
3353  #self.assertEqual(str(path),str(path._postProcessFixup(lookuptable)))
3354  self.assertEqual(str(path),str(p.path))
3355 
#define str(s)

◆ testConditionalTask()

def Config.TestModuleCommand.testConditionalTask (   self)

Definition at line 3062 of file Config.py.

3062  def testConditionalTask(self):
3063 
3064  # create some objects to use in tests
3065  edanalyzer = EDAnalyzer("a")
3066  edproducer = EDProducer("b")
3067  edproducer2 = EDProducer("b2")
3068  edproducer3 = EDProducer("b3")
3069  edproducer4 = EDProducer("b4")
3070  edproducer8 = EDProducer("b8")
3071  edproducer9 = EDProducer("b9")
3072  edfilter = EDFilter("c")
3073  service = Service("d")
3074  service3 = Service("d", v = untracked.uint32(3))
3075  essource = ESSource("e")
3076  esproducer = ESProducer("f")
3077  testTask2 = Task()
3078  testCTask2 = ConditionalTask()
3079 
3080  # test adding things to Tasks
3081  testTask1 = ConditionalTask(edproducer, edfilter)
3082  self.assertRaises(RuntimeError, testTask1.add, edanalyzer)
3083  testTask1.add(essource, service)
3084  testTask1.add(essource, esproducer)
3085  testTask1.add(testTask2)
3086  testTask1.add(testCTask2)
3087  coll = testTask1._collection
3088  self.assertTrue(edproducer in coll)
3089  self.assertTrue(edfilter in coll)
3090  self.assertTrue(service in coll)
3091  self.assertTrue(essource in coll)
3092  self.assertTrue(esproducer in coll)
3093  self.assertTrue(testTask2 in coll)
3094  self.assertTrue(testCTask2 in coll)
3095  self.assertTrue(len(coll) == 7)
3096  self.assertTrue(len(testTask2._collection) == 0)
3097 
3098  taskContents = []
3099  for i in testTask1:
3100  taskContents.append(i)
3101  self.assertEqual(taskContents, [edproducer, edfilter, essource, service, esproducer, testTask2, testCTask2])
3102 
3103  # test attaching Task to Process
3104  process = Process("test")
3105 
3106  process.mproducer = edproducer
3107  process.mproducer2 = edproducer2
3108  process.mfilter = edfilter
3109  process.messource = essource
3110  process.mesproducer = esproducer
3111  process.d = service
3112 
3113  testTask3 = ConditionalTask(edproducer, edproducer2)
3114  testTask1.add(testTask3)
3115  process.myTask1 = testTask1
3116 
3117  # test the validation that occurs when attaching a ConditionalTask to a Process
3118  # first a case that passes, then one the fails on an EDProducer
3119  # then one that fails on a service
3120  l = set()
3121  visitor = NodeNameVisitor(l)
3122  testTask1.visit(visitor)
3123  self.assertEqual(l, set(['mesproducer', 'mproducer', 'mproducer2', 'mfilter', 'd', 'messource']))
3124  l2 = testTask1.moduleNames()
3125  self.assertEqual(l2, set(['mesproducer', 'mproducer', 'mproducer2', 'mfilter', 'd', 'messource']))
3126 
3127  testTask4 = ConditionalTask(edproducer3)
3128  l.clear()
3129  self.assertRaises(RuntimeError, testTask4.visit, visitor)
3130  try:
3131  process.myTask4 = testTask4
3132  self.assertTrue(False)
3133  except RuntimeError:
3134  pass
3135 
3136  testTask5 = ConditionalTask(service3)
3137  l.clear()
3138  self.assertRaises(RuntimeError, testTask5.visit, visitor)
3139  try:
3140  process.myTask5 = testTask5
3141  self.assertTrue(False)
3142  except RuntimeError:
3143  pass
3144 
3145  process.d = service3
3146  process.myTask5 = testTask5
3147 
3148  # test placement into the Process and the tasks property
3149  expectedDict = { 'myTask1' : testTask1, 'myTask5' : testTask5 }
3150  expectedFixedDict = DictTypes.FixedKeysDict(expectedDict);
3151  self.assertEqual(process.conditionaltasks, expectedFixedDict)
3152  self.assertEqual(process.conditionaltasks['myTask1'], testTask1)
3153  self.assertEqual(process.myTask1, testTask1)
3154 
3155  # test replacing an EDProducer in a ConditionalTask when calling __settattr__
3156  # for the EDProducer on the Process.
3157  process.mproducer2 = edproducer4
3158  process.d = service
3159  l = list()
3160  visitor1 = ModuleNodeVisitor(l)
3161  testTask1.visit(visitor1)
3162  l.sort(key=lambda mod: mod.__str__())
3163  expectedList = sorted([edproducer,essource,esproducer,service,edfilter,edproducer,edproducer4],key=lambda mod: mod.__str__())
3164  self.assertEqual(expectedList, l)
3165  process.myTask6 = ConditionalTask()
3166  process.myTask7 = ConditionalTask()
3167  process.mproducer8 = edproducer8
3168  process.myTask8 = ConditionalTask(process.mproducer8)
3169  process.myTask6.add(process.myTask7)
3170  process.myTask7.add(process.myTask8)
3171  process.myTask1.add(process.myTask6)
3172  process.myTask8.add(process.myTask5)
3173  self.assertEqual(process.myTask8.dumpPython(), "cms.ConditionalTask(process.mproducer8, process.myTask5)\n")
3174 
3175  testDict = process._itemsInDependencyOrder(process.conditionaltasks)
3176  expectedLabels = ["myTask5", "myTask8", "myTask7", "myTask6", "myTask1"]
3177  expectedTasks = [process.myTask5, process.myTask8, process.myTask7, process.myTask6, process.myTask1]
3178  index = 0
3179  for testLabel, testTask in testDict.items():
3180  self.assertEqual(testLabel, expectedLabels[index])
3181  self.assertEqual(testTask, expectedTasks[index])
3182  index += 1
3183 
3184  pythonDump = testTask1.dumpPython(PrintOptions())
3185 
3186 
3187  expectedPythonDump = 'cms.ConditionalTask(process.d, process.mesproducer, process.messource, process.mfilter, process.mproducer, process.mproducer2, process.myTask6)\n'
3188  self.assertEqual(pythonDump, expectedPythonDump)
3189 
3190  process.myTask5 = ConditionalTask()
3191  self.assertEqual(process.myTask8.dumpPython(), "cms.ConditionalTask(process.mproducer8, process.myTask5)\n")
3192  process.myTask100 = ConditionalTask()
3193  process.mproducer9 = edproducer9
3194  sequence1 = Sequence(process.mproducer8, process.myTask1, process.myTask5, testTask2, testTask3)
3195  sequence2 = Sequence(process.mproducer8 + process.mproducer9)
3196  process.sequence3 = Sequence((process.mproducer8 + process.mfilter))
3197  sequence4 = Sequence()
3198  process.path1 = Path(process.mproducer+process.mproducer8+sequence1+sequence2+process.sequence3+sequence4)
3199  process.path1.associate(process.myTask1, process.myTask5, testTask2, testTask3)
3200  process.path11 = Path(process.mproducer+process.mproducer8+sequence1+sequence2+process.sequence3+ sequence4,process.myTask1, process.myTask5, testTask2, testTask3, process.myTask100)
3201  process.path2 = Path(process.mproducer)
3202  process.path3 = Path(process.mproducer9+process.mproducer8,testTask2)
3203 
3204  self.assertEqual(process.path1.dumpPython(PrintOptions()), 'cms.Path(process.mproducer+process.mproducer8+cms.Sequence(process.mproducer8, cms.ConditionalTask(process.None, process.mproducer), cms.Task(), process.myTask1, process.myTask5)+(process.mproducer8+process.mproducer9)+process.sequence3, cms.ConditionalTask(process.None, process.mproducer), cms.Task(), process.myTask1, process.myTask5)\n')
3205 
3206  self.assertEqual(process.path11.dumpPython(PrintOptions()), 'cms.Path(process.mproducer+process.mproducer8+cms.Sequence(process.mproducer8, cms.ConditionalTask(process.None, process.mproducer), cms.Task(), process.myTask1, process.myTask5)+(process.mproducer8+process.mproducer9)+process.sequence3, cms.ConditionalTask(process.None, process.mproducer), cms.Task(), process.myTask1, process.myTask100, process.myTask5)\n')
3207 
3208  # test NodeNameVisitor and moduleNames
3209  l = set()
3210  nameVisitor = NodeNameVisitor(l)
3211  process.path1.visit(nameVisitor)
3212  self.assertTrue(l == set(['mproducer', 'd', 'mesproducer', None, 'mproducer9', 'mproducer8', 'messource', 'mproducer2', 'mfilter']))
3213  self.assertTrue(process.path1.moduleNames() == set(['mproducer', 'd', 'mesproducer', None, 'mproducer9', 'mproducer8', 'messource', 'mproducer2', 'mfilter']))
3214 
3215  # test copy
3216  process.mproducer10 = EDProducer("b10")
3217  process.path21 = process.path11.copy()
3218  process.path21.replace(process.mproducer, process.mproducer10)
3219 
3220  self.assertEqual(process.path11.dumpPython(PrintOptions()), 'cms.Path(process.mproducer+process.mproducer8+cms.Sequence(process.mproducer8, cms.ConditionalTask(process.None, process.mproducer), cms.Task(), process.myTask1, process.myTask5)+(process.mproducer8+process.mproducer9)+process.sequence3, cms.ConditionalTask(process.None, process.mproducer), cms.Task(), process.myTask1, process.myTask100, process.myTask5)\n')
3221 
3222  # Some peculiarities of the way things work show up here. dumpPython sorts tasks and
3223  # removes duplication at the level of strings. The Task and Sequence objects themselves
3224  # remove duplicate tasks in their contents if the instances are the same (exact same python
3225  # object id which is not the same as the string representation being the same).
3226  # Also note that the mutating visitor replaces sequences and tasks that have
3227  # modified contents with their modified contents, it does not modify the sequence
3228  # or task itself.
3229  self.assertEqual(process.path21.dumpPython(PrintOptions()), 'cms.Path(process.mproducer10+process.mproducer8+process.mproducer8+(process.mproducer8+process.mproducer9)+process.sequence3, cms.ConditionalTask(process.None, process.mproducer10), cms.ConditionalTask(process.d, process.mesproducer, process.messource, process.mfilter, process.mproducer10, process.mproducer2, process.mproducer8, process.myTask5), cms.Task(), process.myTask100, process.myTask5)\n')
3230 
3231  process.path22 = process.path21.copyAndExclude([process.d, process.mesproducer, process.mfilter])
3232  self.assertEqual(process.path22.dumpPython(PrintOptions()), 'cms.Path(process.mproducer10+process.mproducer8+process.mproducer8+(process.mproducer8+process.mproducer9)+process.mproducer8, cms.ConditionalTask(process.None, process.mproducer10), cms.ConditionalTask(process.messource, process.mproducer10, process.mproducer2, process.mproducer8, process.myTask5), cms.Task(), process.myTask100, process.myTask5)\n')
3233 
3234  process.path23 = process.path22.copyAndExclude([process.messource, process.mproducer10])
3235  self.assertEqual(process.path23.dumpPython(PrintOptions()), 'cms.Path(process.mproducer8+process.mproducer8+(process.mproducer8+process.mproducer9)+process.mproducer8, cms.ConditionalTask(process.None), cms.ConditionalTask(process.mproducer2, process.mproducer8, process.myTask5), cms.Task(), process.myTask100, process.myTask5)\n')
3236 
3237  process = Process("Test")
3238 
3239  process.b = EDProducer("b")
3240  process.b2 = EDProducer("b2")
3241  process.b3 = EDProducer("b3")
3242  process.p = Path(process.b, ConditionalTask(process.b3, process.b2))
3243  p = TestMakePSet()
3244  process.fillProcessDesc(p)
3245  self.assertEqual(p.values["@all_modules"], (True, ['b', 'b2', 'b3']))
3246  self.assertEqual(p.values["@paths"], (True, ['p']))
3247  self.assertEqual(p.values["p"], (True, ['b','#','b2','b3','@']))
3248 
3249 

◆ testConditionalTaskPlaceholder()

def Config.TestModuleCommand.testConditionalTaskPlaceholder (   self)

Definition at line 4059 of file Config.py.

References Config._lineDiff(), and ConfigBuilder.dumpPython().

4059  def testConditionalTaskPlaceholder(self):
4060  p = Process("test")
4061  p.a = EDProducer("ma")
4062  p.b = EDAnalyzer("mb")
4063  p.t1 = ConditionalTask(ConditionalTaskPlaceholder("c"))
4064  p.t2 = ConditionalTask(p.a, ConditionalTaskPlaceholder("d"), p.t1)
4065  p.t3 = ConditionalTask(ConditionalTaskPlaceholder("e"))
4066  p.path1 = Path(p.b, p.t2, p.t3)
4067  p.t5 = ConditionalTask(p.a, ConditionalTaskPlaceholder("g"), ConditionalTaskPlaceholder("t4"))
4068  p.t4 = ConditionalTask(ConditionalTaskPlaceholder("f"))
4069  p.path2 = Path(p.b, p.t5)
4070  p.schedule = Schedule(p.path1, p.path2)
4071  p.c = EDProducer("mc")
4072  p.d = EDProducer("md")
4073  p.e = EDProducer("me")
4074  p.f = EDProducer("mf")
4075  p.g = EDProducer("mg")
4076  p.h = EDProducer("mh")
4077  p.i = EDProducer("mi")
4078  p.j = EDProducer("mj")
4079  self.assertEqual(_lineDiff(p.dumpPython(),Process('test').dumpPython()),
4080 """process.a = cms.EDProducer("ma")
4081 process.c = cms.EDProducer("mc")
4082 process.d = cms.EDProducer("md")
4083 process.e = cms.EDProducer("me")
4084 process.f = cms.EDProducer("mf")
4085 process.g = cms.EDProducer("mg")
4086 process.h = cms.EDProducer("mh")
4087 process.i = cms.EDProducer("mi")
4088 process.j = cms.EDProducer("mj")
4089 process.b = cms.EDAnalyzer("mb")
4090 process.t1 = cms.ConditionalTask(cms.ConditionalTaskPlaceholder("c"))
4091 process.t2 = cms.ConditionalTask(cms.ConditionalTaskPlaceholder("d"), process.a, process.t1)
4092 process.t3 = cms.ConditionalTask(cms.ConditionalTaskPlaceholder("e"))
4093 process.t5 = cms.ConditionalTask(cms.ConditionalTaskPlaceholder("g"), cms.ConditionalTaskPlaceholder("t4"), process.a)
4094 process.t4 = cms.ConditionalTask(cms.ConditionalTaskPlaceholder("f"))
4095 process.path1 = cms.Path(process.b, process.t2, process.t3)
4096 process.path2 = cms.Path(process.b, process.t5)
4097 process.schedule = cms.Schedule(*[ process.path1, process.path2 ])""")
4098  p.resolve()
4099  self.assertEqual(_lineDiff(p.dumpPython(),Process('test').dumpPython()),
4100 """process.a = cms.EDProducer("ma")
4101 process.c = cms.EDProducer("mc")
4102 process.d = cms.EDProducer("md")
4103 process.e = cms.EDProducer("me")
4104 process.f = cms.EDProducer("mf")
4105 process.g = cms.EDProducer("mg")
4106 process.h = cms.EDProducer("mh")
4107 process.i = cms.EDProducer("mi")
4108 process.j = cms.EDProducer("mj")
4109 process.b = cms.EDAnalyzer("mb")
4110 process.t1 = cms.ConditionalTask(process.c)
4111 process.t2 = cms.ConditionalTask(process.a, process.d, process.t1)
4112 process.t3 = cms.ConditionalTask(process.e)
4113 process.t4 = cms.ConditionalTask(process.f)
4114 process.t5 = cms.ConditionalTask(process.a, process.g, process.t4)
4115 process.path1 = cms.Path(process.b, process.t2, process.t3)
4116 process.path2 = cms.Path(process.b, process.t5)
4117 process.schedule = cms.Schedule(*[ process.path1, process.path2 ])""")
4118 
def _lineDiff(newString, oldString)
Definition: Config.py:2083
def dumpPython(process, name)

◆ testContains()

def Config.TestModuleCommand.testContains (   self)

Definition at line 3356 of file Config.py.

3356  def testContains(self):
3357 
3358  a = EDProducer("a")
3359  b = EDProducer("b")
3360  c = EDProducer("c")
3361  d = EDProducer("d")
3362  e = EDProducer("e")
3363  f = EDProducer("f")
3364  g = EDProducer("g")
3365  h = EDProducer("h")
3366  i = EDProducer("i")
3367  j = EDProducer("j")
3368  k = EDProducer("k")
3369  l = EDProducer("l")
3370  m = EDProducer("m")
3371  n = EDProducer("n")
3372 
3373  seq1 = Sequence(e)
3374  task1 = Task(g)
3375  ctask1 = ConditionalTask(h)
3376  path = Path(a * c * seq1, task1, ctask1)
3377 
3378  self.assertTrue(path.contains(a))
3379  self.assertFalse(path.contains(b))
3380  self.assertTrue(path.contains(c))
3381  self.assertFalse(path.contains(d))
3382  self.assertTrue(path.contains(e))
3383  self.assertFalse(path.contains(f))
3384  self.assertTrue(path.contains(g))
3385  self.assertTrue(path.contains(h))
3386 
3387  endpath = EndPath(h * i)
3388  self.assertFalse(endpath.contains(b))
3389  self.assertTrue(endpath.contains(i))
3390 
3391  seq = Sequence(a * c)
3392  self.assertFalse(seq.contains(b))
3393  self.assertTrue(seq.contains(c))
3394 
3395  task2 = Task(l)
3396  task = Task(j, k, task2)
3397  self.assertFalse(task.contains(b))
3398  self.assertTrue(task.contains(j))
3399  self.assertTrue(task.contains(k))
3400  self.assertTrue(task.contains(l))
3401 
3402  task3 = Task(m)
3403  path2 = Path(n)
3404  sch = Schedule(path, path2, tasks=[task,task3])
3405  self.assertFalse(sch.contains(b))
3406  self.assertTrue(sch.contains(a))
3407  self.assertTrue(sch.contains(c))
3408  self.assertTrue(sch.contains(e))
3409  self.assertTrue(sch.contains(g))
3410  self.assertTrue(sch.contains(n))
3411  self.assertTrue(sch.contains(j))
3412  self.assertTrue(sch.contains(k))
3413  self.assertTrue(sch.contains(l))
3414  self.assertTrue(sch.contains(m))
3415 
3416  ctask2 = ConditionalTask(l, task1)
3417  ctask = ConditionalTask(j, k, ctask2)
3418  self.assertFalse(ctask.contains(b))
3419  self.assertTrue(ctask.contains(j))
3420  self.assertTrue(ctask.contains(k))
3421  self.assertTrue(ctask.contains(l))
3422  self.assertTrue(ctask.contains(g))
3423 
def testContains(self)
Definition: helpers.py:421

◆ testDelete()

def Config.TestModuleCommand.testDelete (   self)

Definition at line 4119 of file Config.py.

References ConfigBuilder.dumpPython().

4119  def testDelete(self):
4120  p = Process("test")
4121  p.a = EDAnalyzer("MyAnalyzer")
4122  p.b = EDAnalyzer("YourAnalyzer")
4123  p.c = EDAnalyzer("OurAnalyzer")
4124  p.d = EDAnalyzer("OurAnalyzer")
4125  p.e = EDAnalyzer("OurAnalyzer")
4126  p.f = EDAnalyzer("OurAnalyzer")
4127  p.g = EDProducer("OurProducer")
4128  p.h = EDProducer("YourProducer")
4129  p.i = SwitchProducerTest(
4130  test1 = EDProducer("OneProducer"),
4131  test2 = EDProducer("TwoProducer")
4132  )
4133  p.t1 = Task(p.g, p.h, p.i)
4134  t2 = Task(p.g, p.h, p.i)
4135  t3 = Task(p.g, p.h)
4136  p.t4 = Task(p.h)
4137  p.ct1 = ConditionalTask(p.g, p.h, p.i)
4138  ct2 = ConditionalTask(p.g, p.h)
4139  ct3 = ConditionalTask(p.g, p.h)
4140  p.ct4 = ConditionalTask(p.h)
4141  p.s = Sequence(p.d+p.e)
4142  p.path1 = Path(p.a+p.f+p.s,t2,ct2)
4143  p.path2 = Path(p.a)
4144  p.path3 = Path(ct3, p.ct4)
4145  p.endpath2 = EndPath(p.b)
4146  p.endpath1 = EndPath(p.b+p.f)
4147  p.schedule = Schedule(p.path2, p.path3, p.endpath2, tasks=[t3, p.t4])
4148  self.assertTrue(hasattr(p, 'f'))
4149  self.assertTrue(hasattr(p, 'g'))
4150  self.assertTrue(hasattr(p, 'i'))
4151  del p.e
4152  del p.f
4153  del p.g
4154  del p.i
4155  self.assertFalse(hasattr(p, 'f'))
4156  self.assertFalse(hasattr(p, 'g'))
4157  self.assertEqual(p.t1.dumpPython(), 'cms.Task(process.h)\n')
4158  self.assertEqual(p.ct1.dumpPython(), 'cms.ConditionalTask(process.h)\n')
4159  self.assertEqual(p.s.dumpPython(), 'cms.Sequence(process.d)\n')
4160  self.assertEqual(p.path1.dumpPython(), 'cms.Path(process.a+process.s, cms.ConditionalTask(process.h), cms.Task(process.h))\n')
4161  self.assertEqual(p.endpath1.dumpPython(), 'cms.EndPath(process.b)\n')
4162  self.assertEqual(p.path3.dumpPython(), 'cms.Path(cms.ConditionalTask(process.h), process.ct4)\n')
4163  del p.s
4164  self.assertEqual(p.path1.dumpPython(), 'cms.Path(process.a+(process.d), cms.ConditionalTask(process.h), cms.Task(process.h))\n')
4165  self.assertEqual(p.schedule_().dumpPython(), 'cms.Schedule(*[ process.path2, process.path3, process.endpath2 ], tasks=[cms.Task(process.h), process.t4])\n')
4166  del p.path2
4167  self.assertEqual(p.schedule_().dumpPython(), 'cms.Schedule(*[ process.path3, process.endpath2 ], tasks=[cms.Task(process.h), process.t4])\n')
4168  del p.path3
4169  self.assertEqual(p.schedule_().dumpPython(), 'cms.Schedule(*[ process.endpath2 ], tasks=[cms.Task(process.h), process.t4])\n')
4170  del p.endpath2
4171  self.assertEqual(p.schedule_().dumpPython(), 'cms.Schedule(tasks=[cms.Task(process.h), process.t4])\n')
4172  del p.t4
4173  self.assertEqual(p.schedule_().dumpPython(), 'cms.Schedule(tasks=[cms.Task(process.h)])\n')
def dumpPython(process, name)

◆ testExamples()

def Config.TestModuleCommand.testExamples (   self)

Definition at line 3619 of file Config.py.

References Types.untracked.

3619  def testExamples(self):
3620  p = Process("Test")
3621  p.source = Source("PoolSource",fileNames = untracked(string("file:reco.root")))
3622  p.foos = EDProducer("FooProducer")
3623  p.bars = EDProducer("BarProducer", foos=InputTag("foos"))
3624  p.out = OutputModule("PoolOutputModule",fileName=untracked(string("file:foos.root")))
3625  p.bars.foos = 'Foosball'
3626  self.assertEqual(p.bars.foos, InputTag('Foosball'))
3627  p.p = Path(p.foos*p.bars)
3628  p.e = EndPath(p.out)
3629  p.add_(Service("MessageLogger"))
3630 
untracked
Definition: Types.py:34

◆ testFinalPath()

def Config.TestModuleCommand.testFinalPath (   self)

Definition at line 3301 of file Config.py.

References str.

3301  def testFinalPath(self):
3302  p = Process("test")
3303  p.a = OutputModule("MyOutputModule")
3304  p.b = OutputModule("YourOutputModule")
3305  p.c = OutputModule("OurOutputModule")
3306  path = FinalPath(p.a)
3307  path *= p.b
3308  path += p.c
3309  self.assertEqual(str(path),'a+b+c')
3310  path = FinalPath(p.a*p.b+p.c)
3311  self.assertEqual(str(path),'a+b+c')
3312  path = FinalPath(p.a+ p.b*p.c)
3313  self.assertEqual(str(path),'a+b+c')
3314  path = FinalPath(p.a*(p.b+p.c))
3315  self.assertEqual(str(path),'a+b+c')
3316  p.es = ESProducer("AnESProducer")
3317  self.assertRaises(TypeError,FinalPath,p.es)
3318 
3319  t = FinalPath()
3320  self.assertEqual(t.dumpPython(PrintOptions()), 'cms.FinalPath()\n')
3321 
3322  t = FinalPath(p.a)
3323  self.assertEqual(t.dumpPython(PrintOptions()), 'cms.FinalPath(process.a)\n')
3324 
3325  self.assertRaises(TypeError, FinalPath, Task())
3326  self.assertRaises(TypeError, FinalPath, p.a, Task())
3327 
3328  p.prod = EDProducer("prodName")
3329  p.t1 = Task(p.prod)
3330  self.assertRaises(TypeError, FinalPath, p.a, p.t1, Task(), p.t1)
3331 
3332  p.prod = EDProducer("prodName")
3333  p.t1 = ConditionalTask(p.prod)
3334  self.assertRaises(TypeError, FinalPath, p.a, p.t1, ConditionalTask(), p.t1)
3335 
3336  p.t = FinalPath(p.a)
3337  p.a = OutputModule("ReplacedOutputModule")
3338  self.assertEqual(p.t.dumpPython(PrintOptions()), 'cms.FinalPath(process.a)\n')
3339 
#define str(s)

◆ testFreeze()

def Config.TestModuleCommand.testFreeze (   self)

Definition at line 3651 of file Config.py.

3651  def testFreeze(self):
3652  process = Process("Freeze")
3653  m = EDProducer("M", p=PSet(i = int32(1)))
3654  m.p.i = 2
3655  process.m = m
3656  # should be frozen
3657  #self.assertRaises(ValueError, setattr, m.p, 'i', 3)
3658  #self.assertRaises(ValueError, setattr, m, 'p', PSet(i=int32(1)))
3659  #self.assertRaises(ValueError, setattr, m.p, 'j', 1)
3660  #self.assertRaises(ValueError, setattr, m, 'j', 1)
3661  # But OK to change through the process
3662  process.m.p.i = 4
3663  self.assertEqual(process.m.p.i.value(), 4)
3664  process.m.p = PSet(j=int32(1))
3665  # should work to clone it, though
3666  m2 = m.clone(p = PSet(i = int32(5)), j = int32(8))
3667  m2.p.i = 6
3668  m2.j = 8
Definition: PSet.py:1

◆ testGlobalReplace()

def Config.TestModuleCommand.testGlobalReplace (   self)

Definition at line 2756 of file Config.py.

2756  def testGlobalReplace(self):
2757  p = Process('test')
2758  p.a = EDAnalyzer("MyAnalyzer")
2759  old = p.a
2760  p.b = EDAnalyzer("YourAnalyzer")
2761  p.c = EDAnalyzer("OurAnalyzer")
2762  p.d = EDProducer("MyProducer")
2763  old2 = p.d
2764  p.t1 = Task(p.d)
2765  t2 = Task(p.d)
2766  t3 = Task(p.d)
2767  t4 = Task(p.d)
2768  t5 = Task(p.d)
2769  t6 = Task(p.d)
2770  p.ct1 = ConditionalTask(p.d)
2771  s = Sequence(p.a*p.b)
2772  p.s4 = Sequence(p.a*p.b, p.ct1)
2773  s.associate(t2)
2774  p.s4.associate(t2)
2775  p.p = Path(p.c+s+p.a)
2776  p.p2 = Path(p.c+p.s4+p.a, p.ct1)
2777  p.e3 = EndPath(p.c+s+p.a)
2778  new = EDAnalyzer("NewAnalyzer")
2779  new2 = EDProducer("NewProducer")
2780  visitor1 = NodeVisitor()
2781  p.p.visit(visitor1)
2782  self.assertTrue(visitor1.modules == set([old,old2,p.b,p.c]))
2783  p.schedule = Schedule(tasks=[t6])
2784  p.globalReplace("a",new)
2785  p.globalReplace("d",new2)
2786  visitor2 = NodeVisitor()
2787  p.p.visit(visitor2)
2788  self.assertTrue(visitor2.modules == set([new,new2,p.b,p.c]))
2789  self.assertEqual(p.p.dumpPython()[:-1], "cms.Path(process.c+process.a+process.b+process.a, cms.Task(process.d))")
2790  visitor_p2 = NodeVisitor()
2791  p.p2.visit(visitor_p2)
2792  self.assertTrue(visitor_p2.modules == set([new,new2,p.b,p.c]))
2793  self.assertEqual(p.p2.dumpPython()[:-1], "cms.Path(process.c+process.s4+process.a, process.ct1)")
2794  visitor3 = NodeVisitor()
2795  p.e3.visit(visitor3)
2796  self.assertTrue(visitor3.modules == set([new,new2,p.b,p.c]))
2797  visitor4 = NodeVisitor()
2798  p.s4.visit(visitor4)
2799  self.assertTrue(visitor4.modules == set([new,new2,p.b]))
2800  self.assertEqual(p.s4.dumpPython()[:-1],"cms.Sequence(process.a+process.b, cms.Task(process.d), process.ct1)")
2801  visitor5 = NodeVisitor()
2802  p.t1.visit(visitor5)
2803  self.assertTrue(visitor5.modules == set([new2]))
2804  visitor6 = NodeVisitor()
2805  listOfTasks = list(p.schedule._tasks)
2806  listOfTasks[0].visit(visitor6)
2807  self.assertTrue(visitor6.modules == set([new2]))
2808  visitor7 = NodeVisitor()
2809  p.ct1.visit(visitor7)
2810  self.assertTrue(visitor7.modules == set([new2]))
2811  visitor8 = NodeVisitor()
2812  listOfConditionalTasks = list(p.conditionaltasks.values())
2813  listOfConditionalTasks[0].visit(visitor8)
2814  self.assertTrue(visitor8.modules == set([new2]))
2815 
2816 
2817  p.d2 = EDProducer("YourProducer")
2818  p.schedule = Schedule(p.p, p.p2, p.e3, tasks=[p.t1])
2819  self.assertEqual(p.schedule.dumpPython()[:-1], "cms.Schedule(*[ process.p, process.p2, process.e3 ], tasks=[process.t1])")
2820  p.p = Path(p.c+s)
2821  self.assertEqual(p.schedule.dumpPython()[:-1], "cms.Schedule(*[ process.p, process.p2, process.e3 ], tasks=[process.t1])")
2822  p.e3 = EndPath(p.c)
2823  self.assertEqual(p.schedule.dumpPython()[:-1], "cms.Schedule(*[ process.p, process.p2, process.e3 ], tasks=[process.t1])")
2824  p.t1 = Task(p.d2)
2825  self.assertEqual(p.schedule.dumpPython()[:-1], "cms.Schedule(*[ process.p, process.p2, process.e3 ], tasks=[process.t1])")
2826 

◆ testImplicitSchedule()

def Config.TestModuleCommand.testImplicitSchedule (   self)

Definition at line 3529 of file Config.py.

3529  def testImplicitSchedule(self):
3530  p = Process("test")
3531  p.a = EDAnalyzer("MyAnalyzer")
3532  p.b = EDAnalyzer("YourAnalyzer")
3533  p.c = EDAnalyzer("OurAnalyzer")
3534  p.path1 = Path(p.a)
3535  p.path2 = Path(p.b)
3536  self.assertTrue(p.schedule is None)
3537  pths = p.paths
3538  keys = pths.keys()
3539  self.assertEqual(pths[keys[0]],p.path1)
3540  self.assertEqual(pths[keys[1]],p.path2)
3541  p.prune()
3542  self.assertTrue(hasattr(p, 'a'))
3543  self.assertTrue(hasattr(p, 'b'))
3544  self.assertTrue(not hasattr(p, 'c'))
3545  self.assertTrue(hasattr(p, 'path1'))
3546  self.assertTrue(hasattr(p, 'path2'))
3547 
3548 
3549  p = Process("test")
3550  p.a = EDAnalyzer("MyAnalyzer")
3551  p.b = EDAnalyzer("YourAnalyzer")
3552  p.c = EDAnalyzer("OurAnalyzer")
3553  p.path2 = Path(p.b)
3554  p.path1 = Path(p.a)
3555  self.assertTrue(p.schedule is None)
3556  pths = p.paths
3557  keys = pths.keys()
3558  self.assertEqual(pths[keys[1]],p.path1)
3559  self.assertEqual(pths[keys[0]],p.path2)
3560 
3561 

◆ testMaxEvents()

def Config.TestModuleCommand.testMaxEvents (   self)

Definition at line 3604 of file Config.py.

3604  def testMaxEvents(self):
3605  p = Process("Test")
3606  p.maxEvents.input = 10
3607  self.assertEqual(p.maxEvents.input.value(),10)
3608  p = Process("Test")
3609  p.maxEvents.output = 10
3610  self.assertEqual(p.maxEvents.output.value(),10)
3611  p = Process("Test")
3612  p.maxEvents.output = PSet(out=untracked.int32(10))
3613  self.assertEqual(p.maxEvents.output.out.value(), 10)
3614  p = Process("Test")
3615  p.maxEvents = untracked.PSet(input = untracked.int32(5))
3616  self.assertEqual(p.maxEvents.input.value(), 5)
3617 
3618 
Definition: PSet.py:1

◆ testModifier()

def Config.TestModuleCommand.testModifier (   self)

Definition at line 4174 of file Config.py.

References submitPVValidationJobs.__init__(), and resolutioncreator_cfi.object.

4174  def testModifier(self):
4175  m1 = Modifier()
4176  Process._firstProcess = True
4177  p = Process("test")
4178  self.assertRaises(RuntimeError, lambda: Process("test2", m1))
4179  m1 = Modifier()
4180  Process._firstProcess = True
4181  p = Process("test",m1)
4182  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1))
4183  def _mod_fred(obj):
4184  obj.fred = 2
4185  m1.toModify(p.a,_mod_fred)
4186  self.assertEqual(p.a.fred.value(),2)
4187  p.b = EDAnalyzer("YourAnalyzer", wilma = int32(1))
4188  m1.toModify(p.b, wilma = 2)
4189  self.assertEqual(p.b.wilma.value(),2)
4190  self.assertTrue(p.isUsingModifier(m1))
4191  #check that Modifier not attached to a process doesn't run
4192  m1 = Modifier()
4193  Process._firstProcess = True
4194  p = Process("test")
4195  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1))
4196  m1.toModify(p.a,_mod_fred)
4197  p.b = EDAnalyzer("YourAnalyzer", wilma = int32(1))
4198  m1.toModify(p.b, wilma = 2)
4199  self.assertEqual(p.a.fred.value(),1)
4200  self.assertEqual(p.b.wilma.value(),1)
4201  self.assertEqual(p.isUsingModifier(m1),False)
4202  #make sure clones get the changes
4203  m1 = Modifier()
4204  Process._firstProcess = True
4205  p = Process("test",m1)
4206  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
4207  m1.toModify(p.a, fred = int32(2))
4208  p.b = p.a.clone(wilma = int32(3))
4209  self.assertEqual(p.a.fred.value(),2)
4210  self.assertEqual(p.a.wilma.value(),1)
4211  self.assertEqual(p.b.fred.value(),2)
4212  self.assertEqual(p.b.wilma.value(),3)
4213  #test removal of parameter
4214  m1 = Modifier()
4215  Process._firstProcess = True
4216  p = Process("test",m1)
4217  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1), fintstones = PSet(fred = int32(1)))
4218  m1.toModify(p.a, fred = None, fintstones = dict(fred = None))
4219  self.assertEqual(hasattr(p.a, "fred"), False)
4220  self.assertEqual(hasattr(p.a.fintstones, "fred"), False)
4221  self.assertEqual(p.a.wilma.value(),1)
4222  #test adding a parameter
4223  m1 = Modifier()
4224  Process._firstProcess = True
4225  p = Process("test",m1)
4226  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1))
4227  m1.toModify(p.a, wilma = int32(2))
4228  self.assertEqual(p.a.fred.value(), 1)
4229  self.assertEqual(p.a.wilma.value(),2)
4230  #test setting of value in PSet
4231  m1 = Modifier()
4232  Process._firstProcess = True
4233  p = Process("test",m1)
4234  p.a = EDAnalyzer("MyAnalyzer", flintstones = PSet(fred = int32(1), wilma = int32(1)))
4235  m1.toModify(p.a, flintstones = dict(fred = int32(2)))
4236  self.assertEqual(p.a.flintstones.fred.value(),2)
4237  self.assertEqual(p.a.flintstones.wilma.value(),1)
4238  #test proper exception from nonexisting parameter name
4239  m1 = Modifier()
4240  Process._firstProcess = True
4241  p = Process("test",m1)
4242  p.a = EDAnalyzer("MyAnalyzer", flintstones = PSet(fred = PSet(wilma = int32(1))))
4243  self.assertRaises(KeyError, lambda: m1.toModify(p.a, flintstones = dict(imnothere = dict(wilma=2))))
4244  self.assertRaises(KeyError, lambda: m1.toModify(p.a, foo = 1))
4245  #test setting a value in a VPSet
4246  m1 = Modifier()
4247  Process._firstProcess = True
4248  p = Process("test",m1)
4249  p.a = EDAnalyzer("MyAnalyzer", flintstones = VPSet(PSet(fred = int32(1)), PSet(wilma = int32(1))))
4250  m1.toModify(p.a, flintstones = {1:dict(wilma = int32(2))})
4251  self.assertEqual(p.a.flintstones[0].fred.value(),1)
4252  self.assertEqual(p.a.flintstones[1].wilma.value(),2)
4253  #test setting a value in a list of values
4254  m1 = Modifier()
4255  Process._firstProcess = True
4256  p = Process("test",m1)
4257  p.a = EDAnalyzer("MyAnalyzer", fred = vuint32(1,2,3))
4258  m1.toModify(p.a, fred = {1:7})
4259  self.assertEqual(p.a.fred[0],1)
4260  self.assertEqual(p.a.fred[1],7)
4261  self.assertEqual(p.a.fred[2],3)
4262  #test IndexError setting a value in a list to an item key not in the list
4263  m1 = Modifier()
4264  Process._firstProcess = True
4265  p = Process("test",m1)
4266  p.a = EDAnalyzer("MyAnalyzer", fred = vuint32(1,2,3))
4267  raised = False
4268  try: m1.toModify(p.a, fred = {5:7})
4269  except IndexError as e: raised = True
4270  self.assertEqual(raised, True)
4271  #test TypeError setting a value in a list using a key that is not an int
4272  m1 = Modifier()
4273  Process._firstProcess = True
4274  p = Process("test",m1)
4275  p.a = EDAnalyzer("MyAnalyzer", flintstones = VPSet(PSet(fred = int32(1)), PSet(wilma = int32(1))))
4276  raised = False
4277  try: m1.toModify(p.a, flintstones = dict(bogus = int32(37)))
4278  except TypeError as e: raised = True
4279  self.assertEqual(raised, True)
4280  #test that load causes process wide methods to run
4281  def _rem_a(proc):
4282  del proc.a
4283  class ProcModifierMod(object):
4284  def __init__(self,modifier,func):
4285  self.proc_mod_ = modifier.makeProcessModifier(func)
4286  class DummyMod(object):
4287  def __init__(self):
4288  self.a = EDAnalyzer("Dummy")
4289  testMod = DummyMod()
4290  p.extend(testMod)
4291  self.assertTrue(hasattr(p,"a"))
4292  m1 = Modifier()
4293  Process._firstProcess = True
4294  p = Process("test",m1)
4295  testProcMod = ProcModifierMod(m1,_rem_a)
4296  p.extend(testMod)
4297  p.extend(testProcMod)
4298  self.assertTrue(not hasattr(p,"a"))
4299  #test ModifierChain
4300  m1 = Modifier()
4301  mc = ModifierChain(m1)
4302  Process._firstProcess = True
4303  p = Process("test",mc)
4304  self.assertTrue(p.isUsingModifier(m1))
4305  self.assertTrue(p.isUsingModifier(mc))
4306  testMod = DummyMod()
4307  p.b = EDAnalyzer("Dummy2", fred = int32(1))
4308  m1.toModify(p.b, fred = int32(3))
4309  p.extend(testMod)
4310  testProcMod = ProcModifierMod(m1,_rem_a)
4311  p.extend(testProcMod)
4312  self.assertTrue(not hasattr(p,"a"))
4313  self.assertEqual(p.b.fred.value(),3)
4314  #check cloneAndExclude
4315  m1 = Modifier()
4316  m2 = Modifier()
4317  mc = ModifierChain(m1,m2)
4318  mclone = mc.copyAndExclude([m2])
4319  self.assertTrue(not mclone._isOrContains(m2))
4320  self.assertTrue(mclone._isOrContains(m1))
4321  m3 = Modifier()
4322  mc2 = ModifierChain(mc,m3)
4323  mclone = mc2.copyAndExclude([m2])
4324  self.assertTrue(not mclone._isOrContains(m2))
4325  self.assertTrue(mclone._isOrContains(m1))
4326  self.assertTrue(mclone._isOrContains(m3))
4327  #check combining
4328  m1 = Modifier()
4329  m2 = Modifier()
4330  Process._firstProcess = True
4331  p = Process("test",m1)
4332  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
4333  (m1 & m2).toModify(p.a, fred = int32(2))
4334  self.assertRaises(TypeError, lambda: (m1 & m2).toModify(p.a, 1, wilma=2))
4335  self.assertEqual(p.a.fred, 1)
4336  m1 = Modifier()
4337  m2 = Modifier()
4338  Process._firstProcess = True
4339  p = Process("test",m1,m2)
4340  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
4341  (m1 & m2).toModify(p.a, fred = int32(2))
4342  self.assertEqual(p.a.fred, 2)
4343  m1 = Modifier()
4344  m2 = Modifier()
4345  m3 = Modifier()
4346  Process._firstProcess = True
4347  p = Process("test",m1,m2,m3)
4348  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
4349  (m1 & m2 & m3).toModify(p.a, fred = int32(2))
4350  self.assertEqual(p.a.fred, 2)
4351  (m1 & (m2 & m3)).toModify(p.a, fred = int32(3))
4352  self.assertEqual(p.a.fred, 3)
4353  ((m1 & m2) & m3).toModify(p.a, fred = int32(4))
4354  self.assertEqual(p.a.fred, 4)
4355  #check inverse
4356  m1 = Modifier()
4357  m2 = Modifier()
4358  Process._firstProcess = True
4359  p = Process("test", m1)
4360  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
4361  (~m1).toModify(p.a, fred=2)
4362  self.assertEqual(p.a.fred, 1)
4363  (~m2).toModify(p.a, wilma=2)
4364  self.assertEqual(p.a.wilma, 2)
4365  self.assertRaises(TypeError, lambda: (~m1).toModify(p.a, 1, wilma=2))
4366  self.assertRaises(TypeError, lambda: (~m2).toModify(p.a, 1, wilma=2))
4367  # check or
4368  m1 = Modifier()
4369  m2 = Modifier()
4370  m3 = Modifier()
4371  Process._firstProcess = True
4372  p = Process("test", m1)
4373  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
4374  (m1 | m2).toModify(p.a, fred=2)
4375  self.assertEqual(p.a.fred, 2)
4376  (m1 | m2 | m3).toModify(p.a, fred=3)
4377  self.assertEqual(p.a.fred, 3)
4378  (m3 | m2 | m1).toModify(p.a, fred=4)
4379  self.assertEqual(p.a.fred, 4)
4380  ((m1 | m2) | m3).toModify(p.a, fred=5)
4381  self.assertEqual(p.a.fred, 5)
4382  (m1 | (m2 | m3)).toModify(p.a, fred=6)
4383  self.assertEqual(p.a.fred, 6)
4384  (m2 | m3).toModify(p.a, fred=7)
4385  self.assertEqual(p.a.fred, 6)
4386  self.assertRaises(TypeError, lambda: (m1 | m2).toModify(p.a, 1, wilma=2))
4387  self.assertRaises(TypeError, lambda: (m2 | m3).toModify(p.a, 1, wilma=2))
4388  # check combinations
4389  m1 = Modifier()
4390  m2 = Modifier()
4391  m3 = Modifier()
4392  m4 = Modifier()
4393  Process._firstProcess = True
4394  p = Process("test", m1, m2)
4395  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
4396  (m1 & ~m2).toModify(p.a, fred=2)
4397  self.assertEqual(p.a.fred, 1)
4398  (m1 & ~m3).toModify(p.a, fred=2)
4399  self.assertEqual(p.a.fred, 2)
4400  (m1 | ~m2).toModify(p.a, fred=3)
4401  self.assertEqual(p.a.fred, 3)
4402  (~m1 | ~m2).toModify(p.a, fred=4)
4403  self.assertEqual(p.a.fred, 3)
4404  (~m3 & ~m4).toModify(p.a, fred=4)
4405  self.assertEqual(p.a.fred, 4)
4406  ((m1 & m3) | ~m4).toModify(p.a, fred=5)
4407  self.assertEqual(p.a.fred, 5)
4408  #check toReplaceWith
4409  m1 = Modifier()
4410  Process._firstProcess = True
4411  p = Process("test",m1)
4412  p.a =EDAnalyzer("MyAnalyzer", fred = int32(1))
4413  m1.toReplaceWith(p.a, EDAnalyzer("YourAnalyzer", wilma = int32(3)))
4414  self.assertRaises(TypeError, lambda: m1.toReplaceWith(p.a, EDProducer("YourProducer")))
4415  #Task
4416  p.b =EDAnalyzer("BAn")
4417  p.c =EDProducer("c")
4418  p.d =EDProducer("d")
4419  p.tc = Task(p.c)
4420  p.td = Task(p.d)
4421  p.s = Sequence(p.a, p.tc)
4422  m1.toReplaceWith(p.s, Sequence(p.a+p.b, p.td))
4423  self.assertEqual(p.a.wilma.value(),3)
4424  self.assertEqual(p.a.type_(),"YourAnalyzer")
4425  self.assertEqual(hasattr(p,"fred"),False)
4426  self.assertTrue(p.s.dumpPython() == "cms.Sequence(process.a+process.b, process.td)\n")
4427  p.e =EDProducer("e")
4428  m1.toReplaceWith(p.td, Task(p.e))
4429  self.assertTrue(p.td._collection == OrderedSet([p.e]))
4430  #ConditionalTask
4431  p.b =EDAnalyzer("BAn")
4432  p.c =EDProducer("c")
4433  p.d =EDProducer("d")
4434  del p.tc
4435  del p.td
4436  p.tc = ConditionalTask(p.c)
4437  p.td = ConditionalTask(p.d)
4438  p.s = Sequence(p.a, p.tc)
4439  m1.toReplaceWith(p.s, Sequence(p.a+p.b, p.td))
4440  self.assertEqual(p.a.wilma.value(),3)
4441  self.assertEqual(p.a.type_(),"YourAnalyzer")
4442  self.assertEqual(hasattr(p,"fred"),False)
4443  self.assertTrue(p.s.dumpPython() == "cms.Sequence(process.a+process.b, process.td)\n")
4444  p.e =EDProducer("e")
4445  m1.toReplaceWith(p.td, ConditionalTask(p.e))
4446  self.assertTrue(p.td._collection == OrderedSet([p.e]))
4447  #check toReplaceWith doesn't activate not chosen
4448  m1 = Modifier()
4449  Process._firstProcess = True
4450  p = Process("test")
4451  p.a =EDAnalyzer("MyAnalyzer", fred = int32(1))
4452  m1.toReplaceWith(p.a, EDAnalyzer("YourAnalyzer", wilma = int32(3)))
4453  self.assertEqual(p.a.type_(),"MyAnalyzer")
4454  #check toReplaceWith and and/not/or combinations
4455  m1 = Modifier()
4456  m2 = Modifier()
4457  m3 = Modifier()
4458  m4 = Modifier()
4459  Process._firstProcess = True
4460  p = Process("test", m1, m2)
4461  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
4462  self.assertRaises(TypeError, lambda: (m1 & m2).toReplaceWith(p.a, EDProducer("YourProducer")))
4463  self.assertRaises(TypeError, lambda: (m3 & m4).toReplaceWith(p.a, EDProducer("YourProducer")))
4464  self.assertRaises(TypeError, lambda: (~m3).toReplaceWith(p.a, EDProducer("YourProducer")))
4465  self.assertRaises(TypeError, lambda: (~m1).toReplaceWith(p.a, EDProducer("YourProducer")))
4466  self.assertRaises(TypeError, lambda: (m1 | m3).toReplaceWith(p.a, EDProducer("YourProducer")))
4467  self.assertRaises(TypeError, lambda: (m3 | m4).toReplaceWith(p.a, EDProducer("YourProducer")))
4468  (m1 & m2).toReplaceWith(p.a, EDAnalyzer("YourAnalyzer1"))
4469  self.assertEqual(p.a.type_(), "YourAnalyzer1")
4470  (m1 & m3).toReplaceWith(p.a, EDAnalyzer("YourAnalyzer2"))
4471  self.assertEqual(p.a.type_(), "YourAnalyzer1")
4472  (~m1).toReplaceWith(p.a, EDAnalyzer("YourAnalyzer2"))
4473  self.assertEqual(p.a.type_(), "YourAnalyzer1")
4474  (~m3).toReplaceWith(p.a, EDAnalyzer("YourAnalyzer2"))
4475  self.assertEqual(p.a.type_(), "YourAnalyzer2")
4476  (m1 | m3).toReplaceWith(p.a, EDAnalyzer("YourAnalyzer3"))
4477  self.assertEqual(p.a.type_(), "YourAnalyzer3")
4478  (m3 | m4).toReplaceWith(p.a, EDAnalyzer("YourAnalyzer4"))
4479  self.assertEqual(p.a.type_(), "YourAnalyzer3")
4480  #check chaining of toModify and toReplaceWith
4481  m1 = Modifier()
4482  m2 = Modifier()
4483  m3 = Modifier()
4484  Process._firstProcess = True
4485  p = Process("test", m1, m2)
4486  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
4487  p.b = EDProducer("MyProducer", barney = int32(1), betty = int32(1))
4488  (m1 & m2).toModify(p.a, fred = 2).toModify(p.b, betty = 3)
4489  self.assertEqual(p.a.fred, 2)
4490  self.assertEqual(p.a.wilma, 1)
4491  self.assertEqual(p.b.barney, 1)
4492  self.assertEqual(p.b.betty, 3)
4493  (m1 | m3).toModify(p.a, wilma = 4).toModify(p.b, barney = 5)
4494  self.assertEqual(p.a.fred, 2)
4495  self.assertEqual(p.a.wilma, 4)
4496  self.assertEqual(p.b.barney, 5)
4497  self.assertEqual(p.b.betty, 3)
4498  (m2 & ~m3).toReplaceWith(p.a, EDAnalyzer("YourAnalyzer")).toModify(p.b, barney = 6)
4499  self.assertEqual(p.a.type_(), "YourAnalyzer")
4500  self.assertEqual(p.b.barney, 6)
4501  self.assertEqual(p.b.betty, 3)
4502  (m1 & ~m3).toModify(p.a, param=int32(42)).toReplaceWith(p.b, EDProducer("YourProducer"))
4503  self.assertEqual(p.a.type_(), "YourAnalyzer")
4504  self.assertEqual(p.a.param, 42)
4505  self.assertEqual(p.b.type_(), "YourProducer")
4506 
4507  # EDAlias
4508  a = EDAlias(foo2 = VPSet(PSet(type = string("Foo2"))))
4509  m = Modifier()
4510  m._setChosen()
4511  # Modify parameters
4512  m.toModify(a, foo2 = {0: dict(type = "Foo3")})
4513  self.assertEqual(a.foo2[0].type, "Foo3")
4514  # Add an alias
4515  m.toModify(a, foo4 = VPSet(PSet(type = string("Foo4"))))
4516  self.assertEqual(a.foo2[0].type, "Foo3")
4517  self.assertEqual(a.foo4[0].type, "Foo4")
4518  # Remove an alias
4519  m.toModify(a, foo2 = None)
4520  self.assertFalse(hasattr(a, "foo2"))
4521  self.assertEqual(a.foo4[0].type, "Foo4")
4522  # Replace (doesn't work out of the box because EDAlias is not _Parameterizable
4523  m.toReplaceWith(a, EDAlias(bar = VPSet(PSet(type = string("Bar")))))
4524  self.assertFalse(hasattr(a, "foo2"))
4525  self.assertFalse(hasattr(a, "foo4"))
4526  self.assertTrue(hasattr(a, "bar"))
4527  self.assertEqual(a.bar[0].type, "Bar")
4528 
4529  # SwitchProducer
4530  sp = SwitchProducerTest(test1 = EDProducer("Foo",
4531  a = int32(1),
4532  b = PSet(c = int32(2))),
4533  test2 = EDProducer("Bar",
4534  aa = int32(11),
4535  bb = PSet(cc = int32(12))))
4536  m = Modifier()
4537  m._setChosen()
4538  # Modify parameters
4539  m.toModify(sp,
4540  test1 = dict(a = 4, b = dict(c = None)),
4541  test2 = dict(aa = 15, bb = dict(cc = 45, dd = string("foo"))))
4542  self.assertEqual(sp.test1.a.value(), 4)
4543  self.assertEqual(sp.test1.b.hasParameter("c"), False)
4544  self.assertEqual(sp.test2.aa.value(), 15)
4545  self.assertEqual(sp.test2.bb.cc.value(), 45)
4546  self.assertEqual(sp.test2.bb.dd.value(), "foo")
4547  # Replace a producer
4548  m.toReplaceWith(sp.test1, EDProducer("Fred", x = int32(42)))
4549  self.assertEqual(sp.test1.type_(), "Fred")
4550  self.assertEqual(sp.test1.x.value(), 42)
4551  self.assertRaises(TypeError, lambda: m.toReplaceWith(sp.test1, EDAnalyzer("Foo")))
4552  # Alternative way (only to be allow same syntax to be used as for adding)
4553  m.toModify(sp, test2 = EDProducer("Xyzzy", x = int32(24)))
4554  self.assertEqual(sp.test2.type_(), "Xyzzy")
4555  self.assertEqual(sp.test2.x.value(), 24)
4556  self.assertRaises(TypeError, lambda: m.toModify(sp, test2 = EDAnalyzer("Foo")))
4557  # Add a producer
4558  m.toModify(sp, test3 = EDProducer("Wilma", y = int32(24)))
4559  self.assertEqual(sp.test3.type_(), "Wilma")
4560  self.assertEqual(sp.test3.y.value(), 24)
4561  self.assertRaises(TypeError, lambda: m.toModify(sp, test4 = EDAnalyzer("Foo")))
4562  # Remove a producer
4563  m.toModify(sp, test2 = None)
4564  self.assertEqual(hasattr(sp, "test2"), False)
4565  # Add an alias
4566  m.toModify(sp, test2 = EDAlias(foo = VPSet(PSet(type = string("int")))))
4567  self.assertTrue(hasattr(sp.test2, "foo"))
4568  # Replace an alias
4569  m.toReplaceWith(sp.test2, EDAlias(bar = VPSet(PSet(type = string("int")))))
4570  self.assertTrue(hasattr(sp.test2, "bar"))
4571  # Alternative way
4572  m.toModify(sp, test2 = EDAlias(xyzzy = VPSet(PSet(type = string("int")))))
4573  self.assertTrue(hasattr(sp.test2, "xyzzy"))
4574  # Replace an alias with EDProducer
4575  self.assertRaises(TypeError, lambda: m.toReplaceWith(sp.test2, EDProducer("Foo")))
4576  m.toModify(sp, test2 = EDProducer("Foo"))
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)
Definition: PSet.py:1

◆ testOptions()

def Config.TestModuleCommand.testOptions (   self)

Definition at line 3592 of file Config.py.

3592  def testOptions(self):
3593  p = Process('test')
3594  self.assertEqual(p.options.numberOfThreads.value(),1)
3595  p.options.numberOfThreads = 8
3596  self.assertEqual(p.options.numberOfThreads.value(),8)
3597  p.options = PSet()
3598  self.assertEqual(p.options.numberOfThreads.value(),1)
3599  p.options = dict(numberOfStreams =2,
3600  numberOfThreads =2)
3601  self.assertEqual(p.options.numberOfThreads.value(),2)
3602  self.assertEqual(p.options.numberOfStreams.value(),2)
3603 
Definition: PSet.py:1

◆ testOverride()

def Config.TestModuleCommand.testOverride (   self)

Definition at line 3569 of file Config.py.

3569  def testOverride(self):
3570  p = Process('test')
3571  a = EDProducer("A", a1=int32(0))
3572  self.assertTrue(not a.isModified())
3573  a.a1 = 1
3574  self.assertTrue(a.isModified())
3575  p.a = a
3576  self.assertEqual(p.a.a1.value(), 1)
3577  # try adding an unmodified module.
3578  # should accept it
3579  p.a = EDProducer("A", a1=int32(2))
3580  self.assertEqual(p.a.a1.value(), 2)
3581  # try adding a modified module. Should throw
3582  # no longer, since the same (modified) say, geometry
3583  # could come from more than one cff
3584  b = EDProducer("A", a1=int32(3))
3585  b.a1 = 4
3586  #self.assertRaises(RuntimeError, setattr, *(p,'a',b))
3587  ps1 = PSet(a = int32(1))
3588  ps2 = PSet(a = int32(2))
3589  self.assertRaises(ValueError, EDProducer, 'C', ps1, ps2)
3590  self.assertRaises(ValueError, EDProducer, 'C', ps1, a=int32(3))
3591 
Definition: PSet.py:1

◆ testParameterizable()

def Config.TestModuleCommand.testParameterizable (   self)

Definition at line 2277 of file Config.py.

2277  def testParameterizable(self):
2278  p = _Parameterizable()
2279  self.assertEqual(len(p.parameterNames_()),0)
2280  p.a = int32(1)
2281  self.assertTrue('a' in p.parameterNames_())
2282  self.assertEqual(p.a.value(), 1)
2283  p.a = 10
2284  self.assertEqual(p.a.value(), 10)
2285  p.a = untracked(int32(1))
2286  self.assertEqual(p.a.value(), 1)
2287  self.assertFalse(p.a.isTracked())
2288  p.a = untracked.int32(1)
2289  self.assertEqual(p.a.value(), 1)
2290  self.assertFalse(p.a.isTracked())
2291  p = _Parameterizable(foo=int32(10), bar = untracked(double(1.0)))
2292  self.assertEqual(p.foo.value(), 10)
2293  self.assertEqual(p.bar.value(),1.0)
2294  self.assertFalse(p.bar.isTracked())
2295  self.assertRaises(TypeError,setattr,(p,'c',1))
2296  p = _Parameterizable(a=PSet(foo=int32(10), bar = untracked(double(1.0))))
2297  self.assertEqual(p.a.foo.value(),10)
2298  self.assertEqual(p.a.bar.value(),1.0)
2299  p.b = untracked(PSet(fii = int32(1)))
2300  self.assertEqual(p.b.fii.value(),1)
2301  self.assertFalse(p.b.isTracked())
2302  #test the fact that values can be shared
2303  v = int32(10)
2304  p=_Parameterizable(a=v)
2305  v.setValue(11)
2306  self.assertEqual(p.a.value(),11)
2307  p.a = 12
2308  self.assertEqual(p.a.value(),12)
2309  self.assertEqual(v.value(),12)
untracked
Definition: Types.py:34
Definition: PSet.py:1

◆ testPath()

def Config.TestModuleCommand.testPath (   self)

Definition at line 3250 of file Config.py.

References SequenceTypes.ignore(), and str.

3250  def testPath(self):
3251  p = Process("test")
3252  p.a = EDAnalyzer("MyAnalyzer")
3253  p.b = EDAnalyzer("YourAnalyzer")
3254  p.c = EDAnalyzer("OurAnalyzer")
3255  path = Path(p.a)
3256  path *= p.b
3257  path += p.c
3258  self.assertEqual(str(path),'a+b+c')
3259  path = Path(p.a*p.b+p.c)
3260  self.assertEqual(str(path),'a+b+c')
3261 # path = Path(p.a)*p.b+p.c #This leads to problems with sequences
3262 # self.assertEqual(str(path),'((a*b)+c)')
3263  path = Path(p.a+ p.b*p.c)
3264  self.assertEqual(str(path),'a+b+c')
3265  path = Path(p.a*(p.b+p.c))
3266  self.assertEqual(str(path),'a+b+c')
3267  path = Path(p.a*(p.b+~p.c))
3268  pathx = Path(p.a*(p.b+ignore(p.c)))
3269  self.assertEqual(str(path),'a+b+~c')
3270  p.es = ESProducer("AnESProducer")
3271  self.assertRaises(TypeError,Path,p.es)
3272 
3273  t = Path()
3274  self.assertEqual(t.dumpPython(PrintOptions()), 'cms.Path()\n')
3275 
3276  t = Path(p.a)
3277  self.assertEqual(t.dumpPython(PrintOptions()), 'cms.Path(process.a)\n')
3278 
3279  t = Path(Task())
3280  self.assertEqual(t.dumpPython(PrintOptions()), 'cms.Path(cms.Task())\n')
3281 
3282  t = Path(p.a, Task())
3283  self.assertEqual(t.dumpPython(PrintOptions()), 'cms.Path(process.a, cms.Task())\n')
3284 
3285  p.prod = EDProducer("prodName")
3286  p.t1 = Task(p.prod)
3287  t = Path(p.a, p.t1, Task(), p.t1)
3288  self.assertEqual(t.dumpPython(PrintOptions()), 'cms.Path(process.a, cms.Task(), process.t1)\n')
3289 
3290  t = Path(ConditionalTask())
3291  self.assertEqual(t.dumpPython(PrintOptions()), 'cms.Path(cms.ConditionalTask())\n')
3292 
3293  t = Path(p.a, ConditionalTask())
3294  self.assertEqual(t.dumpPython(PrintOptions()), 'cms.Path(process.a, cms.ConditionalTask())\n')
3295 
3296  p.prod = EDProducer("prodName")
3297  p.t1 = ConditionalTask(p.prod)
3298  t = Path(p.a, p.t1, Task(), p.t1)
3299  self.assertEqual(t.dumpPython(PrintOptions()), 'cms.Path(process.a, cms.Task(), process.t1)\n')
3300 
def ignore(seq)
#define str(s)

◆ testPrefers()

def Config.TestModuleCommand.testPrefers (   self)

Definition at line 3631 of file Config.py.

References Config._lineDiff(), and ConfigBuilder.dumpPython().

3631  def testPrefers(self):
3632  p = Process("Test")
3633  p.add_(ESSource("ForceSource"))
3634  p.juicer = ESProducer("JuicerProducer")
3635  p.prefer("ForceSource")
3636  p.prefer("juicer")
3637  self.assertEqual(_lineDiff(p.dumpPython(), Process('Test').dumpPython()),
3638 """process.juicer = cms.ESProducer("JuicerProducer")
3639 process.ForceSource = cms.ESSource("ForceSource")
3640 process.prefer("ForceSource")
3641 process.prefer("juicer")""")
3642  p.prefer("juicer",fooRcd=vstring("Foo"))
3643  self.assertEqual(_lineDiff(p.dumpPython(), Process('Test').dumpPython()),
3644 """process.juicer = cms.ESProducer("JuicerProducer")
3645 process.ForceSource = cms.ESSource("ForceSource")
3646 process.prefer("ForceSource")
3647 process.prefer("juicer",
3648  fooRcd = cms.vstring('Foo')
3649 )""")
3650 
def _lineDiff(newString, oldString)
Definition: Config.py:2083
def dumpPython(process, name)

◆ testProcessAccelerator()

def Config.TestModuleCommand.testProcessAccelerator (   self)

Definition at line 4608 of file Config.py.

4608  def testProcessAccelerator(self):
4609  proc = Process("TEST")
4610  p = TestMakePSet()
4611  proc.fillProcessDesc(p)
4612  self.assertTrue(["cpu"], p.values["@available_accelerators"][1])
4613  self.assertFalse(p.values["@selected_accelerators"][0])
4614  self.assertTrue(["cpu"], p.values["@selected_accelerators"][1])
4615  self.assertFalse(p.values["@module_type_resolver"][0])
4616  self.assertEqual("", p.values["@module_type_resolver"][1])
4617 
4618  proc = Process("TEST")
4619  self.assertRaises(TypeError, setattr, proc, "processAcceleratorTest", ProcessAcceleratorTest())
4620  proc.ProcessAcceleratorTest = ProcessAcceleratorTest()
4621  del proc.MessageLogger # remove boilerplate unnecessary for this test case
4622  self.maxDiff = None
4623  self.assertEqual(proc.dumpPython(),
4624 """import FWCore.ParameterSet.Config as cms
4625 from test import ProcessAcceleratorTest
4626 
4627 process = cms.Process("TEST")
4628 
4629 process.maxEvents = cms.untracked.PSet(
4630  input = cms.optional.untracked.int32,
4631  output = cms.optional.untracked.allowed(cms.int32,cms.PSet)
4632 )
4633 
4634 process.maxLuminosityBlocks = cms.untracked.PSet(
4635  input = cms.untracked.int32(-1)
4636 )
4637 
4638 process.options = cms.untracked.PSet(
4639  FailPath = cms.untracked.vstring(),
4640  IgnoreCompletely = cms.untracked.vstring(),
4641  Rethrow = cms.untracked.vstring(),
4642  SkipEvent = cms.untracked.vstring(),
4643  accelerators = cms.untracked.vstring('*'),
4644  allowUnscheduled = cms.obsolete.untracked.bool,
4645  canDeleteEarly = cms.untracked.vstring(),
4646  deleteNonConsumedUnscheduledModules = cms.untracked.bool(True),
4647  dumpOptions = cms.untracked.bool(False),
4648  emptyRunLumiMode = cms.obsolete.untracked.string,
4649  eventSetup = cms.untracked.PSet(
4650  forceNumberOfConcurrentIOVs = cms.untracked.PSet(
4651  allowAnyLabel_=cms.required.untracked.uint32
4652  ),
4653  numberOfConcurrentIOVs = cms.untracked.uint32(0)
4654  ),
4655  fileMode = cms.untracked.string('FULLMERGE'),
4656  forceEventSetupCacheClearOnNewRun = cms.untracked.bool(False),
4657  holdsReferencesToDeleteEarly = cms.untracked.VPSet(),
4658  makeTriggerResults = cms.obsolete.untracked.bool,
4659  modulesToIgnoreForDeleteEarly = cms.untracked.vstring(),
4660  numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(0),
4661  numberOfConcurrentRuns = cms.untracked.uint32(1),
4662  numberOfStreams = cms.untracked.uint32(0),
4663  numberOfThreads = cms.untracked.uint32(1),
4664  printDependencies = cms.untracked.bool(False),
4665  sizeOfStackForThreadsInKB = cms.optional.untracked.uint32,
4666  throwIfIllegalParameter = cms.untracked.bool(True),
4667  wantSummary = cms.untracked.bool(False)
4668 )
4669 
4670 process.ProcessAcceleratorTest = ProcessAcceleratorTest(
4671  enabled = ['test1', 'test2', 'anothertest3']
4672 )
4673 
4674 
4675 """)
4676  p = TestMakePSet()
4677  proc.fillProcessDesc(p)
4678  self.assertEqual(["*"], p.values["options"][1].values["accelerators"][1])
4679  self.assertFalse(p.values["options"][1].values["accelerators"][0])
4680  self.assertTrue(["anothertest3", "cpu", "test1", "test2"], p.values["@selected_accelerators"][1])
4681  self.assertEqual("AcceleratorTestService", p.values["services"][1][0].values["@service_type"][1])
4682  self.assertFalse(p.values["@available_accelerators"][0])
4683  self.assertTrue(["anothertest3", "cpu", "test1", "test2"], p.values["@available_accelerators"][1])
4684  self.assertFalse(p.values["@module_type_resolver"][0])
4685  self.assertEqual("", p.values["@module_type_resolver"][1])
4686 
4687  proc = Process("TEST")
4688  proc.ProcessAcceleratorTest = ProcessAcceleratorTest()
4689  proc.add_(Service("AcceleratorTestServiceRemove"))
4690  p = TestMakePSet()
4691  proc.fillProcessDesc(p)
4692  services = [x.values["@service_type"][1] for x in p.values["services"][1]]
4693  self.assertTrue("AcceleratorTestService" in services)
4694  self.assertFalse("AcceleratorTestServiceRemove" in services)
4695 
4696  proc = Process("TEST")
4697  proc.ProcessAcceleratorTest = ProcessAcceleratorTest(enabled=["test1"])
4698  p = TestMakePSet()
4699  proc.fillProcessDesc(p)
4700  self.assertEqual(["cpu", "test1"], p.values["@selected_accelerators"][1])
4701  self.assertEqual(["cpu", "test1"], p.values["@available_accelerators"][1])
4702 
4703  proc = Process("TEST")
4704  proc.ProcessAcceleratorTest = ProcessAcceleratorTest()
4705  proc.options.accelerators = ["test2"]
4706  p = TestMakePSet()
4707  proc.fillProcessDesc(p)
4708  self.assertEqual(["test2"], p.values["@selected_accelerators"][1])
4709  self.assertEqual(["anothertest3", "cpu", "test1", "test2"], p.values["@available_accelerators"][1])
4710 
4711  proc = Process("TEST")
4712  proc.ProcessAcceleratorTest = ProcessAcceleratorTest()
4713  proc.options.accelerators = ["test*"]
4714  proc.fillProcessDesc(p)
4715  self.assertEqual(["test1", "test2"], p.values["@selected_accelerators"][1])
4716  self.assertEqual(["anothertest3", "cpu", "test1", "test2"], p.values["@available_accelerators"][1])
4717 
4718  proc = Process("TEST")
4719  proc.ProcessAcceleratorTest = ProcessAcceleratorTest(enabled=["test1"])
4720  proc.options.accelerators = ["test2"]
4721  p = TestMakePSet()
4722  proc.fillProcessDesc(p)
4723  self.assertEqual([], p.values["@selected_accelerators"][1])
4724  self.assertEqual(["cpu", "test1"], p.values["@available_accelerators"][1])
4725 
4726  proc = Process("TEST")
4727  proc.ProcessAcceleratorTest = ProcessAcceleratorTest()
4728  proc.options.accelerators = ["cpu*"]
4729  p = TestMakePSet()
4730  proc.fillProcessDesc(p)
4731  self.assertEqual(["cpu"], p.values["@selected_accelerators"][1])
4732  self.assertEqual(["anothertest3", "cpu", "test1", "test2"], p.values["@available_accelerators"][1])
4733 
4734  proc = Process("TEST")
4735  proc.ProcessAcceleratorTest = ProcessAcceleratorTest()
4736  proc.options.accelerators = ["test3"]
4737  p = TestMakePSet()
4738  self.assertRaises(ValueError, proc.fillProcessDesc, p)
4739 
4740  proc = Process("TEST")
4741  proc.ProcessAcceleratorTest = ProcessAcceleratorTest()
4742  proc.options.accelerators = ["*", "test1"]
4743  p = TestMakePSet()
4744  self.assertRaises(ValueError, proc.fillProcessDesc, p)
4745 
4746  proc = Process("TEST")
4747  proc.ProcessAcceleratorTest = ProcessAcceleratorTest()
4748  proc.ProcessAcceleratorTest2 = ProcessAcceleratorTest2()
4749  p = TestMakePSet()
4750  proc.fillProcessDesc(p)
4751  self.assertEqual(["anothertest3", "anothertest4", "cpu", "test1", "test2"], p.values["@selected_accelerators"][1])
4752  self.assertEqual(["anothertest3", "anothertest4", "cpu", "test1", "test2"], p.values["@available_accelerators"][1])
4753 
4754  proc = Process("TEST")
4755  proc.ProcessAcceleratorTest = ProcessAcceleratorTest()
4756  proc.ProcessAcceleratorTest2 = ProcessAcceleratorTest2()
4757  proc.options.accelerators = ["*test3", "c*"]
4758  p = TestMakePSet()
4759  proc.fillProcessDesc(p)
4760  self.assertEqual(["anothertest3", "cpu"], p.values["@selected_accelerators"][1])
4761  self.assertEqual(["anothertest3", "anothertest4", "cpu", "test1", "test2"], p.values["@available_accelerators"][1])
4762 
4763  proc = Process("TEST")
4764  proc.ProcessAcceleratorTest = ProcessAcceleratorTest()
4765  proc.sp = SwitchProducerTest2(test2 = EDProducer("Foo",
4766  a = int32(1),
4767  b = PSet(c = int32(2))),
4768  test1 = EDProducer("Bar",
4769  aa = int32(11),
4770  bb = PSet(cc = int32(12))))
4771  proc.p = Path(proc.sp)
4772  p = TestMakePSet()
4773  proc.fillProcessDesc(p)
4774  self.assertEqual((False, "sp@test2"), p.values["sp"][1].values["@chosen_case"])
4775 
4776  proc = Process("TEST")
4777  proc.ProcessAcceleratorTest = ProcessAcceleratorTest(enabled=["test1"])
4778  proc.sp = SwitchProducerTest2(test2 = EDProducer("Foo",
4779  a = int32(1),
4780  b = PSet(c = int32(2))),
4781  test1 = EDProducer("Bar",
4782  aa = int32(11),
4783  bb = PSet(cc = int32(12))))
4784  proc.p = Path(proc.sp)
4785  p = TestMakePSet()
4786  proc.fillProcessDesc(p)
4787  self.assertEqual((False, "sp@test1"), p.values["sp"][1].values["@chosen_case"])
4788 
4789  proc = Process("TEST")
4790  proc.ProcessAcceleratorTest = ProcessAcceleratorTest()
4791  proc.options.accelerators = ["test1"]
4792  proc.sp = SwitchProducerTest2(test2 = EDProducer("Foo",
4793  a = int32(1),
4794  b = PSet(c = int32(2))),
4795  test1 = EDProducer("Bar",
4796  aa = int32(11),
4797  bb = PSet(cc = int32(12))))
4798  proc.p = Path(proc.sp)
4799  p = TestMakePSet()
4800  proc.fillProcessDesc(p)
4801  self.assertEqual((False, "sp@test1"), p.values["sp"][1].values["@chosen_case"])
4802 
4803  proc = Process("TEST")
4804  proc.ProcessAcceleratorTest = ProcessAcceleratorTest()
4805  proc.options.accelerators = ["test*"]
4806  proc.sp = SwitchProducerTest2(test2 = EDProducer("Foo",
4807  a = int32(1),
4808  b = PSet(c = int32(2))),
4809  test1 = EDProducer("Bar",
4810  aa = int32(11),
4811  bb = PSet(cc = int32(12))))
4812  proc.p = Path(proc.sp)
4813  p = TestMakePSet()
4814  proc.fillProcessDesc(p)
4815  self.assertEqual((False, "sp@test2"), p.values["sp"][1].values["@chosen_case"])
4816 
4817  proc = Process("TEST")
4818  proc.ProcessAcceleratorTest = ProcessAcceleratorTest()
4819  proc.options.accelerators = ["anothertest3"]
4820  proc.sp = SwitchProducerTest2(test2 = EDProducer("Foo",
4821  a = int32(1),
4822  b = PSet(c = int32(2))),
4823  test1 = EDProducer("Bar",
4824  aa = int32(11),
4825  bb = PSet(cc = int32(12))))
4826  proc.p = Path(proc.sp)
4827  p = TestMakePSet()
4828  self.assertRaises(RuntimeError, proc.fillProcessDesc, p)
4829 
4830  proc = Process("TEST")
4831  proc.ProcessAcceleratorTest = ProcessAcceleratorTest(
4832  moduleTypeResolverMaker=lambda accelerators: TestModuleTypeResolver(accelerators))
4833  proc.ProcessAcceleratorTest2 = ProcessAcceleratorTest2()
4834  proc.normalProducer = EDProducer("FooProducer")
4835  proc.testProducer = EDProducer("BarProducer@test")
4836  proc.test2Producer = EDProducer("BarProducer@test", test=untracked.PSet(backend=untracked.string("test2_backend")))
4837  proc.testAnalyzer = EDAnalyzer("Analyzer@test")
4838  proc.testFilter = EDAnalyzer("Filter@test")
4839  proc.testESProducer = ESProducer("ESProducer@test")
4840  proc.testESSource = ESSource("ESSource@test")
4841  proc.p = Path(proc.normalProducer+proc.testProducer+proc.test2Producer+proc.testAnalyzer+proc.testFilter)
4842  p = TestMakePSet()
4843  proc.fillProcessDesc(p)
4844  self.assertEqual("TestModuleTypeResolver", p.values["@module_type_resolver"][1])
4845  self.assertEqual("FooProducer", p.values["normalProducer"][1].values["@module_type"][1])
4846  self.assertEqual(len(list(filter(lambda x: not "@" in x, p.values["normalProducer"][1].values.keys()))), 0)
4847  self.assertEqual("BarProducer@test", p.values["testProducer"][1].values["@module_type"][1])
4848  self.assertEqual(False, p.values["testProducer"][1].values["test"][0])
4849  self.assertEqual(False, p.values["testProducer"][1].values["test"][1].values["backend"][0])
4850  self.assertEqual("test1_backend", p.values["testProducer"][1].values["test"][1].values["backend"][1])
4851  self.assertEqual("BarProducer@test", p.values["test2Producer"][1].values["@module_type"][1])
4852  self.assertEqual("test2_backend", p.values["test2Producer"][1].values["test"][1].values["backend"][1])
4853  self.assertEqual("Analyzer@test", p.values["testAnalyzer"][1].values["@module_type"][1])
4854  self.assertEqual("test1_backend", p.values["testAnalyzer"][1].values["test"][1].values["backend"][1])
4855  self.assertEqual("Filter@test", p.values["testFilter"][1].values["@module_type"][1])
4856  self.assertEqual("test1_backend", p.values["testFilter"][1].values["test"][1].values["backend"][1])
4857  self.assertEqual("ESProducer@test", p.values["ESProducer@test@testESProducer"][1].values["@module_type"][1])
4858  self.assertEqual("test1_backend", p.values["ESProducer@test@testESProducer"][1].values["test"][1].values["backend"][1])
4859  self.assertEqual("ESSource@test", p.values["ESSource@test@testESSource"][1].values["@module_type"][1])
4860  self.assertEqual("test1_backend", p.values["ESSource@test@testESSource"][1].values["test"][1].values["backend"][1])
4861 
4862  # No required accelerators available
4863  proc = Process("Test")
4864  proc.ProcessAcceleratorTest = ProcessAcceleratorTest(
4865  moduleTypeResolverMaker=lambda accelerators: TestModuleTypeResolver(accelerators))
4866  proc.options.accelerators = []
4867  self.assertRaises(EDMException, proc.fillProcessDesc, p)
4868 
4869  proc = Process("Test")
4870  proc.ProcessAcceleratorTest = ProcessAcceleratorTest(
4871  moduleTypeResolverMaker=lambda accelerators: TestModuleTypeResolver(accelerators))
4872  proc.options.accelerators = ["test1"]
4873  proc.test2Producer = EDProducer("BarProducer@test", test=untracked.PSet(backend=untracked.string("test2_backend")))
4874  proc.p = Path(proc.test2Producer)
4875  self.assertRaises(EDMException, proc.fillProcessDesc, p)
4876 
4877  # Two ProcessAccelerators return type resolver
4878  proc = Process("TEST")
4879  proc.ProcessAcceleratorTest = ProcessAcceleratorTest(
4880  moduleTypeResolverMaker=lambda accelerators: TestModuleTypeResolver(accelerators))
4881  proc.ProcessAcceleratorTest2 = ProcessAcceleratorTest2(
4882  moduleTypeResolverMaker=lambda accelerators: TestModuleTypeResolver(accelerators))
4883  p = TestMakePSet()
4884  self.assertRaises(RuntimeError, proc.fillProcessDesc, p)
4885 
4886  import pickle
4887  proc = Process("TEST")
4888  proc.ProcessAcceleratorTest = ProcessAcceleratorTest()
4889  proc.sp = SwitchProducerTest2(test2 = EDProducer("Foo",
4890  a = int32(1),
4891  b = PSet(c = int32(2))),
4892  test1 = EDProducer("Bar",
4893  aa = int32(11),
4894  bb = PSet(cc = int32(12))))
4895  proc.p = Path(proc.sp)
4896  pkl = pickle.dumps(proc)
4897  unpkl = pickle.loads(pkl)
4898  p = TestMakePSet()
4899  unpkl.fillProcessDesc(p)
4900  self.assertEqual((False, "sp@test2"), p.values["sp"][1].values["@chosen_case"])
4901  self.assertEqual(["anothertest3", "cpu", "test1", "test2"], p.values["@available_accelerators"][1])
4902  unpkl = pickle.loads(pkl)
4903  unpkl.ProcessAcceleratorTest.setEnabled(["test1"])
4904  p = TestMakePSet()
4905  unpkl.fillProcessDesc(p)
4906  self.assertEqual((False, "sp@test1"), p.values["sp"][1].values["@chosen_case"])
4907  self.assertEqual(["cpu", "test1"], p.values["@available_accelerators"][1])
4908 
4909  unittest.main()
Definition: PSet.py:1

◆ testProcessDumpPython()

def Config.TestModuleCommand.testProcessDumpPython (   self)

Definition at line 2437 of file Config.py.

References Config._lineDiff(), and ConfigBuilder.dumpPython().

2437  def testProcessDumpPython(self):
2438  self.assertEqual(Process("test").dumpPython(),
2439 """import FWCore.ParameterSet.Config as cms
2440 
2441 process = cms.Process("test")
2442 
2443 process.maxEvents = cms.untracked.PSet(
2444  input = cms.optional.untracked.int32,
2445  output = cms.optional.untracked.allowed(cms.int32,cms.PSet)
2446 )
2447 
2448 process.maxLuminosityBlocks = cms.untracked.PSet(
2449  input = cms.untracked.int32(-1)
2450 )
2451 
2452 process.options = cms.untracked.PSet(
2453  FailPath = cms.untracked.vstring(),
2454  IgnoreCompletely = cms.untracked.vstring(),
2455  Rethrow = cms.untracked.vstring(),
2456  SkipEvent = cms.untracked.vstring(),
2457  accelerators = cms.untracked.vstring('*'),
2458  allowUnscheduled = cms.obsolete.untracked.bool,
2459  canDeleteEarly = cms.untracked.vstring(),
2460  deleteNonConsumedUnscheduledModules = cms.untracked.bool(True),
2461  dumpOptions = cms.untracked.bool(False),
2462  emptyRunLumiMode = cms.obsolete.untracked.string,
2463  eventSetup = cms.untracked.PSet(
2464  forceNumberOfConcurrentIOVs = cms.untracked.PSet(
2465  allowAnyLabel_=cms.required.untracked.uint32
2466  ),
2467  numberOfConcurrentIOVs = cms.untracked.uint32(0)
2468  ),
2469  fileMode = cms.untracked.string('FULLMERGE'),
2470  forceEventSetupCacheClearOnNewRun = cms.untracked.bool(False),
2471  holdsReferencesToDeleteEarly = cms.untracked.VPSet(),
2472  makeTriggerResults = cms.obsolete.untracked.bool,
2473  modulesToIgnoreForDeleteEarly = cms.untracked.vstring(),
2474  numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(0),
2475  numberOfConcurrentRuns = cms.untracked.uint32(1),
2476  numberOfStreams = cms.untracked.uint32(0),
2477  numberOfThreads = cms.untracked.uint32(1),
2478  printDependencies = cms.untracked.bool(False),
2479  sizeOfStackForThreadsInKB = cms.optional.untracked.uint32,
2480  throwIfIllegalParameter = cms.untracked.bool(True),
2481  wantSummary = cms.untracked.bool(False)
2482 )
2483 
2484 process.MessageLogger = cms.Service("MessageLogger",
2485  cerr = cms.untracked.PSet(
2486  FwkReport = cms.untracked.PSet(
2487  limit = cms.untracked.int32(10000000),
2488  reportEvery = cms.untracked.int32(1)
2489  ),
2490  FwkSummary = cms.untracked.PSet(
2491  limit = cms.untracked.int32(10000000),
2492  reportEvery = cms.untracked.int32(1)
2493  ),
2494  INFO = cms.untracked.PSet(
2495  limit = cms.untracked.int32(0)
2496  ),
2497  Root_NoDictionary = cms.untracked.PSet(
2498  limit = cms.untracked.int32(0)
2499  ),
2500  default = cms.untracked.PSet(
2501  limit = cms.untracked.int32(10000000)
2502  ),
2503  enable = cms.untracked.bool(True),
2504  enableStatistics = cms.untracked.bool(False),
2505  lineLength = cms.optional.untracked.int32,
2506  noLineBreaks = cms.optional.untracked.bool,
2507  noTimeStamps = cms.untracked.bool(False),
2508  resetStatistics = cms.untracked.bool(False),
2509  statisticsThreshold = cms.untracked.string('WARNING'),
2510  threshold = cms.untracked.string('INFO'),
2511  allowAnyLabel_=cms.optional.untracked.PSetTemplate(
2512  limit = cms.optional.untracked.int32,
2513  reportEvery = cms.untracked.int32(1),
2514  timespan = cms.optional.untracked.int32
2515  )
2516  ),
2517  cout = cms.untracked.PSet(
2518  enable = cms.untracked.bool(False),
2519  enableStatistics = cms.untracked.bool(False),
2520  lineLength = cms.optional.untracked.int32,
2521  noLineBreaks = cms.optional.untracked.bool,
2522  noTimeStamps = cms.optional.untracked.bool,
2523  resetStatistics = cms.untracked.bool(False),
2524  statisticsThreshold = cms.optional.untracked.string,
2525  threshold = cms.optional.untracked.string,
2526  allowAnyLabel_=cms.optional.untracked.PSetTemplate(
2527  limit = cms.optional.untracked.int32,
2528  reportEvery = cms.untracked.int32(1),
2529  timespan = cms.optional.untracked.int32
2530  )
2531  ),
2532  debugModules = cms.untracked.vstring(),
2533  default = cms.untracked.PSet(
2534  limit = cms.optional.untracked.int32,
2535  lineLength = cms.untracked.int32(80),
2536  noLineBreaks = cms.untracked.bool(False),
2537  noTimeStamps = cms.untracked.bool(False),
2538  reportEvery = cms.untracked.int32(1),
2539  statisticsThreshold = cms.untracked.string('INFO'),
2540  threshold = cms.untracked.string('INFO'),
2541  timespan = cms.optional.untracked.int32,
2542  allowAnyLabel_=cms.optional.untracked.PSetTemplate(
2543  limit = cms.optional.untracked.int32,
2544  reportEvery = cms.untracked.int32(1),
2545  timespan = cms.optional.untracked.int32
2546  )
2547  ),
2548  files = cms.untracked.PSet(
2549  allowAnyLabel_=cms.optional.untracked.PSetTemplate(
2550  enableStatistics = cms.untracked.bool(False),
2551  extension = cms.optional.untracked.string,
2552  filename = cms.optional.untracked.string,
2553  lineLength = cms.optional.untracked.int32,
2554  noLineBreaks = cms.optional.untracked.bool,
2555  noTimeStamps = cms.optional.untracked.bool,
2556  output = cms.optional.untracked.string,
2557  resetStatistics = cms.untracked.bool(False),
2558  statisticsThreshold = cms.optional.untracked.string,
2559  threshold = cms.optional.untracked.string,
2560  allowAnyLabel_=cms.optional.untracked.PSetTemplate(
2561  limit = cms.optional.untracked.int32,
2562  reportEvery = cms.untracked.int32(1),
2563  timespan = cms.optional.untracked.int32
2564  )
2565  )
2566  ),
2567  suppressDebug = cms.untracked.vstring(),
2568  suppressFwkInfo = cms.untracked.vstring(),
2569  suppressInfo = cms.untracked.vstring(),
2570  suppressWarning = cms.untracked.vstring(),
2571  allowAnyLabel_=cms.optional.untracked.PSetTemplate(
2572  limit = cms.optional.untracked.int32,
2573  reportEvery = cms.untracked.int32(1),
2574  timespan = cms.optional.untracked.int32
2575  )
2576 )
2577 
2578 
2579 """)
2580  p = Process("test")
2581  p.a = EDAnalyzer("MyAnalyzer")
2582  p.p = Path(p.a)
2583  p.s = Sequence(p.a)
2584  p.r = Sequence(p.s)
2585  p.p2 = Path(p.s)
2586  p.schedule = Schedule(p.p2,p.p)
2587  d=p.dumpPython()
2588  self.assertEqual(_lineDiff(d,Process("test").dumpPython()),
2589 """process.a = cms.EDAnalyzer("MyAnalyzer")
2590 process.s = cms.Sequence(process.a)
2591 process.r = cms.Sequence(process.s)
2592 process.p = cms.Path(process.a)
2593 process.p2 = cms.Path(process.s)
2594 process.schedule = cms.Schedule(*[ process.p2, process.p ])""")
2595  #Reverse order of 'r' and 's'
2596  p = Process("test")
2597  p.a = EDAnalyzer("MyAnalyzer")
2598  p.p = Path(p.a)
2599  p.r = Sequence(p.a)
2600  p.s = Sequence(p.r)
2601  p.p2 = Path(p.r)
2602  p.schedule = Schedule(p.p2,p.p)
2603  p.b = EDAnalyzer("YourAnalyzer")
2604  d=p.dumpPython()
2605  self.assertEqual(_lineDiff(d,Process("test").dumpPython()),
2606 """process.a = cms.EDAnalyzer("MyAnalyzer")
2607 process.b = cms.EDAnalyzer("YourAnalyzer")
2608 process.r = cms.Sequence(process.a)
2609 process.s = cms.Sequence(process.r)
2610 process.p = cms.Path(process.a)
2611 process.p2 = cms.Path(process.r)
2612 process.schedule = cms.Schedule(*[ process.p2, process.p ])""")
def _lineDiff(newString, oldString)
Definition: Config.py:2083
def dumpPython(process, name)

◆ testProcessExtend()

def Config.TestModuleCommand.testProcessExtend (   self)

Definition at line 2342 of file Config.py.

References submitPVValidationJobs.__init__(), resolutioncreator_cfi.object, and str.

2342  def testProcessExtend(self):
2343  class FromArg(object):
2344  def __init__(self,*arg,**args):
2345  for name in args.keys():
2346  self.__dict__[name]=args[name]
2347 
2348  a=EDAnalyzer("MyAnalyzer")
2349  t=EDAnalyzer("MyAnalyzer")
2350  t.setLabel("foo")
2351  s1 = Sequence(a)
2352  s2 = Sequence(s1)
2353  s3 = Sequence(s2)
2354  d = FromArg(
2355  a=a,
2356  b=Service("Full"),
2357  c=Path(a),
2358  d=s2,
2359  e=s1,
2360  f=s3,
2361  g=Sequence(s1+s2+s3)
2362  )
2363  p = Process("Test")
2364  p.extend(d)
2365  self.assertEqual(p.a.type_(),"MyAnalyzer")
2366  self.assertEqual(p.a.label_(),"a")
2367  self.assertRaises(AttributeError,getattr,p,'b')
2368  self.assertEqual(p.Full.type_(),"Full")
2369  self.assertEqual(str(p.c),'a')
2370  self.assertEqual(str(p.d),'a')
2371 
2372  z1 = FromArg(
2373  a=a,
2374  b=Service("Full"),
2375  c=Path(a),
2376  d=s2,
2377  e=s1,
2378  f=s3,
2379  s4=s3,
2380  g=Sequence(s1+s2+s3)
2381  )
2382 
2383  p1 = Process("Test")
2384  #p1.extend(z1)
2385  self.assertRaises(ValueError, p1.extend, z1)
2386 
2387  z2 = FromArg(
2388  a=a,
2389  b=Service("Full"),
2390  c=Path(a),
2391  d=s2,
2392  e=s1,
2393  f=s3,
2394  aaa=copy.deepcopy(a),
2395  s4=copy.deepcopy(s3),
2396  g=Sequence(s1+s2+s3),
2397  t=t
2398  )
2399  p2 = Process("Test")
2400  p2.extend(z2)
2401  #self.assertRaises(ValueError, p2.extend, z2)
2402  self.assertEqual(p2.s4.label_(),"s4")
2403  #p2.s4.setLabel("foo")
2404  self.assertRaises(ValueError, p2.s4.setLabel, "foo")
2405  p2.s4.setLabel("s4")
2406  p2.s4.setLabel(None)
2407  p2.s4.setLabel("foo")
2408  p2._Process__setObjectLabel(p2.s4, "foo")
2409  p2._Process__setObjectLabel(p2.s4, None)
2410  p2._Process__setObjectLabel(p2.s4, "bar")
2411 
2412 
2413  p = Process('test')
2414  p.a = EDProducer("MyProducer")
2415  p.t = Task(p.a)
2416  p.p = Path(p.t)
2417  self.assertRaises(ValueError, p.extend, FromArg(a = EDProducer("YourProducer")))
2418  self.assertRaises(ValueError, p.extend, FromArg(a = EDAlias()))
2419  self.assertRaises(ValueError, p.__setattr__, "a", EDAlias())
2420 
2421  p = Process('test')
2422  p.a = EDProducer("MyProducer")
2423  p.t = ConditionalTask(p.a)
2424  p.p = Path(p.t)
2425  self.assertRaises(ValueError, p.extend, FromArg(a = EDProducer("YourProducer")))
2426  self.assertRaises(ValueError, p.extend, FromArg(a = EDAlias()))
2427  self.assertRaises(ValueError, p.__setattr__, "a", EDAlias())
2428 
2429  p = Process('test')
2430  p.a = EDProducer("MyProducer")
2431  p.s = Sequence(p.a)
2432  p.p = Path(p.s)
2433  self.assertRaises(ValueError, p.extend, FromArg(a = EDProducer("YourProducer")))
2434  self.assertRaises(ValueError, p.extend, FromArg(a = EDAlias()))
2435  self.assertRaises(ValueError, p.__setattr__, "a", EDAlias())
2436 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)
#define str(s)

◆ testProcessForProcessAccelerator()

def Config.TestModuleCommand.testProcessForProcessAccelerator (   self)

Definition at line 4594 of file Config.py.

4594  def testProcessForProcessAccelerator(self):
4595  proc = Process("TEST")
4596  p = ProcessForProcessAccelerator(proc)
4597  p.TestService = Service("TestService")
4598  self.assertTrue(hasattr(proc, "TestService"))
4599  self.assertEqual(proc.TestService.type_(), "TestService")
4600  self.assertRaises(TypeError, setattr, p, "a", EDProducer("Foo"))
4601  p.add_(Service("TestServiceTwo"))
4602  self.assertTrue(hasattr(proc, "TestServiceTwo"))
4603  self.assertEqual(proc.TestServiceTwo.type_(), "TestServiceTwo")
4604  p.TestService.foo = untracked.uint32(42)
4605  self.assertEqual(proc.TestService.foo.value(), 42)
4606  proc.mod = EDProducer("Producer")
4607  self.assertRaises(TypeError, getattr, p, "mod")

◆ testProcessFragment()

def Config.TestModuleCommand.testProcessFragment (   self)

Definition at line 4577 of file Config.py.

4577  def testProcessFragment(self):
4578  #check defaults are not overwritten
4579  f = ProcessFragment('Fragment')
4580  p = Process('PROCESS')
4581  p.maxEvents.input = 10
4582  p.options.numberOfThreads = 4
4583  p.maxLuminosityBlocks.input = 2
4584  p.extend(f)
4585  self.assertEqual(p.maxEvents.input.value(),10)
4586  self.assertEqual(p.options.numberOfThreads.value(), 4)
4587  self.assertEqual(p.maxLuminosityBlocks.input.value(),2)
4588  #general checks
4589  f = ProcessFragment("Fragment")
4590  f.fltr = EDFilter("Foo")
4591  p = Process('PROCESS')
4592  p.extend(f)
4593  self.assertTrue(hasattr(p,'fltr'))

◆ testProcessInsertion()

def Config.TestModuleCommand.testProcessInsertion (   self)

Definition at line 2317 of file Config.py.

2317  def testProcessInsertion(self):
2318  p = Process("test")
2319  p.a = EDAnalyzer("MyAnalyzer")
2320  self.assertTrue( 'a' in p.analyzers_() )
2321  self.assertTrue( 'a' in p.analyzers)
2322  p.add_(Service("SomeService"))
2323  self.assertTrue('SomeService' in p.services_())
2324  self.assertEqual(p.SomeService.type_(), "SomeService")
2325  p.Tracer = Service("Tracer")
2326  self.assertTrue('Tracer' in p.services_())
2327  self.assertRaises(TypeError, setattr, *(p,'b',"this should fail"))
2328  self.assertRaises(TypeError, setattr, *(p,'bad',Service("MessageLogger")))
2329  self.assertRaises(ValueError, setattr, *(p,'bad',Source("PoolSource")))
2330  p.out = OutputModule("Outer")
2331  self.assertEqual(p.out.type_(), 'Outer')
2332  self.assertTrue( 'out' in p.outputModules_() )
2333 
2334  p.geom = ESSource("GeomProd")
2335  self.assertTrue('geom' in p.es_sources_())
2336  p.add_(ESSource("ConfigDB"))
2337  self.assertTrue('ConfigDB' in p.es_sources_())
2338 
2339  p.aliasfoo1 = EDAlias(foo1 = VPSet(PSet(type = string("Foo1"))))
2340  self.assertTrue('aliasfoo1' in p.aliases_())
2341 
Definition: PSet.py:1

◆ testPrune()

def Config.TestModuleCommand.testPrune (   self)

Definition at line 3828 of file Config.py.

3828  def testPrune(self):
3829  p = Process("test")
3830  p.a = EDAnalyzer("MyAnalyzer")
3831  p.b = EDAnalyzer("YourAnalyzer")
3832  p.c = EDAnalyzer("OurAnalyzer")
3833  p.d = EDAnalyzer("OurAnalyzer")
3834  p.e = EDProducer("MyProducer")
3835  p.f = EDProducer("YourProducer")
3836  p.g = EDProducer("TheirProducer")
3837  p.h = EDProducer("OnesProducer")
3838  p.s = Sequence(p.d)
3839  p.t1 = Task(p.e)
3840  p.t2 = Task(p.f)
3841  p.t3 = Task(p.g, p.t1)
3842  p.ct1 = ConditionalTask(p.h)
3843  p.ct2 = ConditionalTask(p.f)
3844  p.ct3 = ConditionalTask(p.ct1)
3845  p.path1 = Path(p.a, p.t3, p.ct3)
3846  p.path2 = Path(p.b)
3847  self.assertTrue(p.schedule is None)
3848  pths = p.paths
3849  keys = pths.keys()
3850  self.assertEqual(pths[keys[0]],p.path1)
3851  self.assertEqual(pths[keys[1]],p.path2)
3852  p.pset1 = PSet(parA = string("pset1"))
3853  p.pset2 = untracked.PSet(parA = string("pset2"))
3854  p.vpset1 = VPSet()
3855  p.vpset2 = untracked.VPSet()
3856  p.prune()
3857  self.assertTrue(hasattr(p, 'a'))
3858  self.assertTrue(hasattr(p, 'b'))
3859  self.assertTrue(not hasattr(p, 'c'))
3860  self.assertTrue(not hasattr(p, 'd'))
3861  self.assertTrue(hasattr(p, 'e'))
3862  self.assertTrue(not hasattr(p, 'f'))
3863  self.assertTrue(hasattr(p, 'g'))
3864  self.assertTrue(hasattr(p, 'h'))
3865  self.assertTrue(not hasattr(p, 's'))
3866  self.assertTrue(hasattr(p, 't1'))
3867  self.assertTrue(not hasattr(p, 't2'))
3868  self.assertTrue(hasattr(p, 't3'))
3869  self.assertTrue(hasattr(p, 'path1'))
3870  self.assertTrue(hasattr(p, 'path2'))
3871 # self.assertTrue(not hasattr(p, 'pset1'))
3872 # self.assertTrue(hasattr(p, 'pset2'))
3873 # self.assertTrue(not hasattr(p, 'vpset1'))
3874 # self.assertTrue(not hasattr(p, 'vpset2'))
3875 
3876  p = Process("test")
3877  p.a = EDAnalyzer("MyAnalyzer")
3878  p.b = EDAnalyzer("YourAnalyzer")
3879  p.c = EDAnalyzer("OurAnalyzer")
3880  p.d = EDAnalyzer("OurAnalyzer")
3881  p.e = EDAnalyzer("OurAnalyzer")
3882  p.f = EDProducer("MyProducer")
3883  p.g = EDProducer("YourProducer")
3884  p.h = EDProducer("TheirProducer")
3885  p.i = EDProducer("OurProducer")
3886  p.j = EDProducer("OurProducer")
3887  p.k = EDProducer("OurProducer")
3888  p.l = EDProducer("OurProducer")
3889  p.t1 = Task(p.f)
3890  p.t2 = Task(p.g)
3891  p.t3 = Task(p.h)
3892  p.t4 = Task(p.i)
3893  p.ct1 = Task(p.f)
3894  p.ct2 = Task(p.j)
3895  p.ct3 = Task(p.k)
3896  p.ct4 = Task(p.l)
3897  p.s = Sequence(p.d, p.t1, p.ct1)
3898  p.s2 = Sequence(p.b, p.t2, p.ct2)
3899  p.s3 = Sequence(p.e)
3900  p.path1 = Path(p.a, p.t3, p.ct3)
3901  p.path2 = Path(p.b)
3902  p.path3 = Path(p.b+p.s2)
3903  p.path4 = Path(p.b+p.s3)
3904  p.schedule = Schedule(p.path1,p.path2,p.path3)
3905  p.schedule.associate(p.t4)
3906  pths = p.paths
3907  keys = pths.keys()
3908  self.assertEqual(pths[keys[0]],p.path1)
3909  self.assertEqual(pths[keys[1]],p.path2)
3910  p.prune()
3911  self.assertTrue(hasattr(p, 'a'))
3912  self.assertTrue(hasattr(p, 'b'))
3913  self.assertTrue(not hasattr(p, 'c'))
3914  self.assertTrue(not hasattr(p, 'd'))
3915  self.assertTrue(not hasattr(p, 'e'))
3916  self.assertTrue(not hasattr(p, 'f'))
3917  self.assertTrue(hasattr(p, 'g'))
3918  self.assertTrue(hasattr(p, 'h'))
3919  self.assertTrue(hasattr(p, 'i'))
3920  self.assertTrue(hasattr(p, 'j'))
3921  self.assertTrue(hasattr(p, 'k'))
3922  self.assertTrue(not hasattr(p, 'l'))
3923  self.assertTrue(not hasattr(p, 't1'))
3924  self.assertTrue(hasattr(p, 't2'))
3925  self.assertTrue(hasattr(p, 't3'))
3926  self.assertTrue(hasattr(p, 't4'))
3927  self.assertTrue(not hasattr(p, 'ct1'))
3928  self.assertTrue(hasattr(p, 'ct2'))
3929  self.assertTrue(hasattr(p, 'ct3'))
3930  self.assertTrue(not hasattr(p, 'ct4'))
3931  self.assertTrue(not hasattr(p, 's'))
3932  self.assertTrue(hasattr(p, 's2'))
3933  self.assertTrue(not hasattr(p, 's3'))
3934  self.assertTrue(hasattr(p, 'path1'))
3935  self.assertTrue(hasattr(p, 'path2'))
3936  self.assertTrue(hasattr(p, 'path3'))
3937  self.assertTrue(not hasattr(p, 'path4'))
3938  #test SequencePlaceholder
3939  p = Process("test")
3940  p.a = EDAnalyzer("MyAnalyzer")
3941  p.b = EDAnalyzer("YourAnalyzer")
3942  p.s = Sequence(SequencePlaceholder("a")+p.b)
3943  p.pth = Path(p.s)
3944  p.prune()
3945  self.assertTrue(hasattr(p, 'a'))
3946  self.assertTrue(hasattr(p, 'b'))
3947  self.assertTrue(hasattr(p, 's'))
3948  self.assertTrue(hasattr(p, 'pth'))
3949  #test unresolved SequencePlaceholder
3950  p = Process("test")
3951  p.b = EDAnalyzer("YourAnalyzer")
3952  p.s = Sequence(SequencePlaceholder("a")+p.b)
3953  p.pth = Path(p.s)
3954  p.prune(keepUnresolvedSequencePlaceholders=True)
3955  self.assertTrue(hasattr(p, 'b'))
3956  self.assertTrue(hasattr(p, 's'))
3957  self.assertTrue(hasattr(p, 'pth'))
3958  self.assertEqual(p.s.dumpPython(),'cms.Sequence(cms.SequencePlaceholder("a")+process.b)\n')
3959  #test TaskPlaceholder
3960  p = Process("test")
3961  p.a = EDProducer("MyProducer")
3962  p.b = EDProducer("YourProducer")
3963  p.s = Task(TaskPlaceholder("a"),p.b)
3964  p.pth = Path(p.s)
3965  p.prune()
3966  self.assertTrue(hasattr(p, 'a'))
3967  self.assertTrue(hasattr(p, 'b'))
3968  self.assertTrue(hasattr(p, 's'))
3969  self.assertTrue(hasattr(p, 'pth'))
3970  #test ConditionalTaskPlaceholder
3971  p = Process("test")
3972  p.a = EDProducer("MyProducer")
3973  p.b = EDProducer("YourProducer")
3974  p.s = ConditionalTask(ConditionalTaskPlaceholder("a"),p.b)
3975  p.pth = Path(p.s)
3976  p.prune()
3977  self.assertTrue(hasattr(p, 'a'))
3978  self.assertTrue(hasattr(p, 'b'))
3979  self.assertTrue(hasattr(p, 's'))
3980  self.assertTrue(hasattr(p, 'pth'))
3981  #test unresolved SequencePlaceholder
3982  p = Process("test")
3983  p.b = EDProducer("YourAnalyzer")
3984  p.s = Task(TaskPlaceholder("a"),p.b)
3985  p.pth = Path(p.s)
3986  p.prune(keepUnresolvedSequencePlaceholders=True)
3987  self.assertTrue(hasattr(p, 'b'))
3988  self.assertTrue(hasattr(p, 's'))
3989  self.assertTrue(hasattr(p, 'pth'))
3990  self.assertEqual(p.s.dumpPython(),'cms.Task(cms.TaskPlaceholder("a"), process.b)\n')
Definition: PSet.py:1

◆ testRefToPSet()

def Config.TestModuleCommand.testRefToPSet (   self)

Definition at line 3704 of file Config.py.

3704  def testRefToPSet(self):
3705  proc = Process("test")
3706  proc.top = PSet(a = int32(1))
3707  proc.ref = PSet(refToPSet_ = string("top"))
3708  proc.ref2 = PSet( a = int32(1), b = PSet( refToPSet_ = string("top")))
3709  proc.ref3 = PSet(refToPSet_ = string("ref"))
3710  proc.ref4 = VPSet(PSet(refToPSet_ = string("top")),
3711  PSet(refToPSet_ = string("ref2")))
3712  p = TestMakePSet()
3713  proc.fillProcessDesc(p)
3714  self.assertEqual((True,1),p.values["ref"][1].values["a"])
3715  self.assertEqual((True,1),p.values["ref3"][1].values["a"])
3716  self.assertEqual((True,1),p.values["ref2"][1].values["a"])
3717  self.assertEqual((True,1),p.values["ref2"][1].values["b"][1].values["a"])
3718  self.assertEqual((True,1),p.values["ref4"][1][0].values["a"])
3719  self.assertEqual((True,1),p.values["ref4"][1][1].values["a"])
Definition: PSet.py:1

◆ testSchedule()

def Config.TestModuleCommand.testSchedule (   self)

Definition at line 3424 of file Config.py.

3424  def testSchedule(self):
3425  p = Process("test")
3426  p.a = EDAnalyzer("MyAnalyzer")
3427  p.b = EDAnalyzer("YourAnalyzer")
3428  p.c = EDAnalyzer("OurAnalyzer")
3429  p.d = EDAnalyzer("OurAnalyzer")
3430  p.path1 = Path(p.a)
3431  p.path2 = Path(p.b)
3432  p.path3 = Path(p.d)
3433 
3434  s = Schedule(p.path1,p.path2)
3435  self.assertEqual(s[0],p.path1)
3436  self.assertEqual(s[1],p.path2)
3437  p.schedule = s
3438  self.assertTrue('b' in p.schedule.moduleNames())
3439  self.assertTrue(hasattr(p, 'b'))
3440  self.assertTrue(hasattr(p, 'c'))
3441  self.assertTrue(hasattr(p, 'd'))
3442  self.assertTrue(hasattr(p, 'path1'))
3443  self.assertTrue(hasattr(p, 'path2'))
3444  self.assertTrue(hasattr(p, 'path3'))
3445  p.prune()
3446  self.assertTrue('b' in p.schedule.moduleNames())
3447  self.assertTrue(hasattr(p, 'b'))
3448  self.assertTrue(not hasattr(p, 'c'))
3449  self.assertTrue(not hasattr(p, 'd'))
3450  self.assertTrue(hasattr(p, 'path1'))
3451  self.assertTrue(hasattr(p, 'path2'))
3452  self.assertTrue(not hasattr(p, 'path3'))
3453 
3454  self.assertTrue(len(p.schedule._tasks) == 0)
3455 
3456  p = Process("test")
3457  p.a = EDAnalyzer("MyAnalyzer")
3458  p.b = EDAnalyzer("YourAnalyzer")
3459  p.c = EDAnalyzer("OurAnalyzer")
3460  p.d = EDAnalyzer("dAnalyzer")
3461  p.e = EDProducer("eProducer")
3462  p.f = EDProducer("fProducer")
3463  p.Tracer = Service("Tracer")
3464  p.path1 = Path(p.a)
3465  p.path2 = Path(p.b)
3466  p.path3 = Path(p.d)
3467  p.task1 = Task(p.e)
3468  p.task2 = Task(p.f, p.Tracer)
3469  s = Schedule(p.path1,p.path2,tasks=[p.task1,p.task2,p.task1])
3470  self.assertEqual(s[0],p.path1)
3471  self.assertEqual(s[1],p.path2)
3472  self.assertTrue(len(s._tasks) == 2)
3473  self.assertTrue(p.task1 in s._tasks)
3474  self.assertTrue(p.task2 in s._tasks)
3475  listOfTasks = list(s._tasks)
3476  self.assertTrue(len(listOfTasks) == 2)
3477  self.assertTrue(p.task1 == listOfTasks[0])
3478  self.assertTrue(p.task2 == listOfTasks[1])
3479  p.schedule = s
3480  self.assertTrue('b' in p.schedule.moduleNames())
3481 
3482  process2 = Process("test")
3483  process2.a = EDAnalyzer("MyAnalyzer")
3484  process2.e = EDProducer("eProducer")
3485  process2.path1 = Path(process2.a)
3486  process2.task1 = Task(process2.e)
3487  process2.schedule = Schedule(process2.path1,tasks=process2.task1)
3488  listOfTasks = list(process2.schedule._tasks)
3489  self.assertTrue(listOfTasks[0] == process2.task1)
3490 
3491  # test Schedule copy
3492  s2 = s.copy()
3493  self.assertEqual(s2[0],p.path1)
3494  self.assertEqual(s2[1],p.path2)
3495  self.assertTrue(len(s2._tasks) == 2)
3496  self.assertTrue(p.task1 in s2._tasks)
3497  self.assertTrue(p.task2 in s2._tasks)
3498  listOfTasks = list(s2._tasks)
3499  self.assertTrue(len(listOfTasks) == 2)
3500  self.assertTrue(p.task1 == listOfTasks[0])
3501  self.assertTrue(p.task2 == listOfTasks[1])
3502 
3503  names = s.moduleNames()
3504  self.assertTrue(names == set(['a', 'b', 'e', 'Tracer', 'f']))
3505  #adding a path not attached to the Process should cause an exception
3506  p = Process("test")
3507  p.a = EDAnalyzer("MyAnalyzer")
3508  path1 = Path(p.a)
3509  s = Schedule(path1)
3510  self.assertRaises(RuntimeError, lambda : p.setSchedule_(s) )
3511 
3512  #make sure anonymous sequences work
3513  p = Process("test")
3514  p.a = EDAnalyzer("MyAnalyzer")
3515  p.b = EDAnalyzer("MyOtherAnalyzer")
3516  p.c = EDProducer("MyProd")
3517  path1 = Path(p.c*Sequence(p.a+p.b))
3518  s = Schedule(path1)
3519  self.assertTrue('a' in s.moduleNames())
3520  self.assertTrue('b' in s.moduleNames())
3521  self.assertTrue('c' in s.moduleNames())
3522  p.path1 = path1
3523  p.schedule = s
3524  p.prune()
3525  self.assertTrue('a' in s.moduleNames())
3526  self.assertTrue('b' in s.moduleNames())
3527  self.assertTrue('c' in s.moduleNames())
3528 

◆ testSecSource()

def Config.TestModuleCommand.testSecSource (   self)

Definition at line 2751 of file Config.py.

References Config._lineDiff(), and ConfigBuilder.dumpPython().

2751  def testSecSource(self):
2752  p = Process('test')
2753  p.a = SecSource("MySecSource")
2754  self.assertEqual(_lineDiff(p.dumpPython(),Process('test').dumpPython()),'process.a = cms.SecSource("MySecSource")')
2755 
def _lineDiff(newString, oldString)
Definition: Config.py:2083
def dumpPython(process, name)

◆ testSequence()

def Config.TestModuleCommand.testSequence (   self)

Definition at line 2827 of file Config.py.

References str.

2827  def testSequence(self):
2828  p = Process('test')
2829  p.a = EDAnalyzer("MyAnalyzer")
2830  p.b = EDAnalyzer("YourAnalyzer")
2831  p.c = EDAnalyzer("OurAnalyzer")
2832  p.s = Sequence(p.a*p.b)
2833  self.assertEqual(str(p.s),'a+b')
2834  self.assertEqual(p.s.label_(),'s')
2835  path = Path(p.c+p.s)
2836  self.assertEqual(str(path),'c+a+b')
2837  p._validateSequence(path, 'p1')
2838  notInProcess = EDAnalyzer('NotInProcess')
2839  p2 = Path(p.c+p.s*notInProcess)
2840  self.assertRaises(RuntimeError, p._validateSequence, p2, 'p2')
2841 
#define str(s)

◆ testSequence2()

def Config.TestModuleCommand.testSequence2 (   self)

Definition at line 2842 of file Config.py.

2842  def testSequence2(self):
2843  p = Process('test')
2844  p.a = EDAnalyzer("MyAnalyzer")
2845  p.b = EDAnalyzer("YourAnalyzer")
2846  p.c = EDAnalyzer("OurAnalyzer")
2847  testseq = Sequence(p.a*p.b)
2848  p.s = testseq
2849  #p.y = testseq
2850  self.assertRaises(ValueError, p.__setattr__, "y", testseq)
2851 

◆ testServiceInProcess()

def Config.TestModuleCommand.testServiceInProcess (   self)

Definition at line 2852 of file Config.py.

2852  def testServiceInProcess(self):
2853  service = Service("d")
2854  self.assertFalse(service._inProcess)
2855  process = Process("test")
2856  process.d = service
2857  self.assertTrue(service._inProcess)
2858  service2 = Service("d")
2859  process.d = service2
2860  self.assertFalse(service._inProcess)
2861  self.assertTrue(service2._inProcess)
2862  del process.d
2863  self.assertFalse(service2._inProcess)
2864 

◆ testSubProcess()

def Config.TestModuleCommand.testSubProcess (   self)

Definition at line 3669 of file Config.py.

References Config._lineDiff(), ConfigBuilder.dumpPython(), cond.hash, submitPVValidationJobs.split(), and str.

3669  def testSubProcess(self):
3670  process = Process("Parent")
3671  subProcess = Process("Child")
3672  subProcess.a = EDProducer("A")
3673  subProcess.p = Path(subProcess.a)
3674  subProcess.add_(Service("Foo"))
3675  process.addSubProcess(SubProcess(subProcess))
3676  d = process.dumpPython()
3677  equalD ="""parentProcess = process
3678 process.a = cms.EDProducer("A")
3679 process.Foo = cms.Service("Foo")
3680 process.p = cms.Path(process.a)
3681 childProcess = process
3682 process = parentProcess
3683 process.addSubProcess(cms.SubProcess(process = childProcess, SelectEvents = cms.untracked.PSet(
3684 ), outputCommands = cms.untracked.vstring()))"""
3685  equalD = equalD.replace("parentProcess","parentProcess"+str(hash(process.subProcesses_()[0])))
3686  # SubProcesses are dumped before Services, so in order to
3687  # craft the dump of the Parent and Child manually the dump
3688  # of the Parent needs to be split at the MessageLogger
3689  # boundary (now when it is part of Process by default),
3690  # and insert the dump of the Child between the top part of
3691  # the Parent (before MessageLogger) and the bottom part of
3692  # the Parent (after and including MessageLogger)
3693  messageLoggerSplit = 'process.MessageLogger = cms.Service'
3694  parentDumpSplit = Process('Parent').dumpPython().split(messageLoggerSplit)
3695  childProcess = Process('Child')
3696  del childProcess.MessageLogger
3697  combinedDump = parentDumpSplit[0] + childProcess.dumpPython() + messageLoggerSplit + parentDumpSplit[1]
3698  self.assertEqual(_lineDiff(d, combinedDump), equalD)
3699  p = TestMakePSet()
3700  process.fillProcessDesc(p)
3701  self.assertEqual((True,['a']),p.values["subProcesses"][1][0].values["process"][1].values['@all_modules'])
3702  self.assertEqual((True,['p']),p.values["subProcesses"][1][0].values["process"][1].values['@paths'])
3703  self.assertEqual({'@service_type':(True,'Foo')}, p.values["subProcesses"][1][0].values["process"][1].values["services"][1][0].values)
def _lineDiff(newString, oldString)
Definition: Config.py:2083
def dumpPython(process, name)
#define str(s)

◆ testSwitchProducer()

def Config.TestModuleCommand.testSwitchProducer (   self)

Definition at line 3720 of file Config.py.

References jetUpdater_cfi.sort.

3720  def testSwitchProducer(self):
3721  proc = Process("test")
3722  proc.sp = SwitchProducerTest(test2 = EDProducer("Foo",
3723  a = int32(1),
3724  b = PSet(c = int32(2))),
3725  test1 = EDProducer("Bar",
3726  aa = int32(11),
3727  bb = PSet(cc = int32(12))))
3728  self.assertEqual(proc.sp.label_(), "sp")
3729  self.assertEqual(proc.sp.test1.label_(), "sp@test1")
3730  self.assertEqual(proc.sp.test2.label_(), "sp@test2")
3731 
3732  proc.a = EDProducer("A")
3733  proc.s = Sequence(proc.a + proc.sp)
3734  proc.t = Task(proc.a, proc.sp)
3735  proc.p = Path()
3736  proc.p.associate(proc.t)
3737  p = TestMakePSet()
3738  proc.fillProcessDesc(p)
3739  self.assertEqual((True,"EDProducer"), p.values["sp"][1].values["@module_edm_type"])
3740  self.assertEqual((True, "SwitchProducer"), p.values["sp"][1].values["@module_type"])
3741  self.assertEqual((True, "sp"), p.values["sp"][1].values["@module_label"])
3742  all_cases = copy.deepcopy(p.values["sp"][1].values["@all_cases"])
3743  all_cases[1].sort() # names of all cases come via dict, i.e. their order is undefined
3744  self.assertEqual((True, ["sp@test1", "sp@test2"]), all_cases)
3745  self.assertEqual((False, "sp@test2"), p.values["sp"][1].values["@chosen_case"])
3746  self.assertEqual(["a", "sp", "sp@test1", "sp@test2"], p.values["@all_modules"][1])
3747  self.assertEqual((True,"EDProducer"), p.values["sp@test1"][1].values["@module_edm_type"])
3748  self.assertEqual((True,"Bar"), p.values["sp@test1"][1].values["@module_type"])
3749  self.assertEqual((True,"EDProducer"), p.values["sp@test2"][1].values["@module_edm_type"])
3750  self.assertEqual((True,"Foo"), p.values["sp@test2"][1].values["@module_type"])
3751  dump = proc.dumpPython()
3752  self.assertEqual(dump.find('@'), -1)
3753  self.assertEqual(specialImportRegistry.getSpecialImports(), ["from test import SwitchProducerTest"])
3754  self.assertTrue(dump.find("\nfrom test import SwitchProducerTest\n") != -1)
3755 
3756  # EDAlias as non-chosen case
3757  proc = Process("test")
3758  proc.sp = SwitchProducerTest(test2 = EDProducer("Foo",
3759  a = int32(1),
3760  b = PSet(c = int32(2))),
3761  test1 = EDAlias(a = VPSet(PSet(type = string("Bar")))))
3762  proc.a = EDProducer("A")
3763  proc.s = Sequence(proc.a + proc.sp)
3764  proc.t = Task(proc.a, proc.sp)
3765  proc.p = Path()
3766  proc.p.associate(proc.t)
3767  p = TestMakePSet()
3768  proc.fillProcessDesc(p)
3769  self.assertEqual((True,"EDProducer"), p.values["sp"][1].values["@module_edm_type"])
3770  self.assertEqual((True, "SwitchProducer"), p.values["sp"][1].values["@module_type"])
3771  self.assertEqual((True, "sp"), p.values["sp"][1].values["@module_label"])
3772  all_cases = copy.deepcopy(p.values["sp"][1].values["@all_cases"])
3773  all_cases[1].sort()
3774  self.assertEqual((True, ["sp@test1", "sp@test2"]), all_cases)
3775  self.assertEqual((False, "sp@test2"), p.values["sp"][1].values["@chosen_case"])
3776  self.assertEqual(["a", "sp", "sp@test2"], p.values["@all_modules"][1])
3777  self.assertEqual(["sp@test1"], p.values["@all_aliases"][1])
3778  self.assertEqual((True,"EDProducer"), p.values["sp@test2"][1].values["@module_edm_type"])
3779  self.assertEqual((True,"Foo"), p.values["sp@test2"][1].values["@module_type"])
3780  self.assertEqual((True,"EDAlias"), p.values["sp@test1"][1].values["@module_edm_type"])
3781  self.assertEqual((True,"Bar"), p.values["sp@test1"][1].values["a"][1][0].values["type"])
3782 
3783  # EDAlias as chosen case
3784  proc = Process("test")
3785  proc.sp = SwitchProducerTest(test1 = EDProducer("Foo",
3786  a = int32(1),
3787  b = PSet(c = int32(2))),
3788  test2 = EDAlias(a = VPSet(PSet(type = string("Bar")))))
3789  proc.a = EDProducer("A")
3790  proc.s = Sequence(proc.a + proc.sp)
3791  proc.t = Task(proc.a, proc.sp)
3792  proc.p = Path()
3793  proc.p.associate(proc.t)
3794  p = TestMakePSet()
3795  proc.fillProcessDesc(p)
3796  self.assertEqual((True,"EDProducer"), p.values["sp"][1].values["@module_edm_type"])
3797  self.assertEqual((True, "SwitchProducer"), p.values["sp"][1].values["@module_type"])
3798  self.assertEqual((True, "sp"), p.values["sp"][1].values["@module_label"])
3799  self.assertEqual((True, ["sp@test1", "sp@test2"]), p.values["sp"][1].values["@all_cases"])
3800  self.assertEqual((False, "sp@test2"), p.values["sp"][1].values["@chosen_case"])
3801  self.assertEqual(["a", "sp", "sp@test1"], p.values["@all_modules"][1])
3802  self.assertEqual(["sp@test2"], p.values["@all_aliases"][1])
3803  self.assertEqual((True,"EDProducer"), p.values["sp@test1"][1].values["@module_edm_type"])
3804  self.assertEqual((True,"Foo"), p.values["sp@test1"][1].values["@module_type"])
3805  self.assertEqual((True,"EDAlias"), p.values["sp@test2"][1].values["@module_edm_type"])
3806  self.assertEqual((True,"Bar"), p.values["sp@test2"][1].values["a"][1][0].values["type"])
3807 
3808  # ConditionalTask
3809  proc = Process("test")
3810  proc.spct = SwitchProducerTest(test2 = EDProducer("Foo",
3811  a = int32(1),
3812  b = PSet(c = int32(2))),
3813  test1 = EDProducer("Bar",
3814  aa = int32(11),
3815  bb = PSet(cc = int32(12))),
3816  test3 = EDAlias(a = VPSet(PSet(type = string("Bar")))))
3817  proc.spp = proc.spct.clone()
3818  proc.a = EDProducer("A")
3819  proc.ct = ConditionalTask(proc.spct)
3820  proc.p = Path(proc.a, proc.ct)
3821  proc.pp = Path(proc.a + proc.spp)
3822  p = TestMakePSet()
3823  proc.fillProcessDesc(p)
3824  self.assertEqual(["a", "spct", "spct@test1", "spct@test2", "spp", "spp@test1", "spp@test2"], p.values["@all_modules"][1])
3825  self.assertEqual(["a", "#", "spct", "spct@test1", "spct@test2", "@"], p.values["p"][1])
3826  self.assertEqual(["a", "spp", "#", "spp@test1", "spp@test2", "@"], p.values["pp"][1])
3827 
Definition: PSet.py:1

◆ testTask()

def Config.TestModuleCommand.testTask (   self)

Definition at line 2865 of file Config.py.

2865  def testTask(self):
2866 
2867  # create some objects to use in tests
2868  edanalyzer = EDAnalyzer("a")
2869  edproducer = EDProducer("b")
2870  edproducer2 = EDProducer("b2")
2871  edproducer3 = EDProducer("b3")
2872  edproducer4 = EDProducer("b4")
2873  edproducer8 = EDProducer("b8")
2874  edproducer9 = EDProducer("b9")
2875  edfilter = EDFilter("c")
2876  service = Service("d")
2877  service3 = Service("d", v = untracked.uint32(3))
2878  essource = ESSource("e")
2879  esproducer = ESProducer("f")
2880  testTask2 = Task()
2881 
2882  # test adding things to Tasks
2883  testTask1 = Task(edproducer, edfilter)
2884  self.assertRaises(RuntimeError, testTask1.add, edanalyzer)
2885  testTask1.add(essource, service)
2886  testTask1.add(essource, esproducer)
2887  testTask1.add(testTask2)
2888  coll = testTask1._collection
2889  self.assertTrue(edproducer in coll)
2890  self.assertTrue(edfilter in coll)
2891  self.assertTrue(service in coll)
2892  self.assertTrue(essource in coll)
2893  self.assertTrue(esproducer in coll)
2894  self.assertTrue(testTask2 in coll)
2895  self.assertTrue(len(coll) == 6)
2896  self.assertTrue(len(testTask2._collection) == 0)
2897 
2898  taskContents = []
2899  for i in testTask1:
2900  taskContents.append(i)
2901  self.assertTrue(taskContents == [edproducer, edfilter, essource, service, esproducer, testTask2])
2902 
2903  # test attaching Task to Process
2904  process = Process("test")
2905 
2906  process.mproducer = edproducer
2907  process.mproducer2 = edproducer2
2908  process.mfilter = edfilter
2909  process.messource = essource
2910  process.mesproducer = esproducer
2911  process.d = service
2912 
2913  testTask3 = Task(edproducer, edproducer2)
2914  testTask1.add(testTask3)
2915  process.myTask1 = testTask1
2916 
2917  # test the validation that occurs when attaching a Task to a Process
2918  # first a case that passes, then one the fails on an EDProducer
2919  # then one that fails on a service
2920  l = set()
2921  visitor = NodeNameVisitor(l)
2922  testTask1.visit(visitor)
2923  self.assertTrue(l == set(['mesproducer', 'mproducer', 'mproducer2', 'mfilter', 'd', 'messource']))
2924  l2 = testTask1.moduleNames
2925  self.assertTrue(l == set(['mesproducer', 'mproducer', 'mproducer2', 'mfilter', 'd', 'messource']))
2926 
2927  testTask4 = Task(edproducer3)
2928  l.clear()
2929  self.assertRaises(RuntimeError, testTask4.visit, visitor)
2930  try:
2931  process.myTask4 = testTask4
2932  self.assertTrue(False)
2933  except RuntimeError:
2934  pass
2935 
2936  testTask5 = Task(service3)
2937  l.clear()
2938  self.assertRaises(RuntimeError, testTask5.visit, visitor)
2939  try:
2940  process.myTask5 = testTask5
2941  self.assertTrue(False)
2942  except RuntimeError:
2943  pass
2944 
2945  process.d = service3
2946  process.myTask5 = testTask5
2947 
2948  # test placement into the Process and the tasks property
2949  expectedDict = { 'myTask1' : testTask1, 'myTask5' : testTask5 }
2950  expectedFixedDict = DictTypes.FixedKeysDict(expectedDict);
2951  self.assertTrue(process.tasks == expectedFixedDict)
2952  self.assertTrue(process.tasks['myTask1'] == testTask1)
2953  self.assertTrue(process.myTask1 == testTask1)
2954 
2955  # test replacing an EDProducer in a Task when calling __settattr__
2956  # for the EDProducer on the Process.
2957  process.mproducer2 = edproducer4
2958  process.d = service
2959  l = list()
2960  visitor1 = ModuleNodeVisitor(l)
2961  testTask1.visit(visitor1)
2962  l.sort(key=lambda mod: mod.__str__())
2963  expectedList = sorted([edproducer,essource,esproducer,service,edfilter,edproducer,edproducer4],key=lambda mod: mod.__str__())
2964  self.assertTrue(expectedList == l)
2965  process.myTask6 = Task()
2966  process.myTask7 = Task()
2967  process.mproducer8 = edproducer8
2968  process.myTask8 = Task(process.mproducer8)
2969  process.myTask6.add(process.myTask7)
2970  process.myTask7.add(process.myTask8)
2971  process.myTask1.add(process.myTask6)
2972  process.myTask8.add(process.myTask5)
2973 
2974  testDict = process._itemsInDependencyOrder(process.tasks)
2975  expectedLabels = ["myTask5", "myTask8", "myTask7", "myTask6", "myTask1"]
2976  expectedTasks = [process.myTask5, process.myTask8, process.myTask7, process.myTask6, process.myTask1]
2977  index = 0
2978  for testLabel, testTask in testDict.items():
2979  self.assertTrue(testLabel == expectedLabels[index])
2980  self.assertTrue(testTask == expectedTasks[index])
2981  index += 1
2982 
2983  pythonDump = testTask1.dumpPython(PrintOptions())
2984 
2985 
2986  expectedPythonDump = 'cms.Task(process.d, process.mesproducer, process.messource, process.mfilter, process.mproducer, process.mproducer2, process.myTask6)\n'
2987  self.assertTrue(pythonDump == expectedPythonDump)
2988 
2989  process.myTask5 = Task()
2990  process.myTask100 = Task()
2991  process.mproducer9 = edproducer9
2992  sequence1 = Sequence(process.mproducer8, process.myTask1, process.myTask5, testTask2, testTask3)
2993  sequence2 = Sequence(process.mproducer8 + process.mproducer9)
2994  process.sequence3 = Sequence((process.mproducer8 + process.mfilter))
2995  sequence4 = Sequence()
2996  process.path1 = Path(process.mproducer+process.mproducer8+sequence1+sequence2+process.sequence3+sequence4)
2997  process.path1.associate(process.myTask1, process.myTask5, testTask2, testTask3)
2998  process.path11 = Path(process.mproducer+process.mproducer8+sequence1+sequence2+process.sequence3+ sequence4,process.myTask1, process.myTask5, testTask2, testTask3, process.myTask100)
2999  process.path2 = Path(process.mproducer)
3000  process.path3 = Path(process.mproducer9+process.mproducer8,testTask2)
3001 
3002  self.assertTrue(process.path1.dumpPython(PrintOptions()) == 'cms.Path(process.mproducer+process.mproducer8+cms.Sequence(process.mproducer8, cms.Task(), cms.Task(process.None, process.mproducer), process.myTask1, process.myTask5)+(process.mproducer8+process.mproducer9)+process.sequence3, cms.Task(), cms.Task(process.None, process.mproducer), process.myTask1, process.myTask5)\n')
3003 
3004  self.assertTrue(process.path11.dumpPython(PrintOptions()) == 'cms.Path(process.mproducer+process.mproducer8+cms.Sequence(process.mproducer8, cms.Task(), cms.Task(process.None, process.mproducer), process.myTask1, process.myTask5)+(process.mproducer8+process.mproducer9)+process.sequence3, cms.Task(), cms.Task(process.None, process.mproducer), process.myTask1, process.myTask100, process.myTask5)\n')
3005 
3006  # test NodeNameVisitor and moduleNames
3007  l = set()
3008  nameVisitor = NodeNameVisitor(l)
3009  process.path1.visit(nameVisitor)
3010  self.assertTrue(l == set(['mproducer', 'd', 'mesproducer', None, 'mproducer9', 'mproducer8', 'messource', 'mproducer2', 'mfilter']))
3011  self.assertTrue(process.path1.moduleNames() == set(['mproducer', 'd', 'mesproducer', None, 'mproducer9', 'mproducer8', 'messource', 'mproducer2', 'mfilter']))
3012 
3013  # test copy
3014  process.mproducer10 = EDProducer("b10")
3015  process.path21 = process.path11.copy()
3016  process.path21.replace(process.mproducer, process.mproducer10)
3017 
3018  self.assertTrue(process.path11.dumpPython(PrintOptions()) == 'cms.Path(process.mproducer+process.mproducer8+cms.Sequence(process.mproducer8, cms.Task(), cms.Task(process.None, process.mproducer), process.myTask1, process.myTask5)+(process.mproducer8+process.mproducer9)+process.sequence3, cms.Task(), cms.Task(process.None, process.mproducer), process.myTask1, process.myTask100, process.myTask5)\n')
3019 
3020  # Some peculiarities of the way things work show up here. dumpPython sorts tasks and
3021  # removes duplication at the level of strings. The Task and Sequence objects themselves
3022  # remove duplicate tasks in their contents if the instances are the same (exact same python
3023  # object id which is not the same as the string representation being the same).
3024  # Also note that the mutating visitor replaces sequences and tasks that have
3025  # modified contents with their modified contents, it does not modify the sequence
3026  # or task itself.
3027  self.assertTrue(process.path21.dumpPython(PrintOptions()) == 'cms.Path(process.mproducer10+process.mproducer8+process.mproducer8+(process.mproducer8+process.mproducer9)+process.sequence3, cms.Task(), cms.Task(process.None, process.mproducer10), cms.Task(process.d, process.mesproducer, process.messource, process.mfilter, process.mproducer10, process.mproducer2, process.mproducer8, process.myTask5), process.myTask100, process.myTask5)\n')
3028 
3029  process.path22 = process.path21.copyAndExclude([process.d, process.mesproducer, process.mfilter])
3030  self.assertTrue(process.path22.dumpPython(PrintOptions()) == 'cms.Path(process.mproducer10+process.mproducer8+process.mproducer8+(process.mproducer8+process.mproducer9)+process.mproducer8, cms.Task(), cms.Task(process.None, process.mproducer10), cms.Task(process.messource, process.mproducer10, process.mproducer2, process.mproducer8, process.myTask5), process.myTask100, process.myTask5)\n')
3031 
3032  process.path23 = process.path22.copyAndExclude([process.messource, process.mproducer10])
3033  self.assertTrue(process.path23.dumpPython(PrintOptions()) == 'cms.Path(process.mproducer8+process.mproducer8+(process.mproducer8+process.mproducer9)+process.mproducer8, cms.Task(), cms.Task(process.None), cms.Task(process.mproducer2, process.mproducer8, process.myTask5), process.myTask100, process.myTask5)\n')
3034 
3035  process.a = EDAnalyzer("MyAnalyzer")
3036  process.b = OutputModule("MyOutputModule")
3037  process.c = EDFilter("MyFilter")
3038  process.d = EDProducer("MyProducer")
3039  process.e = ESProducer("MyESProducer")
3040  process.f = ESSource("MyESSource")
3041  process.g = ESProducer("g")
3042  process.path24 = Path(process.a+process.b+process.c+process.d)
3043  process.path25 = process.path24.copyAndExclude([process.a,process.b,process.c])
3044  self.assertTrue(process.path25.dumpPython() == 'cms.Path(process.d)\n')
3045  #print process.path3
3046  #print process.dumpPython()
3047 
3048  process.path200 = EndPath(Sequence(process.c,Task(process.e)))
3049  process.path200.replace(process.c,process.b)
3050  process.path200.replace(process.e,process.f)
3051  self.assertEqual(process.path200.dumpPython(), "cms.EndPath(process.b, cms.Task(process.f))\n")
3052  process.path200.replace(process.b,process.c)
3053  process.path200.replace(process.f,process.e)
3054  self.assertEqual(process.path200.dumpPython(), "cms.EndPath(process.c, cms.Task(process.e))\n")
3055  process.path200.replace(process.c,process.a)
3056  process.path200.replace(process.e,process.g)
3057  self.assertEqual(process.path200.dumpPython(), "cms.EndPath(process.a, cms.Task(process.g))\n")
3058  process.path200.replace(process.a,process.c)
3059  process.path200.replace(process.g,process.e)
3060  self.assertEqual(process.path200.dumpPython(), "cms.EndPath(process.c, cms.Task(process.e))\n")
3061 
testTask
Definition: TestTask.py:3

◆ testTaskPlaceholder()

def Config.TestModuleCommand.testTaskPlaceholder (   self)

Definition at line 3991 of file Config.py.

References Config._lineDiff(), and ConfigBuilder.dumpPython().

3991  def testTaskPlaceholder(self):
3992  p = Process("test")
3993  p.a = EDProducer("ma")
3994  p.b = EDAnalyzer("mb")
3995  p.t1 = Task(TaskPlaceholder("c"))
3996  p.t2 = Task(p.a, TaskPlaceholder("d"), p.t1)
3997  p.t3 = Task(TaskPlaceholder("e"))
3998  p.path1 = Path(p.b, p.t2, p.t3)
3999  p.t5 = Task(p.a, TaskPlaceholder("g"), TaskPlaceholder("t4"))
4000  p.t4 = Task(TaskPlaceholder("f"))
4001  p.endpath1 = EndPath(p.b, p.t5)
4002  p.t6 = Task(TaskPlaceholder("h"))
4003  p.t7 = Task(p.a, TaskPlaceholder("i"), p.t6)
4004  p.t8 = Task(TaskPlaceholder("j"))
4005  p.schedule = Schedule(p.path1, p.endpath1,tasks=[p.t7,p.t8])
4006  p.c = EDProducer("mc")
4007  p.d = EDProducer("md")
4008  p.e = EDProducer("me")
4009  p.f = EDProducer("mf")
4010  p.g = EDProducer("mg")
4011  p.h = EDProducer("mh")
4012  p.i = EDProducer("mi")
4013  p.j = EDProducer("mj")
4014  self.assertEqual(_lineDiff(p.dumpPython(),Process('test').dumpPython()),
4015 """process.a = cms.EDProducer("ma")
4016 process.c = cms.EDProducer("mc")
4017 process.d = cms.EDProducer("md")
4018 process.e = cms.EDProducer("me")
4019 process.f = cms.EDProducer("mf")
4020 process.g = cms.EDProducer("mg")
4021 process.h = cms.EDProducer("mh")
4022 process.i = cms.EDProducer("mi")
4023 process.j = cms.EDProducer("mj")
4024 process.b = cms.EDAnalyzer("mb")
4025 process.t1 = cms.Task(cms.TaskPlaceholder("c"))
4026 process.t2 = cms.Task(cms.TaskPlaceholder("d"), process.a, process.t1)
4027 process.t3 = cms.Task(cms.TaskPlaceholder("e"))
4028 process.t5 = cms.Task(cms.TaskPlaceholder("g"), cms.TaskPlaceholder("t4"), process.a)
4029 process.t4 = cms.Task(cms.TaskPlaceholder("f"))
4030 process.t6 = cms.Task(cms.TaskPlaceholder("h"))
4031 process.t7 = cms.Task(cms.TaskPlaceholder("i"), process.a, process.t6)
4032 process.t8 = cms.Task(cms.TaskPlaceholder("j"))
4033 process.path1 = cms.Path(process.b, process.t2, process.t3)
4034 process.endpath1 = cms.EndPath(process.b, process.t5)
4035 process.schedule = cms.Schedule(*[ process.path1, process.endpath1 ], tasks=[process.t7, process.t8])""")
4036  p.resolve()
4037  self.assertEqual(_lineDiff(p.dumpPython(),Process('test').dumpPython()),
4038 """process.a = cms.EDProducer("ma")
4039 process.c = cms.EDProducer("mc")
4040 process.d = cms.EDProducer("md")
4041 process.e = cms.EDProducer("me")
4042 process.f = cms.EDProducer("mf")
4043 process.g = cms.EDProducer("mg")
4044 process.h = cms.EDProducer("mh")
4045 process.i = cms.EDProducer("mi")
4046 process.j = cms.EDProducer("mj")
4047 process.b = cms.EDAnalyzer("mb")
4048 process.t1 = cms.Task(process.c)
4049 process.t2 = cms.Task(process.a, process.d, process.t1)
4050 process.t3 = cms.Task(process.e)
4051 process.t4 = cms.Task(process.f)
4052 process.t6 = cms.Task(process.h)
4053 process.t7 = cms.Task(process.a, process.i, process.t6)
4054 process.t8 = cms.Task(process.j)
4055 process.t5 = cms.Task(process.a, process.g, process.t4)
4056 process.path1 = cms.Path(process.b, process.t2, process.t3)
4057 process.endpath1 = cms.EndPath(process.b, process.t5)
4058 process.schedule = cms.Schedule(*[ process.path1, process.endpath1 ], tasks=[process.t7, process.t8])""")
def _lineDiff(newString, oldString)
Definition: Config.py:2083
def dumpPython(process, name)

◆ testTypedParameterizable()

def Config.TestModuleCommand.testTypedParameterizable (   self)

Definition at line 2310 of file Config.py.

2310  def testTypedParameterizable(self):
2311  p = _TypedParameterizable("blah", b=int32(1))
2312  #see if copy works deeply
2313  other = p.copy()
2314  other.b = 2
2315  self.assertNotEqual(p.b,other.b)
2316 

◆ testUsing()

def Config.TestModuleCommand.testUsing (   self)

Definition at line 3562 of file Config.py.

3562  def testUsing(self):
3563  p = Process('test')
3564  p.block = PSet(a = int32(1))
3565  p.modu = EDAnalyzer('Analyzer', p.block, b = int32(2))
3566  self.assertEqual(p.modu.a.value(),1)
3567  self.assertEqual(p.modu.b.value(),2)
3568 
Definition: PSet.py:1

Member Data Documentation

◆ a

Config.TestModuleCommand.a
static

Definition at line 2615 of file Config.py.

◆ b

Config.TestModuleCommand.b
static

Definition at line 2632 of file Config.py.

◆ c

Config.TestModuleCommand.c
static

Definition at line 2633 of file Config.py.

◆ d

Config.TestModuleCommand.d
static

Definition at line 2621 of file Config.py.

◆ e

Config.TestModuleCommand.e
static

Definition at line 2635 of file Config.py.

◆ f

Config.TestModuleCommand.f
static

Definition at line 2636 of file Config.py.

◆ g

Config.TestModuleCommand.g
static

Definition at line 2637 of file Config.py.

◆ maxDiff

Config.TestModuleCommand.maxDiff

Definition at line 4622 of file Config.py.

◆ p

Config.TestModuleCommand.p
static

Definition at line 2614 of file Config.py.

Referenced by Electron.Electron.ptErr().

◆ p2

Config.TestModuleCommand.p2
static

Definition at line 2619 of file Config.py.

◆ proc_mod_

Config.TestModuleCommand.proc_mod_

Definition at line 4285 of file Config.py.

◆ process

Config.TestModuleCommand.process
static

◆ r

Config.TestModuleCommand.r
static

Definition at line 2618 of file Config.py.

◆ s

Config.TestModuleCommand.s
static

Definition at line 2617 of file Config.py.

◆ s1

Config.TestModuleCommand.s1
static

Definition at line 2738 of file Config.py.

◆ s2

Config.TestModuleCommand.s2
static

Definition at line 2728 of file Config.py.

◆ s3

Config.TestModuleCommand.s3
static

Definition at line 2740 of file Config.py.

◆ schedule

Config.TestModuleCommand.schedule
static

Definition at line 2620 of file Config.py.

◆ task1

Config.TestModuleCommand.task1
static

Definition at line 2642 of file Config.py.

◆ task2

Config.TestModuleCommand.task2
static

Definition at line 2640 of file Config.py.

◆ task3

Config.TestModuleCommand.task3
static

Definition at line 2639 of file Config.py.

◆ task4

Config.TestModuleCommand.task4
static

Definition at line 2641 of file Config.py.

◆ task5

Config.TestModuleCommand.task5
static

Definition at line 2638 of file Config.py.

◆ tasks

Config.TestModuleCommand.tasks
static

Definition at line 2648 of file Config.py.