Commit 734f7c51 authored by Agata Malgorzata Chadaj's avatar Agata Malgorzata Chadaj
Browse files

wip

parent f91bcf62
Pipeline #3176065 canceled with stage
......@@ -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)
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