From e782e5131197804e83748596a5c2b6952109203e Mon Sep 17 00:00:00 2001 From: Md Naim Date: Wed, 27 Sep 2023 17:27:40 -0700 Subject: [PATCH] Update doc string and user warning if max_level is set too high, change condition for renumbering --- python/cugraph/cugraph/community/louvain.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/cugraph/cugraph/community/louvain.py b/python/cugraph/cugraph/community/louvain.py index 93b9cbaa1fd..de78234746d 100644 --- a/python/cugraph/cugraph/community/louvain.py +++ b/python/cugraph/cugraph/community/louvain.py @@ -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( @@ -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: