From 9c2fee6e1c69f47a1130d88fcdf470d849b92cc8 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Fri, 14 Apr 2023 12:33:29 +0200 Subject: [PATCH] Improve extract_data --- scripts/qp_extract_cipsi_data.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/qp_extract_cipsi_data.py b/scripts/qp_extract_cipsi_data.py index dd8e9c4d..70935d73 100755 --- a/scripts/qp_extract_cipsi_data.py +++ b/scripts/qp_extract_cipsi_data.py @@ -43,8 +43,8 @@ def extract_data(output): e_ex_line = lines[iline+2] e_ex = float(e_ex_line.split()[1]) reading = False - - data.append((n_det, e, pt2, err_pt2, rpt2, err_rpt2, e_ex)) + new_data = " {:8d} {:16.8f} {:e} {:e} {:e} {:e} {:16.8f}".format(n_det, e, pt2, err_pt2, rpt2, err_rpt2, e_ex) + data.append(new_data) n_det = e = pt2 = err_pt2 = rpt2 = err_rpt2 = e_ex = None return data @@ -52,6 +52,4 @@ def extract_data(output): data = extract_data(output) for item in data: - print(" ".join(str(x) for x in item)) - - + print(item)