Fix seeded random gen on clustering step (#1132)

This commit is contained in:
Alonso Guevara 2024-09-12 17:42:50 -06:00 committed by GitHub
parent 8c7f0dfc1b
commit cb4f2b43a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,4 @@
{
"type": "patch",
"description": "Fix seeded random gen on clustering"
}

View File

@ -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