test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 63 of file ValidationMatrix_v2.py.

References join().

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

Definition at line 74 of file ValidationMatrix_v2.py.

Referenced by ValidationMatrix_v2.ReleaseComparison.compare().

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

Definition at line 70 of file ValidationMatrix_v2.py.

Referenced by ValidationMatrix_v2.ReleaseComparison.compare().

70 
71 def partial_db_name(db_name, i):
72  """Generates temporary database name."""
73  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 28 of file ValidationMatrix_v2.py.

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

Definition at line 39 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 25 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 266 of file ValidationMatrix_v2.py.

tuple ValidationMatrix_v2.start = datetime.now()

Definition at line 261 of file ValidationMatrix_v2.py.