CMS 3D CMS Logo

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

Classes

class  conddb_tool
 
class  version_db
 

Functions

def main
 
def print_table
 

Variables

tuple adg_db_service = ('cms_orcon_adg',{'r':'cms_orcon_adg/cms_cond_general_r'})
 
tuple dev_db_service = ('cms_orcoff_prep',{'w':'cms_orcoff_prep/cms_cond_general_w','r':'cms_orcoff_prep/cms_cond_general_r'})
 
string fmt_str = "[%(asctime)s] %(levelname)s: %(message)s"
 
tuple logFormatter = logging.Formatter(fmt_str)
 
 logLevel = logging.INFO
 
tuple prod_db_service = ('cms_orcon_prod',{'w':'cms_orcon_prod/cms_cond_general_w','r':'cms_orcon_prod/cms_cond_general_r'})
 
string schema_name = 'CMS_CONDITIONS'
 

Function Documentation

def conddb_version_mgr.main ( )

Definition at line 443 of file conddb_version_mgr.py.

444 def main():
445  tool = conddb_tool()
446  parser = argparse.ArgumentParser(description='CMS conddb command-line tool for serialiation metadata. For general help (manual page), use the help subcommand.')
447  parser.add_argument('--db', type=str, help='The target database: pro ( for prod ) or dev ( for prep ). default=pro')
448  parser.add_argument("--auth","-a", type=str, help="The path of the authentication file")
449  parser.add_argument('--verbose', '-v', action='count', help='The verbosity level')
450  parser_subparsers = parser.add_subparsers(title='Available subcommands')
451  parser_update_tags = parser_subparsers.add_parser('update_tags', description='Update the existing tag headers with the boost version')
452  parser_update_tags.add_argument('--name', '-n', type=str, help='Name of the specific tag to process (default=None - in this case all of the tags will be processed.')
453  parser_update_tags.add_argument('--max', '-m', type=int, help='the maximum number of tags processed',default=100)
454  parser_update_tags.add_argument('--all',action='store_true', help='process all of the tags with boost_version = None')
455  parser_update_tags.add_argument('--validate',action='store_true', help='validate the tag/boost version under processing')
456  parser_update_tags.set_defaults(func=tool.update_tags,accessType='w')
457  parser_insert_boost_version = parser_subparsers.add_parser('insert', description='Insert a new boost version range in the run map')
458  parser_insert_boost_version.add_argument('--label', '-l',type=str, help='The boost version label',required=True)
459  parser_insert_boost_version.add_argument('--since', '-s',type=int, help='The since validity (run number)',required=True)
460  parser_insert_boost_version.add_argument('--min_ts', '-t',type=str, help='The since validity (Time timetype)', required=False)
461  parser_insert_boost_version.set_defaults(func=tool.insert_boost_run,accessType='w')
462  parser_list_boost_versions = parser_subparsers.add_parser('list', description='list the boost versions in the run map')
463  parser_list_boost_versions.set_defaults(func=tool.list_boost_run,accessType='r')
464  parser_show_version = parser_subparsers.add_parser('show_tag', description='Display the minimum boost version for the specified tag (the value stored, by default)')
465  parser_show_version.add_argument('tag_name',help='The name of the tag')
466  parser_show_version.add_argument('--rebuild','-r',action='store_true',default=False,help='Re-calculate the minimum boost versio ')
467  parser_show_version.add_argument('--full',action='store_true',default=False,help='Recalulate the minimum boost version, listing the versions in the iov sequence')
468  parser_show_version.set_defaults(func=tool.show_tag_boost_version,accessType='r')
469  args = parser.parse_args()
470  tool.args = args
471  if args.verbose is not None and args.verbose >=1:
472  tool.logger.setLevel(logging.DEBUG)
473  tool.connect()
474  return args.func()
475  else:
476  try:
477  tool.connect()
478  sys.exit( args.func())
479  except Exception as e:
480  logging.error(e)
481  sys.exit(1)
def conddb_version_mgr.print_table (   headers,
  table 
)

Definition at line 23 of file conddb_version_mgr.py.

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

Referenced by conddb_version_mgr.conddb_tool.list_boost_run(), and conddb_version_mgr.conddb_tool.show_tag_boost_version().

23 
24 def print_table( headers, table ):
25  ws = []
26  for h in headers:
27  ws.append(len(h))
28  for row in table:
29  ind = 0
30  for c in row:
31  c = str(c)
32  if ind<len(ws):
33  if len(c)> ws[ind]:
34  ws[ind] = len(c)
35  ind += 1
36 
37  def printf( row ):
38  line = ''
39  ind = 0
40  for w in ws:
41  fmt = '{:<%s}' %w
42  if ind<len(ws):
43  line += (fmt.format( row[ind] )+' ')
44  ind += 1
45  print(line)
46  printf( headers )
47  hsep = ''
48  for w in ws:
49  fmt = '{:-<%s}' %w
50  hsep += (fmt.format('')+' ')
51  print(hsep)
52  for row in table:
53  printf( row )
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
#define str(s)

Variable Documentation

tuple conddb_version_mgr.adg_db_service = ('cms_orcon_adg',{'r':'cms_orcon_adg/cms_cond_general_r'})

Definition at line 15 of file conddb_version_mgr.py.

tuple conddb_version_mgr.dev_db_service = ('cms_orcoff_prep',{'w':'cms_orcoff_prep/cms_cond_general_w','r':'cms_orcoff_prep/cms_cond_general_r'})

Definition at line 16 of file conddb_version_mgr.py.

string conddb_version_mgr.fmt_str = "[%(asctime)s] %(levelname)s: %(message)s"

Definition at line 19 of file conddb_version_mgr.py.

tuple conddb_version_mgr.logFormatter = logging.Formatter(fmt_str)

Definition at line 21 of file conddb_version_mgr.py.

conddb_version_mgr.logLevel = logging.INFO

Definition at line 20 of file conddb_version_mgr.py.

tuple conddb_version_mgr.prod_db_service = ('cms_orcon_prod',{'w':'cms_orcon_prod/cms_cond_general_w','r':'cms_orcon_prod/cms_cond_general_r'})

Definition at line 14 of file conddb_version_mgr.py.

string conddb_version_mgr.schema_name = 'CMS_CONDITIONS'

Definition at line 17 of file conddb_version_mgr.py.