Fix seed init in clustering (#1156)

This commit is contained in:
Alonso Guevara 2024-09-18 17:22:52 -06:00 committed by GitHub
parent 594084f156
commit 10910797d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -0,0 +1,4 @@
{
"type": "patch",
"description": "Fix seed hardcoded init"
}

View File

@ -71,6 +71,9 @@ def cluster_graph(
num_total = len(output_df)
# Create a seed for this run (if not provided)
seed = strategy.get("seed", Random().randint(0, 0xFFFFFFFF)) # noqa S311
# Go through each of the rows
graph_level_pairs_column: list[list[tuple[int, str]]] = []
for _, row in progress_iterable(
@ -87,7 +90,7 @@ def cluster_graph(
cast(str, row[column]),
cast(Communities, row[community_map_to]),
level,
seed=strategy.get("seed"),
seed=seed,
)
)
)