From 6d82eff80e509262a511b7bd9c56d0401ec8a6ca Mon Sep 17 00:00:00 2001 From: RobbinBouwmeester Date: Sun, 9 Jul 2023 13:42:52 +0200 Subject: [PATCH 1/3] Fix json Fix json so it is valid (spreads over multiple lines with records). --- proteobench/github/gh.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/proteobench/github/gh.py b/proteobench/github/gh.py index 35974384..9b5c01e7 100644 --- a/proteobench/github/gh.py +++ b/proteobench/github/gh.py @@ -42,7 +42,11 @@ def clone_pr( # do the pd.write_json() here!!! print(os.path.join(t_dir, "results.json")) f = open(os.path.join(t_dir, "results.json"), "w") - all_datapoints.T.to_json(f) + all_datapoints.to_json( + f, + lines=True, + orient="records" + ) f.close() commit_message = "Added new run with id " + branch_name From e69bf0ccbe54b6b18f16fe7565f7327b7f999f1b Mon Sep 17 00:00:00 2001 From: RobbinBouwmeester Date: Sun, 9 Jul 2023 13:58:51 +0200 Subject: [PATCH 2/3] Write valid json --- proteobench/github/gh.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/proteobench/github/gh.py b/proteobench/github/gh.py index 9b5c01e7..f7182b6f 100644 --- a/proteobench/github/gh.py +++ b/proteobench/github/gh.py @@ -42,11 +42,13 @@ def clone_pr( # do the pd.write_json() here!!! print(os.path.join(t_dir, "results.json")) f = open(os.path.join(t_dir, "results.json"), "w") + all_datapoints.to_json( f, - lines=True, - orient="records" + orient="records", + indent=2 ) + f.close() commit_message = "Added new run with id " + branch_name From 742b1a05a4a1397bc0b3296f87b15387cd0d3d40 Mon Sep 17 00:00:00 2001 From: RobbinBouwmeester Date: Wed, 6 Sep 2023 15:52:09 +0200 Subject: [PATCH 3/3] Add changes to local dev --- proteobench/github/gh.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/proteobench/github/gh.py b/proteobench/github/gh.py index f7182b6f..e79bc43f 100644 --- a/proteobench/github/gh.py +++ b/proteobench/github/gh.py @@ -20,7 +20,12 @@ def write_json_local_development( print(f"Writing the json to: {fname}") f = open(os.path.join(t_dir, "results.json"), "w") - all_datapoints.T.to_json(f) + + all_datapoints.to_json( + f, + orient="records", + indent=2 + ) return os.path.join(t_dir, "results.json")