本文整理匯總了Python中WMCore.FwkJobReport.Report.addAttributesToFile方法的典型用法代碼示例。如果您正苦於以下問題:Python Report.addAttributesToFile方法的具體用法?Python Report.addAttributesToFile怎麽用?Python Report.addAttributesToFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WMCore.FwkJobReport.Report
的用法示例。
在下文中一共展示了Report.addAttributesToFile方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: inputFileHandler
# 需要導入模塊: from WMCore.FwkJobReport import Report [as 別名]
# 或者: from WMCore.FwkJobReport.Report import addAttributesToFile [as 別名]
def inputFileHandler(targets):
"""
_inputFileHandler_
coroutine to create input files in the report and dispatch
sub data down the pipeline
"""
while True:
report, node = (yield)
moduleName = None
moduleNode = [ x for x in node.children if x.name == "ModuleLabel"][0]
moduleName = moduleNode.text
moduleRef = report.addInputSource(moduleName)
fileRef = report.addInputFile(moduleName)
fileAttrs = {}
for subnode in node.children:
if subnode.name == "Runs":
targets['Runs'].send( (fileRef, subnode) )
elif subnode.name == "Branches":
targets['Branches'].send( (fileRef, subnode) )
else:
fileAttrs[subnode.name] = subnode.text
Report.addAttributesToFile(fileRef, lfn = fileAttrs["LFN"],
pfn = fileAttrs["PFN"], catalog = fileAttrs["Catalog"],
module_label = fileAttrs["ModuleLabel"],
guid = fileAttrs["GUID"], input_type = fileAttrs["InputType"],
input_source_class = fileAttrs["InputSourceClass"],
events = int(fileAttrs["EventsRead"]))
[fileRef]
示例2: fileHandler
# 需要導入模塊: from WMCore.FwkJobReport import Report [as 別名]
# 或者: from WMCore.FwkJobReport.Report import addAttributesToFile [as 別名]
def fileHandler(targets):
"""
_fileHandler_
coroutine to create files and handle sub data in the appropriate
dispatchers
"""
while True:
report, node = (yield)
moduleName = None
moduleNode = [x for x in node.children if x.name == "ModuleLabel"][0]
moduleName = moduleNode.text
moduleRef = report.addOutputModule(moduleName)
fileRef = report.addOutputFile(moduleName)
fileAttrs = {}
for subnode in node.children:
if subnode.name == "Inputs":
targets["Inputs"].send((fileRef, subnode))
elif subnode.name == "Runs":
targets["Runs"].send((fileRef, subnode))
elif subnode.name == "Branches":
targets["Branches"].send((fileRef, subnode))
else:
fileAttrs[subnode.name] = subnode.text
Report.addAttributesToFile(
fileRef,
lfn=fileAttrs["LFN"],
pfn=fileAttrs["PFN"],
catalog=fileAttrs["Catalog"],
module_label=fileAttrs["ModuleLabel"],
guid=fileAttrs["GUID"],
ouput_module_class=fileAttrs["OutputModuleClass"],
events=int(fileAttrs["TotalEvents"]),
branch_hash=fileAttrs["BranchHash"],
)
[fileRef]