-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
ENH : Added get_chunks
to betweenness_centrality
and create_iterables
in utils
#29
Conversation
get_chunk
kwargs to functions
get_chunk
kwargs to functionsget_chunks
kwarg to functions
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 this approach. It is general (and works for nodes, edges and isolated_nodes) and allows the user to override the choice of node chunks. I'm not sure how much difference it makes in betweenness centrality to be able to split up the "hard" nodes, but in general it will make a difference if you can split them up. And betweenness centrality could have some nodes take a lot longer than others. So this is a good one to start with.
I don't know of a way to test that this is working. Maybe you should have a test that computes it using the built-in default chunking and also computes it with a user-defined method. They could be "smoke-tests" to see if using that option breaks it so badly that smoke starts coming out. If smoke doesn't come out, it might still be wrong. But you have at least tested that there are no fundamental problems. Have you thought about tests for this?
nx_parallel/algorithms/centrality/tests/test_betweenness_centrality.py
Outdated
Show resolved
Hide resolved
This PR has style issues. Next time you get to it, I think it is just one line with a space at the end of the line. |
get_chunks
kwarg to functionsget_chunks
to betweenness_centrality
and create_iterables
in utils
It might be assuming too much to assert that the time should be less when chunking is used. But should it always be slower? How might get_chunks slow it down? |
That makes good sense to me. |
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 think this is ready to be merged. So I'm approving it.
Are there any more changes planned for this PR?
Thanks @dschult ! |
Please do "Squash and merge" while merging this PR
get_chunks
kwarg tobetweenness_centrality
:node_chunks
(instead of how we currently do it i.e. by creating partitions on theG.nodes
; ifget_chunks
is"chunks"
(default) then this is executed). To understand the motivation for this see the additional pytest addedcreate_iterables
(ref. Pr [WIP]: Refactor-- consolidate and simplify #7)