yqkcn
commited on
Commit
·
2570acc
1
Parent(s):
be56b52
remove repeat func (#2619)
Browse files### What problem does this PR solve?
- remove repeat func
### Type of change
- [x] Other (please describe): remove repeat func
- graphrag/leiden.py +0 -8
graphrag/leiden.py
CHANGED
@@ -134,14 +134,6 @@ def run(graph: nx.Graph, args: dict[str, Any]) -> dict[int, dict[str, dict]]:
|
|
134 |
return results_by_level
|
135 |
|
136 |
|
137 |
-
def add_community_info2graph(graph: nx.Graph, commu_info: dict[str, dict[str, dict]]):
|
138 |
-
for lev, cluster_info in commu_info.items():
|
139 |
-
for cid, nodes in cluster_info.items():
|
140 |
-
for n in nodes["nodes"]:
|
141 |
-
if "community" not in graph.nodes[n]: graph.nodes[n]["community"] = {}
|
142 |
-
graph.nodes[n]["community"].update({lev: cid})
|
143 |
-
|
144 |
-
|
145 |
def add_community_info2graph(graph: nx.Graph, nodes: List[str], community_title):
|
146 |
for n in nodes:
|
147 |
if "communities" not in graph.nodes[n]:
|
|
|
134 |
return results_by_level
|
135 |
|
136 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
def add_community_info2graph(graph: nx.Graph, nodes: List[str], community_title):
|
138 |
for n in nodes:
|
139 |
if "communities" not in graph.nodes[n]:
|