CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Functions | Variables
o2olib Namespace Reference

Classes

class  O2OJob
 
class  O2OJobConf
 
class  O2OJobMgr
 
class  O2ORun
 
class  O2ORunMgr
 
class  O2OTool
 

Functions

def checkConfiguration
 
def print_table
 
def readConfiguration
 

Variables

string __author__ = 'Giacomo Govi'
 
tuple _Base = sqlalchemy.ext.declarative.declarative_base()
 
string coral_tpl = 'oracle://%s/%s'
 
string dev_db_service = 'cms_orcoff_prep'
 
string logFolderEnvVar = 'O2O_LOG_FOLDER'
 
tuple logger = logging.getLogger(__name__)
 
string messageLevelEnvVar = 'O2O_LOG_LEVEL'
 
string private_db = 'sqlite:///o2o_jobs.db'
 
string prod_db_service = 'cms_orcon_prod'
 
string schema_name = 'CMS_CONDITIONS'
 
string sqlalchemy_tpl = 'oracle://%s:%s@%s'
 
int startStatus = -1
 

Function Documentation

def o2olib.checkConfiguration (   config_string)

Definition at line 420 of file o2olib.py.

Referenced by o2olib.O2OTool.create(), and o2olib.O2OTool.setConfig().

421 def checkConfiguration( config_string ):
422  config = config_string
423  try:
424  json.loads(config)
425  except ValueError as e:
426  config = ''
427  logging.error( 'The string "%s" is an invalid json format.', config_string )
428  return config
429 
def checkConfiguration
Definition: o2olib.py:420
def o2olib.print_table (   headers,
  table 
)

Definition at line 58 of file o2olib.py.

References print(), and gpuVertexFinder.printf().

Referenced by o2olib.O2OJobMgr.listJobs().

58 
59 def print_table( headers, table ):
60  ws = []
61  for h in headers:
62  ws.append(len(h))
63  for row in table:
64  ind = 0
65  for c in row:
66  if ind<len(ws):
67  if len(c)> ws[ind]:
68  ws[ind] = len(c)
69  ind += 1
70 
71  def printf( row ):
72  line = ''
73  ind = 0
74  for w in ws:
75  fmt = '{:<%s}' %w
76  if ind<len(ws):
77  line += (fmt.format( row[ind] )+' ')
78  ind += 1
79  print(line)
80  printf( headers )
81  hsep = ''
82  for w in ws:
83  fmt = '{:-<%s}' %w
84  hsep += (fmt.format('')+' ')
85  print(hsep)
86  for row in table:
87  printf( row )
88 
def print_table
Definition: o2olib.py:58
printf("params %d %f %f %f\n", minT, eps, errmax, chi2max)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def o2olib.readConfiguration (   config_filename)

Definition at line 404 of file o2olib.py.

References digitizers_cfi.strip.

Referenced by o2olib.O2OTool.create(), and o2olib.O2OTool.setConfig().

405 def readConfiguration( config_filename ):
406  config = ''
407  try:
408  with open( config_filename, 'r' ) as config_file:
409  config = config_file.read().strip('\n')
410  if config == '':
411  logging.error( 'The file %s contains an empty string.', config_filename )
412  else:
413  json.loads(config)
414  except IOError as e:
415  logging.error( 'The file %s cannot be open.', config_filename )
416  except ValueError as e:
417  config = ''
418  logging.error( 'The file "%s" contains an invalid json string.', config_filename )
419  return config
def readConfiguration
Definition: o2olib.py:404

Variable Documentation

string o2olib.__author__ = 'Giacomo Govi'

Definition at line 2 of file o2olib.py.

tuple o2olib._Base = sqlalchemy.ext.declarative.declarative_base()

Definition at line 27 of file o2olib.py.

string o2olib.coral_tpl = 'oracle://%s/%s'

Definition at line 20 of file o2olib.py.

string o2olib.dev_db_service = 'cms_orcoff_prep'

Definition at line 17 of file o2olib.py.

string o2olib.logFolderEnvVar = 'O2O_LOG_FOLDER'

Definition at line 24 of file o2olib.py.

tuple o2olib.logger = logging.getLogger(__name__)

Definition at line 25 of file o2olib.py.

string o2olib.messageLevelEnvVar = 'O2O_LOG_LEVEL'

Definition at line 23 of file o2olib.py.

string o2olib.private_db = 'sqlite:///o2o_jobs.db'

Definition at line 21 of file o2olib.py.

string o2olib.prod_db_service = 'cms_orcon_prod'

Definition at line 16 of file o2olib.py.

string o2olib.schema_name = 'CMS_CONDITIONS'

Definition at line 18 of file o2olib.py.

string o2olib.sqlalchemy_tpl = 'oracle://%s:%s@%s'

Definition at line 19 of file o2olib.py.

int o2olib.startStatus = -1

Definition at line 22 of file o2olib.py.