This class is used to define standard modifications to a Process.
An instance of this class is declared to denote a specific modification,e.g. era2017 could
reconfigure items in a process to match our expectation of running in 2017. Once declared,
these Modifier instances are imported into a configuration and items that need to be modified
are then associated with the Modifier and with the action to do the modification.
The registered modifications will only occur if the Modifier was passed to
the cms.Process' constructor.
Definition at line 1298 of file Config.py.
def Config.Modifier.toModify |
( |
|
self, |
|
|
|
obj, |
|
|
|
func = None , |
|
|
|
kw |
|
) |
| |
This is used to register an action to be performed on the specific object. Two different forms are allowed
Form 1: A callable object (e.g. function) can be passed as the second. This callable object is expected to take one argument
that will be the object passed in as the first argument.
Form 2: A list of parameter name, value pairs can be passed
mod.toModify(foo, fred=cms.int32(7), barney = cms.double(3.14))
This form can also be used to remove a parameter by passing the value of None
#remove the parameter foo.fred
mod.toModify(foo, fred = None)
Additionally, parameters embedded within PSets can also be modified using a dictionary
#change foo.fred.pebbles to 3 and foo.fred.friend to "barney"
mod.toModify(foo, fred = dict(pebbles = 3, friend = "barney)) )
Definition at line 1316 of file Config.py.
References RecoEcal_EventContent_cff.func, Config._AndModifier.isChosen(), Config.Modifier.isChosen(), and groupFilesInBlocks.temp.
1317 """This is used to register an action to be performed on the specific object. Two different forms are allowed 1318 Form 1: A callable object (e.g. function) can be passed as the second. This callable object is expected to take one argument 1319 that will be the object passed in as the first argument. 1320 Form 2: A list of parameter name, value pairs can be passed 1321 mod.toModify(foo, fred=cms.int32(7), barney = cms.double(3.14)) 1322 This form can also be used to remove a parameter by passing the value of None 1323 #remove the parameter foo.fred 1324 mod.toModify(foo, fred = None) 1325 Additionally, parameters embedded within PSets can also be modified using a dictionary 1326 #change foo.fred.pebbles to 3 and foo.fred.friend to "barney" 1327 mod.toModify(foo, fred = dict(pebbles = 3, friend = "barney)) ) 1329 if func
is not None and len(kw) != 0:
1330 raise TypeError(
"toModify takes either two arguments or one argument and key/value pairs")
1333 if func
is not None:
def toModify(self, obj, func=None, kw)