New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add max_level=
argument to louvain_communities
to limit macro-iterations
#6909
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a nice addition to me. @z3y50n any thoughts on this one?
Updated docstring and responded to feedback. Ready for final review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, thanks @eriknw
Technically, the introduction of the new kwarg before the end of the signature could bite users relying on kwarg position to call the function, but I don't think that's very likely.
The safest thing to do would be to add max_level
as kwarg-only, but I don't feel too strongly about it!
…4177) We already supported `max_level=`, and this was just upstreamed to networkx here: networkx/networkx#6909 Authors: - Erik Welch (https://github.com/eriknw) Approvers: - Rick Ratzel (https://github.com/rlratzel) URL: #4177
…rations (networkx#6909) * Add `max_level=` argument to `louvain_communities` to limit macro-iterations * ...or None * Add docstring and update variable names
Louvain in cugraph allows
max_level
to be specified, which sets the upper limit of "macro iterations" of the Louvain algorithms (and other algorithms such as Leiden), so I thought it would be nice to upstream back to networkx.Also, I changed the variable name of the iterator from
d
toit
.d
sounds like a dict to me.TODO:
CC @rlratzel