• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python myutils.BetterConfigParser类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中myutils.BetterConfigParser的典型用法代码示例。如果您正苦于以下问题:Python BetterConfigParser类的具体用法?Python BetterConfigParser怎么用?Python BetterConfigParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了BetterConfigParser类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: _setup_configfiles

    def _setup_configfiles(self, Testboard):
        """ Changes config files in the already copied test directory according to test definitions
            from elComandante's init file. """

        # Delete all root files which are already in the directory
        root_files = glob.glob(Testboard.testdir+'/*.root')
        for f in root_files:
            os.remove(f)
        # Change testboard name
	if Testboard.DTB and os.path.isfile(Testboard.testdir + "/tb"):
            self._config_file_content_substitute(Testboard.testdir + "/tb", {"id":Testboard.address})
        else:
            self._config_file_content_substitute(Testboard.testdir + "/configParameters.dat", {"testboardName":Testboard.address})

        # Get test specific config parameters (if available)
        params = ()
        try:
            params = self.init.items("Test " + self.test.testname)
        except:
            return
        for par in params:
            file = par[0]
            if '.cfg' in file:
                section,pair = par[1].split(':')
                key,value = pair.split('=')
                config_file = BetterConfigParser()
                config_file.read(Testboard.testdir + "/" + file)
                config_file.set(section,key,value)
                write_file = open(Testboard.testdir + "/" + file, 'write')
                config_file.write(write_file)
                write_file.close()
                continue
            # Check for valid keys that represent config files
            elif "testParameters" in file or "dacParameters" in file or "configParameters" in file:
                pass
            elif "tbmParameters" in file or "tbParameters" in file:
                pass
            else:
                continue

            encoded_keys = par[1].split(",")
            keys = {}
            for key in encoded_keys:
                key = key.split("=", 2)
                if len(key) != 2:
                    continue
                keys[key[0]] = key[1]
            if len(file) < 4 or file[-4:] != ".dat":
                file += ".dat"
            self._config_file_content_substitute(Testboard.testdir + "/" + file, keys)
开发者ID:fnal,项目名称:elComandante,代码行数:50,代码来源:psi_agente.py


示例2: __init__

    def __init__(self, TB, client, psiSubscription, Logger, color='black', psiVersion='psi46expert'):
        self.TB = TB
        self.client = client
        self.psiSubscription = psiSubscription
        self.color = color
        self.Logger = Logger
        self.TBSubscription = '/TB%s'%self.TB
        self.client.subscribe(self.TBSubscription)
        self.dir = ''
        self.psiVersion = psiVersion
        if self.psiVersion.lower().endswith("psi46expert"):
            self.version ='psi46expert'
        elif self.psiVersion.lower().endswith("pyxar"):
            self.version ='pyxar'
        elif self.psiVersion.lower().endswith("pxar"):
            self.version ='pxar'
        else:
            self.version = 'unknown'
        self.failed = False
        self.busy = False
        self.testName ='unkown'
        self.testNo = -1
        self.TestEnd = False
        self.DoTest= False
        self.ClosePSI= False
        self.Abort = False
        self.LogFile = ""
        self.RootFile = ""
        # default value in Vcal units, -1 means use untrimmed parameters
        #  this setting is overwritten if [Test Trim] is specified in the ini file
        #  containg testParameters=Vcal=*
        self.trimVcal = -1 

        self.init = BetterConfigParser()
        self.init.read("../config/elComandante.ini")
        try:
            testParameters = self.init.get('Test Trim','testParameters')
            pos1 = testParameters.find("=")
            if pos1 > 0:
                testParametersName = testParameters[0:pos1]
                testParametersValue = testParameters[pos1+1:]
                if testParametersName.lower() == "vcal":
                    self.trimVcal = int(testParametersValue)
                    self.Logger << "TB%s: using option '-T %s' when calling pxar"%(self.TB, self.trimVcal)
        except:
            self.Logger << "TB%s: no [Test Trim] section found in ini file, using untrimmed parameters"%self.TB
开发者ID:fnal,项目名称:elComandante,代码行数:46,代码来源:tbmaster.py


示例3: __init__

    def __init__(self, opts):

        # get file list
        self.filelist = FileList.decompress(opts.fileList) if len(opts.fileList) > 0 else None
        print "len(filelist)",len(self.filelist),
        if len(self.filelist) > 0:
            print "filelist[0]:", self.filelist[0]
        else:
            print ''

        # config
        self.debug = 'XBBDEBUG' in os.environ
        self.verifyCopy = True
        self.opts = opts
        self.config = BetterConfigParser()
        self.config.read(opts.config)
        samplesinfo = self.config.get('Directories', 'samplesinfo')
        self.channel = self.config.get('Configuration', 'channel')

        # load namespace, TODO
        VHbbNameSpace = self.config.get('VHbbNameSpace', 'library')
        ROOT.gSystem.Load(VHbbNameSpace)

        # directories
        self.pathIN = self.config.get('Directories', opts.inputDir)
        self.pathOUT = self.config.get('Directories', opts.outputDir)
        self.tmpDir = self.config.get('Directories', 'scratch')
        print 'INput samples:\t%s'%self.pathIN
        print 'OUTput samples:\t%s'%self.pathOUT

        self.fileLocator = FileLocator(config=self.config)

        # check if given sample identifier uniquely matches a samples from config
        matchingSamples = ParseInfo(samplesinfo, self.pathIN).find(identifier=opts.sampleIdentifier)
        if len(matchingSamples) != 1:
            print "ERROR: need exactly 1 sample identifier as input with -S !!"
            print matchingSamples
            exit(1)
        self.sample = matchingSamples[0]

        # collections
        self.collections = [x.strip() for x in opts.addCollections.split(',') if len(x.strip()) > 0] if len(opts.addCollections.strip())>0  else []
        if len(self.collections) < 1:
            print "\x1b[31mWARNING: no collections added! Specify the collections to add with the --addCollections option!\x1b[0m"
        print 'collections to add:', self.collections
        self.collections = self.parseCollectionList(self.collections)
        print 'after parsing:', self.collections

        # temorary folder to save the files of this job on the scratch
        temporaryName = self.sample.identifier + '/' + uuid.uuid4().hex

        # input files
        self.subJobs = []
        if opts.join:
            print("INFO: join input files! This is an experimental feature!")

            # translate naming convention of .txt file to imported files after the prep step
            inputFileNamesAfterPrep = [self.fileLocator.getFilenameAfterPrep(x) for x in self.filelist]

            self.subJobs.append({
                'inputFileNames': self.filelist,
                'localInputFileNames': ["{path}/{subfolder}/{filename}".format(path=self.pathIN, subfolder=self.sample.identifier, filename=localFileName) for localFileName in inputFileNamesAfterPrep],
                'outputFileName': "{path}/{subfolder}/{filename}".format(path=self.pathOUT, subfolder=self.sample.identifier, filename=inputFileNamesAfterPrep[0]),
                'tmpFileName': "{path}/{subfolder}/{filename}".format(path=self.tmpDir, subfolder=temporaryName, filename=inputFileNamesAfterPrep[0]),
                })

        else:
            
            # create separate subjob for all files (default!)
            for inputFileName in self.filelist:
                inputFileNamesAfterPrep = [self.fileLocator.getFilenameAfterPrep(inputFileName)]

                self.subJobs.append({
                    'inputFileNames': [inputFileName],
                    'localInputFileNames': ["{path}/{subfolder}/{filename}".format(path=self.pathIN, subfolder=self.sample.identifier, filename=localFileName) for localFileName in inputFileNamesAfterPrep],
                    'outputFileName': "{path}/{subfolder}/{filename}".format(path=self.pathOUT, subfolder=self.sample.identifier, filename=inputFileNamesAfterPrep[0]),
                    'tmpFileName': "{path}/{subfolder}/{filename}".format(path=self.tmpDir, subfolder=temporaryName, filename=inputFileNamesAfterPrep[0]),
                    })
开发者ID:GLP90,项目名称:Xbb,代码行数:78,代码来源:sys_new.py


示例4: countEvents

            #print fileMask
            extPartFiles = glob.glob(fileMask)
            #print extPart,"=>",len(extPartFiles),"files"
            extPartCounts[extPart] = 0
            for extPartFile in extPartFiles:
                extPartCounts[extPart] += countEvents(t3proto + '/' + extPartFile)
                #root://t3dcachedb03.psi.ch:1094
    
    # get total count
    totalCount = sum([n for sampleName,n in extPartCounts.iteritems()])

    # relative weights
    for sampleName,n in extPartCounts.iteritems():
        print sampleName,":",(1.0*n/totalCount if totalCount > 0 else '-')

config = BetterConfigParser()
configPath = sys.argv[1] + '/samples_nosplit.ini'
config.read(configPath)
configPath = sys.argv[1] + '/paths.ini'
config.read(configPath)

sampleDict = {}
sampleWeights = {}
verify = len(sys.argv) > 2 and sys.argv[2]=='verify'

##############
#Specialweight
##############

#ZLLIncl = ["DYJetsToLL_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8_ext1","DYJetsToLL_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8_ext2"]
#
开发者ID:GLP90,项目名称:Xbb,代码行数:31,代码来源:getExtWeights.py


示例5: BetterConfigParser

if opts.task == "":
    print "Please provide a task.\n-J prep:\tpreparation of Trees\n-J sys:\t\twrite regression and systematics\n-J eval:\tcreate MVA output\n-J plot:\tproduce Plots\n-J dc:\t\twrite workspaces and datacards"
    sys.exit(123)


en = opts.tag

#create the list with the samples to run over
samplesList=opts.samples.split(",")
timestamp = time.asctime().replace(' ','_').replace(':','-')

if(debugPrintOUts): print 'samplesList',samplesList
if(debugPrintOUts): print 'timestamp',timestamp

# the list of the config is taken from the path config
pathconfig = BetterConfigParser()
pathconfig.read('%sconfig/paths'%(en))
_configs = pathconfig.get('Configuration','List').split(" ")
configs = [ '%sconfig/'%(en) + c for c in _configs  ]

if(debugPrintOUts): print 'configs',configs
if(debugPrintOUts): print 'opts.ftag',opts.ftag

if not opts.ftag == '':
    tagDir = pathconfig.get('Directories','tagDir')
    # DEBUG PURPOSE ONLY        
    # sys.exit()
    if(debugPrintOUts): print 'tagDir',tagDir
    DirStruct={'tagDir':tagDir,'ftagdir':'%s/%s/'%(tagDir,opts.ftag),'logpath':'%s/%s/%s/'%(tagDir,opts.ftag,'Logs'),'plotpath':'%s/%s/%s/'%(tagDir,opts.ftag,'Plots'),'limitpath':'%s/%s/%s/'%(tagDir,opts.ftag,'Limits'),'confpath':'%s/%s/%s/'%(tagDir,opts.ftag,'config') }
    
    if(debugPrintOUts): print 'DirStruct',DirStruct
开发者ID:perrozzi,项目名称:VHbb,代码行数:31,代码来源:submitThem.py


示例6: BetterConfigParser

parser.add_option("-S","--setting", dest="MVAsettings", default='',
                      help="Parameter setting string")
parser.add_option("-N","--name", dest="set_name", default='',
                      help="Parameter setting name. Output files will have this name")
parser.add_option("-L","--local",dest="local", default=True,
                      help="True to run it locally. False to run on batch system using config")

(opts, args) = parser.parse_args(argv)
if opts.config =="":
        opts.config = "config"

#Import after configure to get help message
from myutils import BetterConfigParser, mvainfo, ParseInfo, TreeCache

#load config
config = BetterConfigParser()
config.read(opts.config)
anaTag = config.get("Analysis","tag")
run = opts.training
gui = opts.verbose

print '-----> Input Training Sample(s): ', run

#GLOABAL rescale from Train/Test Spliiting:
global_rescale=2.

#get locations:
MVAdir      = config.get('Directories','vhbbpath')+'/data/'
samplesinfo = config.get('Directories','samplesinfo')

#systematics
开发者ID:dcurry09,项目名称:Heppy,代码行数:31,代码来源:train.py


示例7: OptionParser

argv = sys.argv
parser = OptionParser()
#parser.add_option("-P", "--path", dest="path", default="", 
#                      help="path to samples")
parser.add_option("-S", "--samples", dest="names", default="", 
                      help="samples you want to run on")
parser.add_option("-C", "--config", dest="config", default=[], action="append",
                      help="configuration defining the plots to make")
(opts, args) = parser.parse_args(argv)
if opts.config =="":
        opts.config = "config"

from myutils import BetterConfigParser, ParseInfo

print opts.config
config = BetterConfigParser()
config.read(opts.config)
anaTag = config.get("Analysis","tag")
TrainFlag = eval(config.get('Analysis','TrainFlag'))
btagLibrary = config.get('BTagReshaping','library')
samplesinfo=config.get('Directories','samplesinfo')

VHbbNameSpace=config.get('VHbbNameSpace','library')
ROOT.gSystem.Load(VHbbNameSpace)
AngLikeBkgs=eval(config.get('AngularLike','backgrounds'))
ang_yield=eval(config.get('AngularLike','yields'))

#path=opts.path
pathIN = config.get('Directories','SYSin')
pathOUT = config.get('Directories','SYSout')
tmpDir = os.environ["TMPDIR"]
开发者ID:perrozzi,项目名称:VHbb,代码行数:31,代码来源:write_regression_systematics.py


示例8: BetterConfigParser

parser.add_option("-C", "--config", dest="config", default=[], action="append",
                              help="configuration defining bins")
parser.add_option("-A", "--apply", dest="apply", default=True, action="store_true",
                              help="configuration defining the")
parser.add_option("-W", "--weight", dest="weights", default=True, action="store_false",
                              help="Calculate the weights")
parser.add_option("-V", "--validate", dest="validate", default=False, action="store_false",
                              help="Make validation plot the weights")
(opts, args) = parser.parse_args(argv)
if opts.config =="":
    opts.config = "config"

from myutils import BetterConfigParser

print opts.config
config = BetterConfigParser()
config.read(opts.config)
prefix = config.get('lheWeights','prefix')
newpostfix = config.get('lheWeights','newpostfix')
inclusive = config.get('lheWeights','inclusive')
files = eval(config.get('lheWeights','fileList'))
lheBin = eval(config.get('lheWeights','lheBin'))

print '\n========= Looping over Drell Yan Samples ==========\n'

fileList = []
for file in files:
    new_entry = [prefix+file+'.root',files[file],[]]
    print new_entry
    if file == inclusive:
        fileList.insert(0, new_entry)
开发者ID:dcurry09,项目名称:Heppy,代码行数:31,代码来源:addingSamples.py


示例9: OptionParser

            newLine += words[i].ljust(maxColumnWidth[i]+1)
        file_.write(newLine+'\n')
    file_.close()
    return



#--CONFIGURE---------------------------------------------------------------------
argv = sys.argv
parser = OptionParser()
parser.add_option("-V", "--variable", dest="variable", default="",
                      help="variable for shape analysis")
parser.add_option("-C", "--config", dest="config", default=[], action="append",
                      help="configuration file")
(opts, args) = parser.parse_args(argv)
config = BetterConfigParser()
config.read(opts.config)
var=opts.variable
#-------------------------------------------------------------------------------

# Add external macros
#ROOT.gSystem.CompileMacro("../plugins/PU.C")

#--read variables from config---------------------------------------------------
# 7 or 8TeV Analysis
anaTag = config.get("Analysis","tag")

# Directories:
Wdir=config.get('Directories','Wdir')
vhbbpath=config.get('Directories','vhbbpath')
samplesinfo=config.get('Directories','samplesinfo')
开发者ID:dcurry09,项目名称:Heppy,代码行数:31,代码来源:workspace_datacard.py


示例10: getEventCount

# 1) ./getExtWeights.py configname
# 2) ./getExtWeight.py configname verify

def getEventCount(config, sampleIdentifier, cut="1", sampleTree=None):
    if not sampleTree:
        sampleTree = SampleTree({'name': sampleIdentifier, 'folder': config.get('Directories',args.fromFolder).strip()}, config=config)
    h1 = ROOT.TH1D("h1","h1",1,0,2)
    nEvents = sampleTree.tree.Draw("1>>h1", "(" + cut + ")*genWeight")
    nEventsWeighted = h1.GetBinContent(1)
    h1.Delete()
    return nEventsWeighted


# load config
config = BetterConfigParser()
configFolder = args.tag + 'config/'
print "config folder:", configFolder
config.read(configFolder + '/paths.ini')
configFiles = [x for x in config.get('Configuration','List').strip().split(' ') if len(x.strip()) > 0]
config = BetterConfigParser()
for configFile in configFiles:
    config.read(configFolder + configFile)
    print "read config ", configFile

pruneThreshold = float(args.prune)

sampleGroups = []
for x in args.samples.split(','):
    sampleGroups.append(x.split('+'))
开发者ID:GLP90,项目名称:Xbb,代码行数:29,代码来源:getExtWeightsNew.py


示例11: OptionParser

#!/usr/bin/env python
import ROOT

ROOT.gROOT.SetBatch(True)
from ROOT import TFile
from optparse import OptionParser
import sys
from myutils import BetterConfigParser, TdrStyles, getRatio


argv = sys.argv
parser = OptionParser()
parser.add_option("-C", "--config", dest="config", default=[], action="append", help="configuration file")
(opts, args) = parser.parse_args(argv)
config = BetterConfigParser()
config.read(opts.config)


# ---------- yes, this is not in the config yet---------
mode = "BDT"
xMin = -1
xMax = 1
masses = ["125"]
Abins = ["HighPt", "LowPt"]
channels = ["Zee", "Zmm"]
# ------------------------------------------------------
# ---------- Mjj ---------------------------------------
# mode = 'Mjj'
# xMin=0
# xMax=255
# masses = ['125']
开发者ID:silviodonato,项目名称:Xbb,代码行数:31,代码来源:plot_systematics.py


示例12: BetterConfigParser

parser.add_option("-o","--force", action="store_true", dest="force", default=False,
                      help="force overwriting of already cached files")
(opts, args) = parser.parse_args(argv)

if opts.config == "":
        opts.config = "config"

weight = opts.weight
evaluate_optimisation = False
if weight != '':
    evaluate_optimisation = True

#Import after configure to get help message
from myutils import BetterConfigParser, ParseInfo, MvaEvaluator

config = BetterConfigParser()
config.read(opts.config)
anaTag = config.get("Analysis", "tag")

fileLocator = FileLocator(config=config)
print ("OPTS", opts)
if len(opts.fileList) > 0:
    filelist = FileList.decompress(opts.fileList) if len(opts.fileList) > 0 else None
    print ("len(filelist)", len(filelist))
    if len(filelist) > 0:
        print ("filelist[0]:", filelist[0])
else:
    filelist = SampleTree({'name': opts.sampleIdentifier, 'folder': config.get('Directories', 'MVAin')}, countOnly=True, splitFilesChunkSize=-1, config=config).getSampleFileNameChunks()[0]
    print ("INFO: no file list given, use all files!")
    print (len(filelist), filelist)
开发者ID:GLP90,项目名称:Xbb,代码行数:30,代码来源:evaluateMVA.py


示例13: OptionParser

#!/usr/bin/env python
import os,sys,ROOT
from optparse import OptionParser
ROOT.gROOT.SetBatch(True)

#--CONFIGURE---------------------------------------------------------------------
argv = sys.argv
parser = OptionParser()
parser.add_option("-S", "--section", dest="section", default="Cuts",
                              help="Config section")
parser.add_option("-V", "--value", dest="var", default="",
                              help="Config value")
parser.add_option("-C", "--config", dest="config", default=[], action="append",
                              help="configuration file")
(opts, args) = parser.parse_args(argv)

from myutils import BetterConfigParser

config = BetterConfigParser()
config.read(opts.config)
print config.get(opts.section,opts.var)
开发者ID:GLP90,项目名称:Xbb,代码行数:21,代码来源:config_unroller.py


示例14: OptionParser


ROOT.gROOT.SetBatch(True)

# Import heppy configurations
argv = sys.argv
parser = OptionParser()
parser.add_option("-S", "--samples", dest="names", default="",
                                        help="samples you want to run on")
parser.add_option("-C", "--config", dest="config", default=[], action="append",
                                        help="configuration defining the plots to make")
(opts, args) = parser.parse_args(argv)
if opts.config =="":
            opts.config = "config"

config = BetterConfigParser()
config.read(opts.config)

samplesinfo = config.get('Directories','samplesinfo')

tmpDir = os.environ["TMPDIR"]

pathIN = config.get('Directories','SYSout')
pathOUT = config.get('Directories','SYSout')

name = config.get('TrainRegression', 'name') 

namelist = opts.names.split(',')

info = ParseInfo(samplesinfo,pathIN)
开发者ID:dcurry09,项目名称:Heppy,代码行数:28,代码来源:kinFit_Hmass.py


示例15: BetterConfigParser

    parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
                              help="Verbose mode.")
    parser.add_option("-C", "--config", dest="config", default=[], action="append",
                          help="configuration file")
    parser.add_option("-r","--regions", dest="regions", default='',
                          help="cut region identifiers, separated by comma")
    parser.add_option("-t","--type", dest="fitType", default='',
                          help="shapes_prefit, shapes_fit_b, shapes_fit_s")

    (opts, args) = parser.parse_args(argv)
    if opts.config == "":
            opts.config = ["config"]

    # Import after configure to get help message
    from myutils import BetterConfigParser, mvainfo, ParseInfo
    config = BetterConfigParser()
    config.read(opts.config)

    if len(opts.fitType) < 1:
        if config.has_option('Fit','FitType'):
            opts.fitType = config.get('Fit','FitType')
        else:
            opts.fitType = "shapes_prefit"

    # run plotter
    if len(opts.regions) < 1:
        regions = eval(config.get('Fit', 'regions')).keys()
    else:
        regions = opts.regions.split(',')
    for region in regions:
        plotter = PostfitPlotter(config=config, region=region, directory=opts.fitType)
开发者ID:GLP90,项目名称:Xbb,代码行数:31,代码来源:postfit_plot.py


示例16: OptionParser

    ROOT.gROOT.LoadMacro("../interface/DrawFunctions_C.so")

argv = sys.argv

#get files info from config
parser = OptionParser()
parser.add_option("-C", "--config", dest="config", default=[], action="append",
                      help="directory config")
parser.add_option("-S", "--sampleIdentifier", dest="sampleIdentifier", default="",
                              help="samples you want to run on")
parser.add_option("-f", "--fileList", dest="fileList", default="",
                              help="list of files you want to run on")
parser.add_option("-l", "--limit", dest="limit", default=None,
                              help="max number of files to process")
(opts, args) = parser.parse_args(argv)
config = BetterConfigParser()
config.read(opts.config)

fileList = FileList.decompress(opts.fileList) if len(opts.fileList)>0 else None

pathOUT = config.get('Directories','PREPout')
samplesinfo=config.get('Directories','samplesinfo')
samplefiles = config.get('Directories','samplefiles')
sampleconf = BetterConfigParser()
sampleconf.read(samplesinfo)

whereToLaunch = config.get('Configuration','whereToLaunch')

info = ParseInfo(samplesinfo, None)
samples = [x for x in info if not x.subsample and (len(opts.sampleIdentifier) == 0 or x.identifier in opts.sampleIdentifier.split(','))]
treeCopier = copytreePSI.CopyTreePSI(config=config)
开发者ID:GLP90,项目名称:Xbb,代码行数:31,代码来源:prepare_environment_with_config.py


示例17: printer

                        default="../DATA/logfiles")
parser.add_argument("-num","--numTB", dest="numTB",
                        help="specify the number of Testboards in use",
                        default="1")
#parse args and setup logdir
args = parser.parse_args()
Logger = printer()
Logger.set_name("Psi46Log")
Logger.set_prefix('')
Logger.set_logfile('%s'%(args.loggingDir),'psi46Handler.log')
Logger <<'ConfigDir: "%s"'%args.configDir
configDir= args.configDir

numTB = int(args.numTB)
#load config
config = BetterConfigParser()
config.read(configDir+'/elComandante.conf')
#config
clientName = "psi46"
serverZiel=config.get('subsystem','Ziel')
Port = int(config.get('subsystem','Port'))
serverPort = int(config.get('subsystem','Port'))
psiSubscription = config.get('subsystem','psiSubscription')
errorSubscription = "/error"
#construct
client = sClient(serverZiel,serverPort,clientName)
#subscribe
client.subscribe(psiSubscription)
#----------------------------------------------------

#handler
开发者ID:fnal,项目名称:elComandante,代码行数:31,代码来源:psi46master.py


示例18: OptionParser

argv = sys.argv
parser = OptionParser()
#parser.add_option("-P", "--path", dest="path", default="",
#                      help="path to samples")
parser.add_option("-S", "--samples", dest="names", default="",
                      help="samples you want to run on")
parser.add_option("-C", "--config", dest="config", default=[], action="append",
                      help="configuration defining the plots to make")
(opts, args) = parser.parse_args(argv)
if opts.config =="":
        opts.config = "config"

from myutils import BetterConfigParser, ParseInfo, TreeCache

print opts.config
config = BetterConfigParser()
config.read(opts.config)
anaTag = config.get("Analysis","tag")
TrainFlag = eval(config.get('Analysis','TrainFlag'))
btagLibrary = config.get('BTagReshaping','library')
samplesinfo=config.get('Directories','samplesinfo')

VHbbNameSpace=config.get('VHbbNameSpace','library')
ROOT.gSystem.Load(VHbbNameSpace)
AngLikeBkgs=eval(config.get('AngularLike','backgrounds'))
ang_yield=eval(config.get('AngularLike','yields'))

#path=opts.path
pathIN = config.get('Directories','SYSin')
pathOUT = config.get('Directories','SYSout')
tmpDir = os.environ["TMPDIR"]
开发者ID:GLP90,项目名称:Xbb,代码行数:31,代码来源:only_regression.py


示例19: print

evaluate_optimisation = False
if weight != '': evaluate_optimisation = True

print ('opts.filelist="'+opts.filelist+'"')
filelist=filter(None,opts.filelist.replace(' ', '').split(';'))
print (filelist)
print ("len(filelist)",len(filelist),)
if len(filelist)>0:
    print ("filelist[0]:",filelist[0])
else:
    print ('')

#Import after configure to get help message
from myutils import BetterConfigParser, progbar, printc, ParseInfo, MvaEvaluator

config = BetterConfigParser()
config.read(opts.config)
anaTag = config.get("Analysis","tag")

#get locations:
Wdir=config.get('Directories','Wdir')
samplesinfo=config.get('Directories','samplesinfo')

#read shape systematics
systematics=config.get('systematics','systematics')

#systematics
INpath = config.get('Directories','MVAin')
OUTpath = config.get('Directories','MVAout')

info = ParseInfo(samplesinfo,INpath)
开发者ID:cvernier,项目名称:Xbb,代码行数:31,代码来源:evaluateMVA.py


示例20: systematics

parser.add_option("-T", "--tag", dest="tag", default='',
                      help="configuration tag")
parser.add_option("-t","--trainingRegions", dest="trainingRegions", default='',
                      help="cut region identifier")
parser.add_option("-S","--systematics", dest="systematics", default=2,
                      help="include systematics (0 for none, 1 for bdtVars, 2 for all (with btagWeights)")
parser.add_option("-x", "--test", dest="test", action="store_true", help="for debugging only!!!", default=False)
(opts, args) = parser.parse_args(argv)
if opts.config =="":
        opts.config = ["config"]

# Import after configure to get help message
from myutils import BetterConfigParser, mvainfo, ParseInfo

if len(opts.tag.strip()) > 1:
    config = BetterConfigParser()
    config.read("{tag}config/paths.ini".format(tag=opts.tag))
    configFiles = config.get("Configuration", "List").split(' ')
    opts.config = ["{tag}config/{file}".format(tag=opts.tag, file=x.strip()) for x in configFiles]
    print("reading config files:", opts.config)

sys = False
btagSys = False
if int(opts.systematics) > 0:
    sys = True
    if int(opts.systematics) > 1:
        btagSys = True
# load config
config = BetterConfigParser()
config.read(opts.config)
converter = SampleTreesToNumpyConverter(config, opts.trainingRegions, useSyst=sys, useWeightSyst=btagSys, testRun=opts.test)
开发者ID:GLP90,项目名称:Xbb,代码行数:31,代码来源:write_numpy_array_for_training.py



注:本文中的myutils.BetterConfigParser类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python api.get_user函数代码示例发布时间:2022-05-27
下一篇:
Python mytime.MyTime类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap