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 2277 of file Config.py.

Member Function Documentation

◆ setUp()

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

Definition at line 2278 of file Config.py.

2278  def setUp(self):
2279  """Nothing to do """
2280  None

◆ testCloneSequence()

def Config.TestModuleCommand.testCloneSequence (   self)

Definition at line 3344 of file Config.py.

References l1ctLayer2EG_cff.id, and str.

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

◆ testConditionalTask()

def Config.TestModuleCommand.testConditionalTask (   self)

Definition at line 3066 of file Config.py.

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

◆ testConditionalTaskPlaceholder()

def Config.TestModuleCommand.testConditionalTaskPlaceholder (   self)

Definition at line 4070 of file Config.py.

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

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

◆ testContains()

def Config.TestModuleCommand.testContains (   self)

Definition at line 3360 of file Config.py.

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

◆ testDelete()

def Config.TestModuleCommand.testDelete (   self)

Definition at line 4130 of file Config.py.

References ConfigBuilder.dumpPython().

4130  def testDelete(self):
4131  p = Process("test")
4132  p.a = EDAnalyzer("MyAnalyzer")
4133  p.b = EDAnalyzer("YourAnalyzer")
4134  p.c = EDAnalyzer("OurAnalyzer")
4135  p.d = EDAnalyzer("OurAnalyzer")
4136  p.e = EDAnalyzer("OurAnalyzer")
4137  p.f = EDAnalyzer("OurAnalyzer")
4138  p.g = EDProducer("OurProducer")
4139  p.h = EDProducer("YourProducer")
4140  p.i = SwitchProducerTest(
4141  test1 = EDProducer("OneProducer"),
4142  test2 = EDProducer("TwoProducer")
4143  )
4144  p.t1 = Task(p.g, p.h, p.i)
4145  t2 = Task(p.g, p.h, p.i)
4146  t3 = Task(p.g, p.h)
4147  p.t4 = Task(p.h)
4148  p.ct1 = ConditionalTask(p.g, p.h, p.i)
4149  ct2 = ConditionalTask(p.g, p.h)
4150  ct3 = ConditionalTask(p.g, p.h)
4151  p.ct4 = ConditionalTask(p.h)
4152  p.s = Sequence(p.d+p.e)
4153  p.path1 = Path(p.a+p.f+p.s,t2,ct2)
4154  p.path2 = Path(p.a)
4155  p.path3 = Path(ct3, p.ct4)
4156  p.endpath2 = EndPath(p.b)
4157  p.endpath1 = EndPath(p.b+p.f)
4158  p.schedule = Schedule(p.path2, p.path3, p.endpath2, tasks=[t3, p.t4])
4159  self.assertTrue(hasattr(p, 'f'))
4160  self.assertTrue(hasattr(p, 'g'))
4161  self.assertTrue(hasattr(p, 'i'))
4162  del p.e
4163  del p.f
4164  del p.g
4165  del p.i
4166  self.assertFalse(hasattr(p, 'f'))
4167  self.assertFalse(hasattr(p, 'g'))
4168  self.assertEqual(p.t1.dumpPython(), 'cms.Task(process.h)\n')
4169  self.assertEqual(p.ct1.dumpPython(), 'cms.ConditionalTask(process.h)\n')
4170  self.assertEqual(p.s.dumpPython(), 'cms.Sequence(process.d)\n')
4171  self.assertEqual(p.path1.dumpPython(), 'cms.Path(process.a+process.s, cms.ConditionalTask(process.h), cms.Task(process.h))\n')
4172  self.assertEqual(p.endpath1.dumpPython(), 'cms.EndPath(process.b)\n')
4173  self.assertEqual(p.path3.dumpPython(), 'cms.Path(cms.ConditionalTask(process.h), process.ct4)\n')
4174  del p.s
4175  self.assertEqual(p.path1.dumpPython(), 'cms.Path(process.a+(process.d), cms.ConditionalTask(process.h), cms.Task(process.h))\n')
4176  self.assertEqual(p.schedule_().dumpPython(), 'cms.Schedule(*[ process.path2, process.path3, process.endpath2 ], tasks=[cms.Task(process.h), process.t4])\n')
4177  del p.path2
4178  self.assertEqual(p.schedule_().dumpPython(), 'cms.Schedule(*[ process.path3, process.endpath2 ], tasks=[cms.Task(process.h), process.t4])\n')
4179  del p.path3
4180  self.assertEqual(p.schedule_().dumpPython(), 'cms.Schedule(*[ process.endpath2 ], tasks=[cms.Task(process.h), process.t4])\n')
4181  del p.endpath2
4182  self.assertEqual(p.schedule_().dumpPython(), 'cms.Schedule(tasks=[cms.Task(process.h), process.t4])\n')
4183  del p.t4
4184  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 3630 of file Config.py.

References Types.untracked.

3630  def testExamples(self):
3631  p = Process("Test")
3632  p.source = Source("PoolSource",fileNames = untracked(string("file:reco.root")))
3633  p.foos = EDProducer("FooProducer")
3634  p.bars = EDProducer("BarProducer", foos=InputTag("foos"))
3635  p.out = OutputModule("PoolOutputModule",fileName=untracked(string("file:foos.root")))
3636  p.bars.foos = 'Foosball'
3637  self.assertEqual(p.bars.foos, InputTag('Foosball'))
3638  p.p = Path(p.foos*p.bars)
3639  p.e = EndPath(p.out)
3640  p.add_(Service("MessageLogger"))
3641 
untracked
Definition: Types.py:34

◆ testFinalPath()

def Config.TestModuleCommand.testFinalPath (   self)

Definition at line 3305 of file Config.py.

References str.

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

◆ testFreeze()

def Config.TestModuleCommand.testFreeze (   self)

Definition at line 3662 of file Config.py.

3662  def testFreeze(self):
3663  process = Process("Freeze")
3664  m = EDProducer("M", p=PSet(i = int32(1)))
3665  m.p.i = 2
3666  process.m = m
3667  # should be frozen
3668  #self.assertRaises(ValueError, setattr, m.p, 'i', 3)
3669  #self.assertRaises(ValueError, setattr, m, 'p', PSet(i=int32(1)))
3670  #self.assertRaises(ValueError, setattr, m.p, 'j', 1)
3671  #self.assertRaises(ValueError, setattr, m, 'j', 1)
3672  # But OK to change through the process
3673  process.m.p.i = 4
3674  self.assertEqual(process.m.p.i.value(), 4)
3675  process.m.p = PSet(j=int32(1))
3676  # should work to clone it, though
3677  m2 = m.clone(p = PSet(i = int32(5)), j = int32(8))
3678  m2.p.i = 6
3679  m2.j = 8

◆ testGlobalReplace()

def Config.TestModuleCommand.testGlobalReplace (   self)

Definition at line 2760 of file Config.py.

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

◆ testImplicitSchedule()

def Config.TestModuleCommand.testImplicitSchedule (   self)

Definition at line 3533 of file Config.py.

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

◆ testMaxEvents()

def Config.TestModuleCommand.testMaxEvents (   self)

Definition at line 3612 of file Config.py.

3612  def testMaxEvents(self):
3613  p = Process("Test")
3614  p.maxEvents.input = 10
3615  self.assertEqual(p.maxEvents.input.value(),10)
3616  p = Process("Test")
3617  p.maxEvents.output = 10
3618  self.assertEqual(p.maxEvents.output.value(),10)
3619  p = Process("Test")
3620  p.maxEvents.output = PSet(out=untracked.int32(10))
3621  self.assertEqual(p.maxEvents.output.out.value(), 10)
3622  p = Process("Test")
3623  p.maxEvents = untracked.PSet(input = untracked.int32(5))
3624  self.assertEqual(p.maxEvents.input.value(), 5)
3625  del p.maxEvents
3626  self.assertRaises(TypeError, setattr, p, 'maxEvents', untracked.PSet(input = untracked.uint32(1)))
3627  p.maxEvents = untracked.PSet(input = untracked.int32(1))
3628  self.assertEqual(p.maxEvents.input.value(), 1)
3629 

◆ testModifier()

def Config.TestModuleCommand.testModifier (   self)

Definition at line 4185 of file Config.py.

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

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

◆ testOptions()

def Config.TestModuleCommand.testOptions (   self)

Definition at line 3596 of file Config.py.

3596  def testOptions(self):
3597  p = Process('test')
3598  self.assertEqual(p.options.numberOfThreads.value(),1)
3599  p.options.numberOfThreads = 8
3600  self.assertEqual(p.options.numberOfThreads.value(),8)
3601  p.options = PSet()
3602  self.assertEqual(p.options.numberOfThreads.value(),1)
3603  p.options = dict(numberOfStreams =2,
3604  numberOfThreads =2)
3605  self.assertEqual(p.options.numberOfThreads.value(),2)
3606  self.assertEqual(p.options.numberOfStreams.value(),2)
3607  del p.options
3608  self.assertRaises(TypeError, setattr, p, 'options', untracked.PSet(numberOfThreads = int32(-1)))
3609  p.options = untracked.PSet(numberOfThreads = untracked.uint32(4))
3610  self.assertEqual(p.options.numberOfThreads.value(), 4)
3611 

◆ testOverride()

def Config.TestModuleCommand.testOverride (   self)

Definition at line 3573 of file Config.py.

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

◆ testParameterizable()

def Config.TestModuleCommand.testParameterizable (   self)

Definition at line 2281 of file Config.py.

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

◆ testPath()

def Config.TestModuleCommand.testPath (   self)

Definition at line 3254 of file Config.py.

References SequenceTypes.ignore(), and str.

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

◆ testPrefers()

def Config.TestModuleCommand.testPrefers (   self)

Definition at line 3642 of file Config.py.

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

3642  def testPrefers(self):
3643  p = Process("Test")
3644  p.add_(ESSource("ForceSource"))
3645  p.juicer = ESProducer("JuicerProducer")
3646  p.prefer("ForceSource")
3647  p.prefer("juicer")
3648  self.assertEqual(_lineDiff(p.dumpPython(), Process('Test').dumpPython()),
3649 """process.juicer = cms.ESProducer("JuicerProducer")
3650 process.ForceSource = cms.ESSource("ForceSource")
3651 process.prefer("ForceSource")
3652 process.prefer("juicer")""")
3653  p.prefer("juicer",fooRcd=vstring("Foo"))
3654  self.assertEqual(_lineDiff(p.dumpPython(), Process('Test').dumpPython()),
3655 """process.juicer = cms.ESProducer("JuicerProducer")
3656 process.ForceSource = cms.ESSource("ForceSource")
3657 process.prefer("ForceSource")
3658 process.prefer("juicer",
3659  fooRcd = cms.vstring('Foo')
3660 )""")
3661 
def _lineDiff(newString, oldString)
Definition: Config.py:2087
def dumpPython(process, name)

◆ testProcessAccelerator()

def Config.TestModuleCommand.testProcessAccelerator (   self)

Definition at line 4619 of file Config.py.

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

◆ testProcessDumpPython()

def Config.TestModuleCommand.testProcessDumpPython (   self)

Definition at line 2441 of file Config.py.

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

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

◆ testProcessExtend()

def Config.TestModuleCommand.testProcessExtend (   self)

Definition at line 2346 of file Config.py.

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

2346  def testProcessExtend(self):
2347  class FromArg(object):
2348  def __init__(self,*arg,**args):
2349  for name in args.keys():
2350  self.__dict__[name]=args[name]
2351 
2352  a=EDAnalyzer("MyAnalyzer")
2353  t=EDAnalyzer("MyAnalyzer")
2354  t.setLabel("foo")
2355  s1 = Sequence(a)
2356  s2 = Sequence(s1)
2357  s3 = Sequence(s2)
2358  d = FromArg(
2359  a=a,
2360  b=Service("Full"),
2361  c=Path(a),
2362  d=s2,
2363  e=s1,
2364  f=s3,
2365  g=Sequence(s1+s2+s3)
2366  )
2367  p = Process("Test")
2368  p.extend(d)
2369  self.assertEqual(p.a.type_(),"MyAnalyzer")
2370  self.assertEqual(p.a.label_(),"a")
2371  self.assertRaises(AttributeError,getattr,p,'b')
2372  self.assertEqual(p.Full.type_(),"Full")
2373  self.assertEqual(str(p.c),'a')
2374  self.assertEqual(str(p.d),'a')
2375 
2376  z1 = FromArg(
2377  a=a,
2378  b=Service("Full"),
2379  c=Path(a),
2380  d=s2,
2381  e=s1,
2382  f=s3,
2383  s4=s3,
2384  g=Sequence(s1+s2+s3)
2385  )
2386 
2387  p1 = Process("Test")
2388  #p1.extend(z1)
2389  self.assertRaises(ValueError, p1.extend, z1)
2390 
2391  z2 = FromArg(
2392  a=a,
2393  b=Service("Full"),
2394  c=Path(a),
2395  d=s2,
2396  e=s1,
2397  f=s3,
2398  aaa=copy.deepcopy(a),
2399  s4=copy.deepcopy(s3),
2400  g=Sequence(s1+s2+s3),
2401  t=t
2402  )
2403  p2 = Process("Test")
2404  p2.extend(z2)
2405  #self.assertRaises(ValueError, p2.extend, z2)
2406  self.assertEqual(p2.s4.label_(),"s4")
2407  #p2.s4.setLabel("foo")
2408  self.assertRaises(ValueError, p2.s4.setLabel, "foo")
2409  p2.s4.setLabel("s4")
2410  p2.s4.setLabel(None)
2411  p2.s4.setLabel("foo")
2412  p2._Process__setObjectLabel(p2.s4, "foo")
2413  p2._Process__setObjectLabel(p2.s4, None)
2414  p2._Process__setObjectLabel(p2.s4, "bar")
2415 
2416 
2417  p = Process('test')
2418  p.a = EDProducer("MyProducer")
2419  p.t = Task(p.a)
2420  p.p = Path(p.t)
2421  self.assertRaises(ValueError, p.extend, FromArg(a = EDProducer("YourProducer")))
2422  self.assertRaises(ValueError, p.extend, FromArg(a = EDAlias()))
2423  self.assertRaises(ValueError, p.__setattr__, "a", EDAlias())
2424 
2425  p = Process('test')
2426  p.a = EDProducer("MyProducer")
2427  p.t = ConditionalTask(p.a)
2428  p.p = Path(p.t)
2429  self.assertRaises(ValueError, p.extend, FromArg(a = EDProducer("YourProducer")))
2430  self.assertRaises(ValueError, p.extend, FromArg(a = EDAlias()))
2431  self.assertRaises(ValueError, p.__setattr__, "a", EDAlias())
2432 
2433  p = Process('test')
2434  p.a = EDProducer("MyProducer")
2435  p.s = Sequence(p.a)
2436  p.p = Path(p.s)
2437  self.assertRaises(ValueError, p.extend, FromArg(a = EDProducer("YourProducer")))
2438  self.assertRaises(ValueError, p.extend, FromArg(a = EDAlias()))
2439  self.assertRaises(ValueError, p.__setattr__, "a", EDAlias())
2440 
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 4605 of file Config.py.

4605  def testProcessForProcessAccelerator(self):
4606  proc = Process("TEST")
4607  p = ProcessForProcessAccelerator(proc)
4608  p.TestService = Service("TestService")
4609  self.assertTrue(hasattr(proc, "TestService"))
4610  self.assertEqual(proc.TestService.type_(), "TestService")
4611  self.assertRaises(TypeError, setattr, p, "a", EDProducer("Foo"))
4612  p.add_(Service("TestServiceTwo"))
4613  self.assertTrue(hasattr(proc, "TestServiceTwo"))
4614  self.assertEqual(proc.TestServiceTwo.type_(), "TestServiceTwo")
4615  p.TestService.foo = untracked.uint32(42)
4616  self.assertEqual(proc.TestService.foo.value(), 42)
4617  proc.mod = EDProducer("Producer")
4618  self.assertRaises(TypeError, getattr, p, "mod")

◆ testProcessFragment()

def Config.TestModuleCommand.testProcessFragment (   self)

Definition at line 4588 of file Config.py.

4588  def testProcessFragment(self):
4589  #check defaults are not overwritten
4590  f = ProcessFragment('Fragment')
4591  p = Process('PROCESS')
4592  p.maxEvents.input = 10
4593  p.options.numberOfThreads = 4
4594  p.maxLuminosityBlocks.input = 2
4595  p.extend(f)
4596  self.assertEqual(p.maxEvents.input.value(),10)
4597  self.assertEqual(p.options.numberOfThreads.value(), 4)
4598  self.assertEqual(p.maxLuminosityBlocks.input.value(),2)
4599  #general checks
4600  f = ProcessFragment("Fragment")
4601  f.fltr = EDFilter("Foo")
4602  p = Process('PROCESS')
4603  p.extend(f)
4604  self.assertTrue(hasattr(p,'fltr'))

◆ testProcessInsertion()

def Config.TestModuleCommand.testProcessInsertion (   self)

Definition at line 2321 of file Config.py.

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

◆ testPrune()

def Config.TestModuleCommand.testPrune (   self)

Definition at line 3839 of file Config.py.

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

◆ testRefToPSet()

def Config.TestModuleCommand.testRefToPSet (   self)

Definition at line 3715 of file Config.py.

3715  def testRefToPSet(self):
3716  proc = Process("test")
3717  proc.top = PSet(a = int32(1))
3718  proc.ref = PSet(refToPSet_ = string("top"))
3719  proc.ref2 = PSet( a = int32(1), b = PSet( refToPSet_ = string("top")))
3720  proc.ref3 = PSet(refToPSet_ = string("ref"))
3721  proc.ref4 = VPSet(PSet(refToPSet_ = string("top")),
3722  PSet(refToPSet_ = string("ref2")))
3723  p = TestMakePSet()
3724  proc.fillProcessDesc(p)
3725  self.assertEqual((True,1),p.values["ref"][1].values["a"])
3726  self.assertEqual((True,1),p.values["ref3"][1].values["a"])
3727  self.assertEqual((True,1),p.values["ref2"][1].values["a"])
3728  self.assertEqual((True,1),p.values["ref2"][1].values["b"][1].values["a"])
3729  self.assertEqual((True,1),p.values["ref4"][1][0].values["a"])
3730  self.assertEqual((True,1),p.values["ref4"][1][1].values["a"])

◆ testSchedule()

def Config.TestModuleCommand.testSchedule (   self)

Definition at line 3428 of file Config.py.

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

◆ testSecSource()

def Config.TestModuleCommand.testSecSource (   self)

Definition at line 2755 of file Config.py.

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

2755  def testSecSource(self):
2756  p = Process('test')
2757  p.a = SecSource("MySecSource")
2758  self.assertEqual(_lineDiff(p.dumpPython(),Process('test').dumpPython()),'process.a = cms.SecSource("MySecSource")')
2759 
def _lineDiff(newString, oldString)
Definition: Config.py:2087
def dumpPython(process, name)

◆ testSequence()

def Config.TestModuleCommand.testSequence (   self)

Definition at line 2831 of file Config.py.

References str.

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

◆ testSequence2()

def Config.TestModuleCommand.testSequence2 (   self)

Definition at line 2846 of file Config.py.

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

◆ testServiceInProcess()

def Config.TestModuleCommand.testServiceInProcess (   self)

Definition at line 2856 of file Config.py.

2856  def testServiceInProcess(self):
2857  service = Service("d")
2858  self.assertFalse(service._inProcess)
2859  process = Process("test")
2860  process.d = service
2861  self.assertTrue(service._inProcess)
2862  service2 = Service("d")
2863  process.d = service2
2864  self.assertFalse(service._inProcess)
2865  self.assertTrue(service2._inProcess)
2866  del process.d
2867  self.assertFalse(service2._inProcess)
2868 

◆ testSubProcess()

def Config.TestModuleCommand.testSubProcess (   self)

Definition at line 3680 of file Config.py.

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

3680  def testSubProcess(self):
3681  process = Process("Parent")
3682  subProcess = Process("Child")
3683  subProcess.a = EDProducer("A")
3684  subProcess.p = Path(subProcess.a)
3685  subProcess.add_(Service("Foo"))
3686  process.addSubProcess(SubProcess(subProcess))
3687  d = process.dumpPython()
3688  equalD ="""parentProcess = process
3689 process.a = cms.EDProducer("A")
3690 process.Foo = cms.Service("Foo")
3691 process.p = cms.Path(process.a)
3692 childProcess = process
3693 process = parentProcess
3694 process.addSubProcess(cms.SubProcess(process = childProcess, SelectEvents = cms.untracked.PSet(
3695 ), outputCommands = cms.untracked.vstring()))"""
3696  equalD = equalD.replace("parentProcess","parentProcess"+str(hash(process.subProcesses_()[0])))
3697  # SubProcesses are dumped before Services, so in order to
3698  # craft the dump of the Parent and Child manually the dump
3699  # of the Parent needs to be split at the MessageLogger
3700  # boundary (now when it is part of Process by default),
3701  # and insert the dump of the Child between the top part of
3702  # the Parent (before MessageLogger) and the bottom part of
3703  # the Parent (after and including MessageLogger)
3704  messageLoggerSplit = 'process.MessageLogger = cms.Service'
3705  parentDumpSplit = Process('Parent').dumpPython().split(messageLoggerSplit)
3706  childProcess = Process('Child')
3707  del childProcess.MessageLogger
3708  combinedDump = parentDumpSplit[0] + childProcess.dumpPython() + messageLoggerSplit + parentDumpSplit[1]
3709  self.assertEqual(_lineDiff(d, combinedDump), equalD)
3710  p = TestMakePSet()
3711  process.fillProcessDesc(p)
3712  self.assertEqual((True,['a']),p.values["subProcesses"][1][0].values["process"][1].values['@all_modules'])
3713  self.assertEqual((True,['p']),p.values["subProcesses"][1][0].values["process"][1].values['@paths'])
3714  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:2087
def dumpPython(process, name)
#define str(s)

◆ testSwitchProducer()

def Config.TestModuleCommand.testSwitchProducer (   self)

Definition at line 3731 of file Config.py.

References jetUpdater_cfi.sort.

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

◆ testTask()

def Config.TestModuleCommand.testTask (   self)

Definition at line 2869 of file Config.py.

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

◆ testTaskPlaceholder()

def Config.TestModuleCommand.testTaskPlaceholder (   self)

Definition at line 4002 of file Config.py.

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

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

◆ testTypedParameterizable()

def Config.TestModuleCommand.testTypedParameterizable (   self)

Definition at line 2314 of file Config.py.

2314  def testTypedParameterizable(self):
2315  p = _TypedParameterizable("blah", b=int32(1))
2316  #see if copy works deeply
2317  other = p.copy()
2318  other.b = 2
2319  self.assertNotEqual(p.b,other.b)
2320 

◆ testUsing()

def Config.TestModuleCommand.testUsing (   self)

Definition at line 3566 of file Config.py.

3566  def testUsing(self):
3567  p = Process('test')
3568  p.block = PSet(a = int32(1))
3569  p.modu = EDAnalyzer('Analyzer', p.block, b = int32(2))
3570  self.assertEqual(p.modu.a.value(),1)
3571  self.assertEqual(p.modu.b.value(),2)
3572 

Member Data Documentation

◆ a

Config.TestModuleCommand.a
static

Definition at line 2619 of file Config.py.

◆ b

Config.TestModuleCommand.b
static

Definition at line 2636 of file Config.py.

◆ c

Config.TestModuleCommand.c
static

Definition at line 2637 of file Config.py.

◆ d

Config.TestModuleCommand.d
static

Definition at line 2625 of file Config.py.

◆ e

Config.TestModuleCommand.e
static

Definition at line 2639 of file Config.py.

◆ f

Config.TestModuleCommand.f
static

Definition at line 2640 of file Config.py.

◆ g

Config.TestModuleCommand.g
static

Definition at line 2641 of file Config.py.

◆ maxDiff

Config.TestModuleCommand.maxDiff

Definition at line 4633 of file Config.py.

◆ p

Config.TestModuleCommand.p
static

Definition at line 2618 of file Config.py.

Referenced by Electron.Electron.ptErr().

◆ p2

Config.TestModuleCommand.p2
static

Definition at line 2623 of file Config.py.

◆ proc_mod_

Config.TestModuleCommand.proc_mod_

Definition at line 4296 of file Config.py.

◆ process

Config.TestModuleCommand.process
static

◆ r

Config.TestModuleCommand.r
static

Definition at line 2622 of file Config.py.

◆ s

Config.TestModuleCommand.s
static

Definition at line 2621 of file Config.py.

◆ s1

Config.TestModuleCommand.s1
static

Definition at line 2742 of file Config.py.

◆ s2

Config.TestModuleCommand.s2
static

Definition at line 2732 of file Config.py.

◆ s3

Config.TestModuleCommand.s3
static

Definition at line 2744 of file Config.py.

◆ schedule

Config.TestModuleCommand.schedule
static

Definition at line 2624 of file Config.py.

◆ task1

Config.TestModuleCommand.task1
static

Definition at line 2646 of file Config.py.

◆ task2

Config.TestModuleCommand.task2
static

Definition at line 2644 of file Config.py.

◆ task3

Config.TestModuleCommand.task3
static

Definition at line 2643 of file Config.py.

◆ task4

Config.TestModuleCommand.task4
static

Definition at line 2645 of file Config.py.

◆ task5

Config.TestModuleCommand.task5
static

Definition at line 2642 of file Config.py.

◆ tasks

Config.TestModuleCommand.tasks
static

Definition at line 2652 of file Config.py.