Commit 7a7d473a authored by Antonin Dvorak's avatar Antonin Dvorak
Browse files

OS-13691 sqlite

parent e5a6e742
......@@ -638,24 +638,23 @@ def analysis(module_name, class_name, alias_name, hyperparameters,
with open(file_path_config_train) as json_file:
data_dict_train = json.load(json_file)
# connect to the db
conn = sqlite3.connect(folder_training_time + '/time.db', timeout = 120)
c = conn.cursor()
# ensure the table is there
c.execute('''CREATE TABLE IF NOT EXISTS time
(date_start text, date_end_excluded text,
long_algo_description text,
training_time real, measurement_time text,
PRIMARY KEY (date_start, date_end_excluded,
long_algo_description,
measurement_time))''')
conn.commit()
c.execute('''INSERT INTO time
conn = sqlite3.connect(folder_training_time + '/time.db', timeout=120)
modify_db(conn, '''CREATE TABLE IF NOT EXISTS time
(date_start text, date_end_excluded text,
long_algo_description text,
training_time real, measurement_time text,
PRIMARY KEY (date_start, date_end_excluded,
long_algo_description,
measurement_time))''')
modify_db(conn, '''INSERT INTO time
VALUES (?, ?, ?, ?, datetime('now', 'localtime'))''',
[data_dict_train["date_start"],
data_dict_train["date_end_excluded"],
algo_name,
training_time])
conn.commit()
[data_dict_train["date_start"],
data_dict_train["date_end_excluded"],
algo_name,
training_time])
conn.close()
# with open(file_path_config_train) as json_file:
# data_dict_train = json.load(json_file)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment