From 787f7165a6a1c61e1c2e22edf0387bb437005b03 Mon Sep 17 00:00:00 2001 From: yizhihenpidehou <806237230@qq.com> Date: Tue, 12 Dec 2023 10:20:30 +0800 Subject: [PATCH] chore: reformat --- .gitignore | 1 + easygraph/datasets/hospital_lyon.py | 5 ----- easygraph/functions/drawing/utils.py | 4 +++- .../functions/hypergraph/hypergraph_generator/uniform.py | 8 -------- 4 files changed, 4 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 5fa10811..55aa99d6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ __pycache__ test/ related-repos/ test.py +dynamic_hypergraph.pdf hypergraph_tutorial.py visulation_test.py hypergraph-bench/ diff --git a/easygraph/datasets/hospital_lyon.py b/easygraph/datasets/hospital_lyon.py index 8ec8c71d..d588810e 100644 --- a/easygraph/datasets/hospital_lyon.py +++ b/easygraph/datasets/hospital_lyon.py @@ -55,7 +55,6 @@ def preprocess(self, data, max_order=None, is_dynamic=True): cols = [] edge_flag_dict = {} edge_id = 0 - print("len data[edge-dict].items():", len(data["edge-dict"].items())) for id, edge in data["edge-dict"].items(): if max_order and len(edge) > max_order + 1: continue @@ -69,10 +68,6 @@ def preprocess(self, data, max_order=None, is_dynamic=True): try: edge = [name_dict[n] for n in edge] - # if tuple(edge) not in edge_flag_dict: - # print("edge:",edge) - # print("edge_id:",edge_id) - # edge_flag_dict[tuple(edge)] = 1 rows.extend(edge) cols.extend(len(edge) * [edge_id]) edge_id += 1 diff --git a/easygraph/functions/drawing/utils.py b/easygraph/functions/drawing/utils.py index 0aedffa2..bac2af22 100644 --- a/easygraph/functions/drawing/utils.py +++ b/easygraph/functions/drawing/utils.py @@ -153,6 +153,7 @@ def draw_vertex( font_family: str, v_size: list, v_color: list, + edgecolors, v_line_width: list, ): patches = [] @@ -178,7 +179,8 @@ def draw_vertex( va="top", ) patches.append(circle) - p = PatchCollection(patches, facecolors=v_color, edgecolors="black") + edgecolors = "black" if edgecolors == None else edgecolors + p = PatchCollection(patches, facecolors=v_color, edgecolors=edgecolors) ax.add_collection(p) diff --git a/easygraph/functions/hypergraph/hypergraph_generator/uniform.py b/easygraph/functions/hypergraph/hypergraph_generator/uniform.py index e8e34492..49f5371c 100644 --- a/easygraph/functions/hypergraph/hypergraph_generator/uniform.py +++ b/easygraph/functions/hypergraph/hypergraph_generator/uniform.py @@ -77,12 +77,9 @@ def uniform_hypergraph_Gnm(k: int, num_v: int, num_e: int, n_workers=None): with Pool(n_workers) as p: ret = p.imap(local_function, edges_parallel) - start_time = time.time() for res in ret: for r in res: res_edges.add(r) - # for key in res: - print("res:", len(res_edges)) while len(res_edges) < num_e: e = random.sample(range(num_v), k) @@ -90,11 +87,6 @@ def uniform_hypergraph_Gnm(k: int, num_v: int, num_e: int, n_workers=None): if e not in res_edges: res_edges.add(e) - # res_hypergraph.add_hyperedges(e_list=res) - end_time = time.time() - - print("nworker merge time:", end_time - start_time) - # print("res:",res_edges) res_hypergraph = eg.Hypergraph(num_v=num_v, e_list=list(res_edges)) return res_hypergraph