From 85409f26c827aa4f18085cfa5dc313a071c77876 Mon Sep 17 00:00:00 2001
From: Lionel GUEZ <guez@lmd.ens.fr>
Date: Fri, 22 Apr 2022 12:59:11 +0200
Subject: [PATCH] Read path on the command line of `report_graph.py`

---
 Overlap/Tests/short_tests.json | 22 ++++++----------------
 Overlap/report_graph.py        |  7 ++-----
 2 files changed, 8 insertions(+), 21 deletions(-)

diff --git a/Overlap/Tests/short_tests.json b/Overlap/Tests/short_tests.json
index e5bb203e..89b4a0bf 100644
--- a/Overlap/Tests/short_tests.json
+++ b/Overlap/Tests/short_tests.json
@@ -470,24 +470,16 @@
 	"title": "Report_graph_cyclo",
 	"command":
 	[
-	    "$src_dir/Overlap/report_graph.py", "--gv", "--merging"
-	],
-	"symlink":
-	[
-	    "$PWD/EGr2nd15md4np3_cyclo/edgelist.csv",
-	    "$PWD/EGr2nd15md4np3_cyclo/node_id_param.json"
+	    "$src_dir/Overlap/report_graph.py", "--gv", "--merging",
+	    "$PWD/EGr2nd15md4np3_cyclo/edgelist.csv"
 	]
     },
     {
 	"title": "Report_graph_anti",
 	"command":
 	[
-	    "$src_dir/Overlap/report_graph.py", "--gv", "--merging"
-	],
-	"symlink":
-	[
-	    "$PWD/EGr2nd15md4np3/edgelist.csv",
-	    "$PWD/EGr2nd15md4np3/node_id_param.json"
+	    "$src_dir/Overlap/report_graph.py", "--gv", "--merging",
+	    "$PWD/EGr2nd15md4np3/edgelist.csv"
 	]
     },
     {
@@ -507,11 +499,9 @@
     {
 	"title": "Report_graph_int",
 	"command":
-	["$src_dir/Overlap/report_graph.py", "--gv", "--merging"],
-	"symlink":
 	[
-	    "$tests_old_dir/Graph_from_Matlab_v6_anti/edgelist.csv",
-	    "$tests_old_dir/Graph_from_Matlab_v6_anti/node_id_param.json"
+	    "$src_dir/Overlap/report_graph.py", "--gv", "--merging",
+	    "$tests_old_dir/Graph_from_Matlab_v6_anti/edgelist.csv"
 	]
     },
     {
diff --git a/Overlap/report_graph.py b/Overlap/report_graph.py
index fc31013f..2e19b6af 100755
--- a/Overlap/report_graph.py
+++ b/Overlap/report_graph.py
@@ -1,9 +1,5 @@
 #!/usr/bin/env python3
 
-"""edgelist.csv must be in the current directory.
-
-"""
-
 import networkx as nx
 import shapefile
 from os import path
@@ -101,6 +97,7 @@ if __name__ == "__main__":
     import argparse
 
     parser = argparse.ArgumentParser()
+    parser.add_argument("edgelist_file")
     parser.add_argument("--gv", help = "Create Graphviz file",
                         action = "store_true")
     parser.add_argument("-n", "--node",
@@ -111,7 +108,7 @@ if __name__ == "__main__":
                         action = "store_true")
     args = parser.parse_args()
     
-    G = read_eddy_graph("edgelist.csv")
+    G = read_eddy_graph(args.edgelist_file)
 
     if args.node is None:
         H = G
-- 
GitLab