Functions | |
def | allNorms |
Norm/Correction/version DML API # # Author: Zhen Xie #. More... | |
def | createNorm |
def | demoteNormFromTypeDefault |
def | exportNormValue |
copy/export/import More... | |
def | insertValueToNormId |
def | normIdByName |
def | normIdByType |
def | normInfoByName |
def | normValueById |
def | promoteNormToTypeDefault |
def normDML.allNorms | ( | schema | ) |
Norm/Correction/version DML API # # Author: Zhen Xie #.
list all lumi norms select DATA_ID,ENTRY_NAME,LUMITYPE,ISTYPEDEFAULT,COMMENT,CTIME FROM LUMINORMSV2 output: {normname:[data_id,lumitype,istypedefault,comment,creationtime]}
Definition at line 13 of file normDML.py.
References data, and nameDealer.luminormv2TableName().
def normDML.createNorm | ( | schema, | |
normname, | |||
lumitype, | |||
istypedefault, | |||
branchinfo, | |||
comment = '' |
|||
) |
branchinfo(normrevisionid,branchname)
Definition at line 223 of file normDML.py.
References revisionDML.addEntry(), revisionDML.addRevision(), revisionDML.bookNewEntry(), revisionDML.bookNewRevision(), revisionDML.entryInBranch(), and nameDealer.luminormv2TableName().
def normDML.demoteNormFromTypeDefault | ( | schema, | |
normname, | |||
lumitype | |||
) |
demote norm from typedefault to non default
Definition at line 244 of file normDML.py.
References nameDealer.luminormv2TableName(), and normIdByName().
def normDML.exportNormValue | ( | schema, | |
sourcenormname, | |||
destnormname, | |||
firstsince = None , |
|||
lastsince = None |
|||
) |
copy/export/import
copy specified piece of source norm to dest input: time boundary [firstsince, lastsince] if None: open
Definition at line 339 of file normDML.py.
References insertValueToNormId(), normIdByName(), and normValueById().
def normDML.insertValueToNormId | ( | schema, | |
normdataid, | |||
sincerun, | |||
corrector, | |||
amodetag, | |||
egev, | |||
parameters, | |||
comment = '' |
|||
) |
insert into LUMINORMSV2DATA(DATA_ID,SINCERUN,CORRECTOR,...) values(normdataid,)sincerun,corrector,...); require len(parameters)>=1. input: parameterDict {'NORM_OCC1':normocc1,'NORM_OCC2':normocc2,'NORM_ET':normet,'NORM_PU':normpu,'DRIFT':drift,'A1':a1,...} output:
Definition at line 298 of file normDML.py.
References nameDealer.luminormv2dataTableName().
Referenced by exportNormValue().
def normDML.normIdByName | ( | schema, | |
normname | |||
) |
select max(DATA_ID) FROM LUMINORMSV2 WHERE ENTRY_NAME=:normname
Definition at line 60 of file normDML.py.
References data, nameDealer.luminormv2TableName(), and bookConverter.max.
Referenced by demoteNormFromTypeDefault(), exportNormValue(), and promoteNormToTypeDefault().
select max(DATA_ID) FROM LUMINORMSV2 WHERE LUMITYPE=:lumitype output: luminormidmap {normname:normid}
Definition at line 92 of file normDML.py.
References data, and nameDealer.luminormv2TableName().
Referenced by promoteNormToTypeDefault().
def normDML.normInfoByName | ( | schema, | |
normname | |||
) |
select DATA_ID,LUMITYPE,ISTYPEDEFAULT,COMMENT,TO_CHAR(CTIME,\'MM/DD/YY HH24:MI\') FROM LUMINORMS WHERE ENTRY_NAME=:normname output: [data_id[0],lumitype[1],istypedefault[2],comment[3],creationtime[4]]
Definition at line 133 of file normDML.py.
References data, nameDealer.luminormv2TableName(), and bookConverter.max.
def normDML.normValueById | ( | schema, | |
normid | |||
) |
select * from luminormsv2data where data_id=normid output: {since:[corrector(0),{paramname:paramvalue}(1),amodetag(2),egev(3),comment(4)]}
Definition at line 181 of file normDML.py.
References data, nameDealer.luminormv2dataTableName(), and CommonUtil.parselumicorrector().
Referenced by exportNormValue().
def normDML.promoteNormToTypeDefault | ( | schema, | |
normname, | |||
lumitype | |||
) |
set the named norm as default for a given type,reset the old default if any thisnormid=normIdByName(schema,normname) olddefaultid=normIdByType(schema,lumitype=lumitype,defaultonly=True) if thisnormid: update LUMINORMSV2 set ISTYPEDEFAULT=1 where DATA_ID=:thisnormid else: raise ValueError('normname does not exist, nothing to update') if olddefaultid and olddefaultid!=thisnormid: update LUMINORMSV2 set ISTYPEDEFAULT=0 where DATA_ID=:olddefaultid
Definition at line 264 of file normDML.py.
References normIdByName(), and normIdByType().