Functions | |
def | count_dups (l) |
def | findInList (mylist, element) |
def | flatten (obj) |
def | guessUnit (inverseubval) |
def | inclusiveRange (start, stop, step) |
def | is_floatstr (s) |
def | is_intstr (s) |
def | lumiUnitForPrint (t) |
def | pack (high, low) |
def | packArraytoBlob (iarray) |
def | packListstrtoCLOB (iListstr, separator=') |
def | packToString (high, low) |
def | pairwise (lst) |
def | parselumicorrector (correctorStr) |
def | parseTime (iTime) |
def | splitlistToRangeString (inPut) |
def | timeStamptoDate (i) |
def | timeStamptoUTC (i) |
def | tolegalJSON (inputstring) |
def | transposed (lists, defaultval=None) |
def | unpack (i) |
def | unpackBlobtoArray (iblob, itemtypecode) |
def | unpackCLOBtoListstr (iStr, separator=') |
def | unpackFromString (i) |
def | unpackLumiid (i) |
Variables | |
a | |
b | |
lst | |
myblob | |
nested | |
pp | |
result | |
seqbag | |
This module collects some frequently used helper functions
def CommonUtil.count_dups | ( | l | ) |
report the number of duplicates in a python list
Definition at line 138 of file CommonUtil.py.
Referenced by lumiQueryAPI.allruns().
def CommonUtil.findInList | ( | mylist, | |
element | |||
) |
def CommonUtil.flatten | ( | obj | ) |
Given nested lists or tuples, returns a single flattened list
Definition at line 5 of file CommonUtil.py.
Referenced by python.rootplot.root2matplotlib.Hist2D.box(), python.rootplot.core.divide_axes(), and lumiReport.toCSVLumiByLSXing().
def CommonUtil.guessUnit | ( | inverseubval | ) |
input: float value in 1/ub output: printable value (value(float),unit(str)) unit in [1/kb,1/b,1/mb,1/ub,1/nb,1/pb,1/fb]
Definition at line 60 of file CommonUtil.py.
References objects.autophobj.float.
Referenced by lumiReport.toScreenLumiByLS(), lumiReport.toScreenOverview(), lumiReport.toScreenTotDelivered(), and lumiReport.toScreenTotEffective().
def CommonUtil.inclusiveRange | ( | start, | |
stop, | |||
step | |||
) |
def CommonUtil.is_floatstr | ( | s | ) |
test if a string can be converted to a float
Definition at line 129 of file CommonUtil.py.
References objects.autophobj.float.
Referenced by inputFilesetParser.inputFilesetParser.fieldtotal(), and inputFilesetParser.inputFilesetParser.fieldvalues().
def CommonUtil.is_intstr | ( | s | ) |
test if a string can be converted to a int
Definition at line 121 of file CommonUtil.py.
References createfilelist.int.
Referenced by inputFilesetParser.inputFilesetParser.fieldtotal(), inputFilesetParser.inputFilesetParser.fieldvalues(), and inputFilesetParser.inputFilesetParser.runsWithresult().
def CommonUtil.lumiUnitForPrint | ( | t | ) |
input : largest lumivalue output: (unitstring,denomitor)
Definition at line 31 of file CommonUtil.py.
Referenced by lumiReport.toScreenLSEffective(), and lumiReport.toScreenLumiByLS().
def CommonUtil.pack | ( | high, | |
low | |||
) |
pack high,low 32bit unsigned int to one unsigned 64bit long long Note:the print value of result number may appear signed, if the sign bit is used.
Definition at line 155 of file CommonUtil.py.
Referenced by packToString().
def CommonUtil.packArraytoBlob | ( | iarray | ) |
Inputs: inputarray: a python array
Definition at line 221 of file CommonUtil.py.
Referenced by generateDummyData.hlt(), queryDataSource.hltFromOldLumi(), queryDataSource.hltFromRuninfoV2(), generateDummyData.lumiSummary(), generateDummyData.trg(), and queryDataSource.trgFromOldLumi().
def CommonUtil.packListstrtoCLOB | ( | iListstr, | |
separator = ' |
|||
) |
pack list of string of comma separated large string CLOB
Definition at line 245 of file CommonUtil.py.
def CommonUtil.packToString | ( | high, | |
low | |||
) |
pack high,low 32bit unsigned int to one unsigned 64bit long long in string format Note:the print value of result number may appear signed, if the sign bit is used.
Definition at line 161 of file CommonUtil.py.
References pack().
def CommonUtil.pairwise | ( | lst | ) |
yield item i and item i+1 in lst. e.g. (lst[0], lst[1]), (lst[1], lst[2]), ..., (lst[-1], None) from http://code.activestate.com/recipes/409825-look-ahead-one-item-during-iteration
Definition at line 99 of file CommonUtil.py.
def CommonUtil.parselumicorrector | ( | correctorStr | ) |
output: (functionname,parametersinuppercase[])
Definition at line 272 of file CommonUtil.py.
Referenced by normDML.normValueById().
def CommonUtil.parseTime | ( | iTime | ) |
input string of the ("^\d\d/\d\d/\d\d \d\d:\d\d:\d\d$|^\d{6}$|^\d{4}$" format output (runnum,fillnum,timeStr)
Definition at line 15 of file CommonUtil.py.
References createfilelist.int.
def CommonUtil.splitlistToRangeString | ( | inPut | ) |
Definition at line 257 of file CommonUtil.py.
Referenced by lumiReport.toScreenOverview(), and lumiReport.toScreenTotEffective().
def CommonUtil.timeStamptoDate | ( | i | ) |
convert 64bit timestamp to local date in string format
Definition at line 177 of file CommonUtil.py.
References unpack().
def CommonUtil.timeStamptoUTC | ( | i | ) |
convert 64bit timestamp to Universal Time in string format
Definition at line 181 of file CommonUtil.py.
References unpack().
def CommonUtil.tolegalJSON | ( | inputstring | ) |
convert json like string to legal json string add double quote around json keys if they are not there, change single quote to double quote around keys
Definition at line 201 of file CommonUtil.py.
References edm.print(), and str.
transposing list of lists from http://code.activestate.com/recipes/410687-transposing-a-list-of-lists-with-different-lengths/
Definition at line 147 of file CommonUtil.py.
References genParticles_cff.map.
Referenced by TkRotation2D< Scalar >.rotate(), specificLumi.specificlumiTofile(), and lumiReport.toCSVLumiByLSXing().
def CommonUtil.unpack | ( | i | ) |
unpack 64bit unsigned long long into 2 32bit unsigned int, return tuple (high,low)
Definition at line 167 of file CommonUtil.py.
References mathSSE.return().
Referenced by timeStamptoDate(), timeStamptoUTC(), unpackFromString(), and unpackLumiid().
def CommonUtil.unpackBlobtoArray | ( | iblob, | |
itemtypecode | |||
) |
Inputs: iblob: coral.Blob itemtypecode: python array type code
Definition at line 230 of file CommonUtil.py.
Referenced by dataDML.beamInfoById(), lumiQueryAPI.beamIntensityForRun(), dataDML.hltLSById(), dataDML.lumiLSById(), and dataDML.trgLSById().
def CommonUtil.unpackCLOBtoListstr | ( | iStr, | |
separator = ' |
|||
) |
unpack a large string to list of string
Definition at line 251 of file CommonUtil.py.
References split.
def CommonUtil.unpackFromString | ( | i | ) |
unpack 64bit unsigned long long in string format into 2 32bit unsigned int, return tuple(high,low)
Definition at line 173 of file CommonUtil.py.
References createfilelist.int, and unpack().
def CommonUtil.unpackLumiid | ( | i | ) |
unpack 64bit lumiid to dictionary {'run','lumisection'}
Definition at line 186 of file CommonUtil.py.
References unpack().
CommonUtil.a |
Definition at line 284 of file CommonUtil.py.
CommonUtil.b |
Definition at line 316 of file CommonUtil.py.
CommonUtil.lst |
Definition at line 288 of file CommonUtil.py.
CommonUtil.myblob |
Definition at line 313 of file CommonUtil.py.
CommonUtil.nested |
Definition at line 282 of file CommonUtil.py.
Referenced by edm.contextual_find().
CommonUtil.pp |
Definition at line 297 of file CommonUtil.py.
CommonUtil.result |
Definition at line 295 of file CommonUtil.py.
CommonUtil.seqbag |
Definition at line 290 of file CommonUtil.py.