Conversation
Schefflera-Arboricola
left a comment
There was a problem hiding this comment.
Consider adding some unit tests for should_run-- creating a centralised test-- like test_get_chunks-- might be good here.
Schefflera-Arboricola
left a comment
There was a problem hiding this comment.
Thanks for this PR @akshitasure12 !
Left a few comments/suggestions below. LMKWYT.
Also, could we add should_run for more functions* with similar should run messages and have a single should_run-- instead of having same should_run for several algorithms? LMK if that's possible. Thanks!
*some shortest paths functions also doesn't show much speed ups-- refer timing folder for more
I’ve added I tested it on test_should_run.py: import networkx as nx
import logging
nxl = logging.getLogger("networkx")
nxl.addHandler(logging.StreamHandler())
nxl.setLevel(logging.DEBUG)
G = nx.empty_graph(5)
print(nx.number_of_isolates(G))Output: Call to 'number_of_isolates' has inputs from {'networkx'} backends, and will try to use backends in the following order: ['parallel', 'networkx']
Backend 'parallel' shouldn't run `number_of_isolates` with arguments: (G=<networkx.classes.graph.Graph object at 0x103f9d6a0>), because: Fast algorithm; skip parallel execution
Trying next backend: 'networkx'
Call to 'isolates' has inputs from {'networkx'} backends, and will try to use backends in the following order: ['parallel', 'networkx']
Backend 'parallel' does not implement 'isolates'
Trying next backend: 'networkx'
5 |
Schefflera-Arboricola
left a comment
There was a problem hiding this comment.
review comments from meeting:
- including should_run for if n_jobs=None or 1 or 0 for all nx-parallel algorithms-- default should run?
- Adding should_run to more algorithms-- based on performance heatmaps' trends
should_run functionalityshould_run functionality
e0c0964 to
cdac770
Compare
should_run functionalityshould_run functionality
|
@dschult The |
dschult
left a comment
There was a problem hiding this comment.
This looks good!
I have one suggestion to remove the word "custom" in one place (to match the other removals). If leaving it was intentional then leave it. :)
Co-authored-by: Dan Schult <dschult@colgate.edu>
This PR handles #77.
Contents of test_should_run.py :
Output: