CMS 3D CMS Logo

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

Classes

class  ReleaseComparison
 

Functions

def call_compare_using_files
 
def merge_dbs
 
def partial_db_name
 

Variables

string help = 'First CMSSW release for release comparison, e.g. CMSSW_5_3_2_pre7.'
 
tuple optional_group = OptionGroup(parser, 'Optional')
 
tuple parser
 Parse options. More...
 
tuple rel_cmp = ReleaseComparison(opts.dir, opts.db_name, opts.clear_db, opts.dry, opts.no_url, use_external=True)
 
tuple start = datetime.now()
 

Function Documentation

def ValidationMatrix_v2.call_compare_using_files (   args)

Definition at line 64 of file ValidationMatrix_v2.py.

References join().

64 
65 def call_compare_using_files(args):
66  file1, file2, work_path, db_name, clear_db = args
67  command = ['./compare_using_files_v2.py', join(work_path, file1), join(work_path, file2), '--db', db_name]
68  if clear_db:
69  command.append('--cl')
70  return call(command)
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def ValidationMatrix_v2.merge_dbs (   main_db,
  partial_db 
)

Definition at line 75 of file ValidationMatrix_v2.py.

Referenced by ValidationMatrix_v2.ReleaseComparison.compare().

75 
76 def merge_dbs(main_db, partial_db):
77  conn = sqlite3.connect(main_db)
78  c = conn.cursor()
79 
80  ## Test if database is empty
81  c.execute('''SELECT * FROM Directory limit 1;''')
82  directory_row = c.fetchall()
83 
84  ## Select offsets
85  rel_cmp_offset, file_cmp_offset, directory_offset, hist_cmp_offset = 0, 0, 0, 0
86  if directory_row:
87  c.execute('''SELECT count(*) FROM ReleaseComparison;''')
88  rel_cmp_offset = c.fetchone()[0]
89  c.execute('''SELECT count(*) FROM RootFileComparison;''')
90  file_cmp_offset = c.fetchone()[0]
91  c.execute('''SELECT max(id) FROM Directory;''')
92  directory_offset = c.fetchone()[0]
93  c.execute('''SELECT max(id) FROM HistogramComparison;''')
94  hist_cmp_offset = c.fetchone()[0]
95 
96  ## Merge DBs
97  c.executescript("""
98  ATTACH '{0}' AS partial;
99  BEGIN;
100 
101  INSERT INTO ReleaseComparison (title, release1, release2, statistical_test)
102  SELECT title, release1, release2, statistical_test FROM partial.ReleaseComparison;
103 
104  INSERT INTO RootFileComparison (filename1, filename2, release_comparison_id, directory_id)
105  SELECT filename1, filename2, release_comparison_id+{1}, directory_id+{3} FROM partial.RootFileComparison;
106 
107  INSERT INTO Directory (id, name, parent_id, from_histogram_id, till_histogram_id)
108  SELECT id+{3}, name, parent_id+{3}, from_histogram_id+{4}, till_histogram_id+{4} FROM partial.Directory;
109 
110  INSERT INTO HistogramComparison (name, p_value, directory_id)
111  SELECT name, p_value, directory_id+{3} FROM partial.HistogramComparison;
112 
113  COMMIT;""".format(partial_db, rel_cmp_offset, file_cmp_offset, directory_offset, hist_cmp_offset))
114 
115  ## Select Last RootFileComparison ID
116  c.execute('''SELECT max(id) FROM RootFileComparison;''')
117  max_file_cmp_id = c.fetchone()[0]
118  conn.close()
119  return max_file_cmp_id
120 
def ValidationMatrix_v2.partial_db_name (   db_name,
  i 
)
Generates temporary database name.

Definition at line 71 of file ValidationMatrix_v2.py.

Referenced by ValidationMatrix_v2.ReleaseComparison.compare().

71 
72 def partial_db_name(db_name, i):
73  """Generates temporary database name."""
74  return '%s___%d.db' % (db_name.strip('.db'), i + 1)

Variable Documentation

string ValidationMatrix_v2.help = 'First CMSSW release for release comparison, e.g. CMSSW_5_3_2_pre7.'

Definition at line 29 of file ValidationMatrix_v2.py.

tuple ValidationMatrix_v2.optional_group = OptionGroup(parser, 'Optional')

Definition at line 40 of file ValidationMatrix_v2.py.

tuple ValidationMatrix_v2.parser
Initial value:
1 = OptionParser(usage='Usage: %prog --re1 RELEASE1 [--f1 FR,FR,..] ' +
2  '--re2 RELEASE2 [--f2 FR,FR,..] [--st ST_TESTS] [options]')

Parse options.

Definition at line 26 of file ValidationMatrix_v2.py.

tuple ValidationMatrix_v2.rel_cmp = ReleaseComparison(opts.dir, opts.db_name, opts.clear_db, opts.dry, opts.no_url, use_external=True)

Definition at line 267 of file ValidationMatrix_v2.py.

tuple ValidationMatrix_v2.start = datetime.now()

Definition at line 262 of file ValidationMatrix_v2.py.