Skip to content

Commit

Permalink
Update doc string and user warning if max_level is set too high, chan…
Browse files Browse the repository at this point in the history
…ge condition for renumbering
  • Loading branch information
naimnv committed Sep 28, 2023
1 parent e187e6b commit e782e51
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/cugraph/cugraph/community/louvain.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ def louvain(
max_level = 100

if max_level > 500:
warnings.warn("clamping down max_level to 500.")
w_msg = "max_level is set too high, clamping it down to 500."
warnings.warn(w_msg)
max_level = 500

vertex, partition, modularity_score = pylibcugraph_louvain(
Expand Down Expand Up @@ -179,7 +180,7 @@ def louvain(
[result, isolated_vtx_and_cids], ignore_index=True, sort=False
)

if G.renumbered and G.number_of_nodes() > len(isolated_vertices):
if G.renumbered and len(G.input_df) > 0:
result = G.unrenumber(result, VERTEX_COL_NAME)

if isNx is True:
Expand Down

0 comments on commit e782e51

Please sign in to comment.