Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LHCData
lhc-sm-hwc
Commits
734f7c51
Commit
734f7c51
authored
Oct 28, 2021
by
Agata Chadaj
Browse files
wip
parent
f91bcf62
Pipeline
#3176065
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CI/send_results.py
View file @
734f7c51
...
...
@@ -31,19 +31,23 @@ def get_result():
return
result_flag
,
summary
def
save_json_to_file
(
args
,
flag
,
comment
):
file_path
=
'/eos/home-m/mpesoft/'
+
':'
.
join
([
args
.
notebook
,
args
.
circuit_name
,
args
.
discharge_level
,
str
(
Time
.
to_unix_timestamp
(
args
.
start_time
)),
str
(
Time
.
to_unix_timestamp
(
args
.
end_time
)),
flag
])
+
'.csv'
df
=
pd
.
DataFrame
(
eval
(
comment
))
def
save_data_to_file
(
data
:
dict
):
file_path
=
'/eos/home-m/mpesoft/test.csv'
df
=
pd
.
DataFrame
.
from_dict
(
data
)
with
open
(
file_path
,
'a'
)
as
f
:
df
.
to_csv
(
f
,
mode
=
'a'
,
header
=
f
.
tell
()
==
0
)
if
__name__
==
'__main__'
:
args
=
_get_arg_parser
().
parse_args
()
print
(
'args: '
)
print
(
args
)
flag
,
text
=
get_result
()
save_json_to_file
(
args
,
flag
,
text
)
all_data
=
{
'notebook'
:
args
.
notebook
,
'circuit_name'
:
args
.
circuit_name
,
'discharge_level'
:
int
(
args
.
discharge_level
),
'start_time'
:
Time
.
to_unix_timestamp
(
args
.
start_time
),
'end_time'
:
Time
.
to_unix_timestamp
(
args
.
end_time
)
'status'
:
flag
,
'comment'
:
text
}
save_data_to_file
(
all_data
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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