mirror of
https://github.com/microsoft/graphrag.git
synced 2026-01-14 09:07:20 +08:00
Fix seeded random gen on clustering step (#1132)
This commit is contained in:
parent
8c7f0dfc1b
commit
cb4f2b43a7
@ -0,0 +1,4 @@
|
||||
{
|
||||
"type": "patch",
|
||||
"description": "Fix seeded random gen on clustering"
|
||||
}
|
||||
@ -87,6 +87,7 @@ def cluster_graph(
|
||||
cast(str, row[column]),
|
||||
cast(Communities, row[community_map_to]),
|
||||
level,
|
||||
seed=strategy.get("seed"),
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -111,7 +112,7 @@ def cluster_graph(
|
||||
|
||||
# TODO: This should support str | nx.Graph as a graphml param
|
||||
def apply_clustering(
|
||||
graphml: str, communities: Communities, level=0, seed=0xF001
|
||||
graphml: str, communities: Communities, level: int = 0, seed: int | None = None
|
||||
) -> nx.Graph:
|
||||
"""Apply clustering to a graphml string."""
|
||||
random = Random(seed) # noqa S311
|
||||
|
||||
Loading…
Reference in New Issue
Block a user