當前位置: 首頁>>代碼示例>>Python>>正文


Python Report.addRunInfoToFile方法代碼示例

本文整理匯總了Python中WMCore.FwkJobReport.Report.addRunInfoToFile方法的典型用法代碼示例。如果您正苦於以下問題:Python Report.addRunInfoToFile方法的具體用法?Python Report.addRunInfoToFile怎麽用?Python Report.addRunInfoToFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WMCore.FwkJobReport.Report的用法示例。


在下文中一共展示了Report.addRunInfoToFile方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: runHandler

# 需要導入模塊: from WMCore.FwkJobReport import Report [as 別名]
# 或者: from WMCore.FwkJobReport.Report import addRunInfoToFile [as 別名]
def runHandler():
    """
    _runHandler_

    Sink to add run information to a file.  Given the following XML:
      <Runs>
      <Run ID="122023">
        <LumiSection ID="215"/>
        <LumiSection ID="216"/>
      </Run>
      <Run ID="122024">
        <LumiSection ID="1"/>
        <LumiSection ID="2"/>
      </Run>    
      </Runs>

    Create a WMCore.DataStructs.Run object for each run and call the
    addRunInfoToFile() function to add the run information to the file
    section.
    """
    while True:
        fileSection, node = (yield)
        for subnode in node.children:
            if subnode.name == "Run":
                runId = subnode.attrs.get("ID", None)
                if runId == None:
                    continue

                lumis = [int(lumi.attrs["ID"]) for lumi in subnode.children if lumi.attrs.has_key("ID")]

                runInfo = Run(runNumber=runId)
                runInfo.lumis.extend(lumis)

                Report.addRunInfoToFile(fileSection, runInfo)
開發者ID:,項目名稱:,代碼行數:36,代碼來源:

示例2: addInputFilesToReport

# 需要導入模塊: from WMCore.FwkJobReport import Report [as 別名]
# 或者: from WMCore.FwkJobReport.Report import addRunInfoToFile [as 別名]
    def addInputFilesToReport(self, report):
        """
        _addInputFilesToReport_

        Pull all of the input files out of the job and add them to the report.
        """
        report.addInputSource("PoolSource")

        for inputFile in self.job["input_files"]:
            inputFileSection = report.addInputFile("PoolSource", lfn=inputFile["lfn"],
                                                   size=inputFile["size"],
                                                   events=inputFile["events"])
            Report.addRunInfoToFile(inputFileSection, inputFile["runs"])

        return
開發者ID:vkuznet,項目名稱:WMCore,代碼行數:17,代碼來源:ReportEmu.py

示例3: runHandler

# 需要導入模塊: from WMCore.FwkJobReport import Report [as 別名]
# 或者: from WMCore.FwkJobReport.Report import addRunInfoToFile [as 別名]
def runHandler():
    """
    _runHandler_

    Sink to add run information to a file.  Given the following XML:
      <Runs>
      <Run ID="122023">
        <LumiSection NEvents="100" ID="215"/>
        <LumiSection NEvents="100" ID="216"/>
      </Run>
      <Run ID="122024">
        <LumiSection ID="1"/>
        <LumiSection ID="2"/>
      </Run>
      </Runs>

    Create a WMCore.DataStructs.Run object for each run and call the
    addRunInfoToFile() function to add the run information to the file
    section.
    """
    while True:
        fileSection, node = (yield)
        for subnode in node.children:
            if subnode.name == "Run":
                runId = subnode.attrs.get("ID", None)
                if runId is None:
                    continue

                lumis = []
                for lumi in subnode.children:
                    if "ID" in lumi.attrs:
                        lumiNumber = int(lumi.attrs['ID'])
                        nEvents = lumi.attrs.get("NEvents", None)
                        if nEvents is not None:
                            try:
                                nEvents = int(nEvents)
                            except ValueError:
                                nEvents = None
                        lumis.append((lumiNumber, nEvents))
                runInfo = Run(runNumber=runId)
                runInfo.extendLumis(lumis)

                Report.addRunInfoToFile(fileSection, runInfo)
開發者ID:alexanderrichards,項目名稱:WMCore,代碼行數:45,代碼來源:XMLParser.py

示例4: addOutputFilesToReport

# 需要導入模塊: from WMCore.FwkJobReport import Report [as 別名]
# 或者: from WMCore.FwkJobReport.Report import addRunInfoToFile [as 別名]
    def addOutputFilesToReport(self, report):
        """
        _addOutputFilesToReport_

        Add output files to every output module in the step.  Scale the size
        and number of events in the output files appropriately.
        """
        (outputSize, outputEvents) = self.determineOutputSize()

        if not os.path.exists('ReportEmuTestFile.txt'):
            f = open('ReportEmuTestFile.txt', 'w')
            f.write('A Shubbery')
            f.close()

        for outputModuleName in self.step.listOutputModules():
            outputModuleSection = self.step.getOutputModule(outputModuleName)
            outputModuleSection.fixedLFN    = False
            outputModuleSection.disableGUID = False

            outputLFN = "%s/%s.root" % (outputModuleSection.lfnBase,
                                        str(makeUUID()))
            outputFile = File(lfn = outputLFN, size = outputSize, events = outputEvents,
                              merged = False)
            outputFile.setLocation(self.job["location"])
            outputFile['pfn'] = "ReportEmuTestFile.txt"
            outputFile['guid'] = "ThisIsGUID"
            outputFile["checksums"] = {"adler32": "1234", "cksum": "5678"}
            outputFile["dataset"] = {"primaryDataset": outputModuleSection.primaryDataset,
                                     "processedDataset": outputModuleSection.processedDataset,
                                     "dataTier": outputModuleSection.dataTier,
                                     "applicationName": "cmsRun",
                                     "applicationVersion": self.step.getCMSSWVersion()}
            outputFile["module_label"] = outputModuleName

            outputFileSection = report.addOutputFile(outputModuleName, outputFile)
            for inputFile in self.job["input_files"]:
                Report.addRunInfoToFile(outputFileSection, inputFile["runs"])

        return
開發者ID:PerilousApricot,項目名稱:WMCore,代碼行數:41,代碼來源:ReportEmu.py

示例5: range

# 需要導入模塊: from WMCore.FwkJobReport import Report [as 別名]
# 或者: from WMCore.FwkJobReport.Report import addRunInfoToFile [as 別名]
                     39, 40])

totalReports = 25
inputFilesPerReport = 50

inputFileCounter = 0
for i in range(totalReports):
    loadTestReport = Report.Report("cmsRun1")
    loadTestReport.addInputSource("PoolSource")

    for j in range(inputFilesPerReport):
        inputFile = loadTestReport.addInputFile("PoolSource", lfn = "input%i" % inputFileCounter,
                                                events = 600000, size = 600000)
        inputFileCounter += 1

    Report.addRunInfoToFile(inputFile, runInfo)

    for outputModule in outputModules:
        loadTestReport.addOutputModule(outputModule)
        datasetInfo = {"applicationName": "cmsRun", "applicationVersion": "CMSSW_3_3_5_patch3",
                       "primaryDataset": outputModule, "dataTier": "RAW",
                       "processedDataset": "LoadTest10"}
        fileAttrs = {"lfn": makeUUID(), "location": "cmssrm.fnal.gov",
                     "checksums": {"adler32": "ff810ec3", "cksum": "2212831827"},
                     "events": random.randrange(500, 5000, 50),
                     "merged": True,
                     "size": random.randrange(1000, 2000, 100000000),
                     "module_label": outputModule, "dataset": datasetInfo}

        outputFile = loadTestReport.addOutputFile(outputModule, fileAttrs)
        Report.addRunInfoToFile(outputFile, runInfo)
開發者ID:alexanderrichards,項目名稱:WMCore,代碼行數:33,代碼來源:genheritagetest.py


注:本文中的WMCore.FwkJobReport.Report.addRunInfoToFile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。