-
Notifications
You must be signed in to change notification settings - Fork 16
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
Adds support for jaccard_coefficient
#62
Merged
rapids-bot
merged 12 commits into
rapidsai:branch-25.02
from
rlratzel:branch-25.02-jaccard
Jan 30, 2025
+168
−3
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9513ed1
Initial commit, still running tests.
rlratzel 69a63ba
Removed docstring to avoid having it as an admonition in generated docs.
rlratzel 8958183
NX tests passing.
rlratzel 9c7d048
Updates comment.
rlratzel 9ceb0af
Updates comment.
rlratzel 6eadc55
Adds initial benchmark for Jaccard.
rlratzel 6e4b2bc
Updates and adds comments.
rlratzel f17e162
Updates code for computing pairs when ebunch is None and check for va…
rlratzel 893b6bc
Removes passing arg with default value.
rlratzel 34fe191
Merge remote-tracking branch 'upstream/branch-25.02' into branch-25.0…
rlratzel 8040fd0
Updates ebunch node check, adds test for valid ebunch.
rlratzel 0459f34
Updates valid node check based on review comments.
rlratzel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Heh, right, values like 4.5 are also invalid.
There are many types of integers floating around so
isinstance(n, int)
may be inadequate, andisinstance(n, numbers.Integral)
is slow, so here's an alternativewhere we import
index
fromoperators
.This is a little more strict than NetworkX
so another alternative could be
Also, what do you think of making this verification opt-in by adding a keyword argument to the method? I'm conflicted, b/c I like performance. We have sometimes played a little fast and loose in the name of performance, and we may not catch every invalid node that NetworkX would catch. This has been somewhat intentional: functions in networkx don't have consistent behavior, so I would want to have e.g. randomized tests like Ross talked about to stress both networkx and networkx backends for exceptional behavior. OTOH, it's probably safest to do this check here.
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.
I like that idea. It seems like many of our functions could take an argument that essentially says "skip input verification because I know they're valid" for use cases optimized for performance. This seems like a good topic for the dispatching meeting, even though what you're proposing is or could be specific to nx-cugraph's kwargs.
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.
I added this feature request for the opt-in suggestion above: #70
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.
My original thought was to keep this an internal option--i.e., keyword--to
_list_to_nodearray
(and maybe others) to control whether to do this check. E.g., some networkx algorithms may or may not raise.