Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cloud-infrastructure
data-analytics
Commits
7a7d473a
Commit
7a7d473a
authored
Apr 23, 2021
by
Antonin Dvorak
Browse files
OS-13691 sqlite
parent
e5a6e742
Changes
1
Hide whitespace changes
Inline
Side-by-side
adcern/cmd/data_mining.py
View file @
7a7d473a
...
...
@@ -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)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment