Add should_run policy for when nodes is None#141
Conversation
Schefflera-Arboricola
left a comment
There was a problem hiding this comment.
If the parallel implementation can only run with nodes=None then I think can_run would be more appropriate here-- instead of should_run. Also, please always remember to document such details. Thanks!
|
The current code just implements what NetworkX implements when nodes is not None. Is this what you are meaning @Schefflera-Arboricola ? |
ok, then I think should_run makes sense here-- the existing should_run message isn't very clear about why this backend should not be run when nodes != None |
dschult
left a comment
There was a problem hiding this comment.
This looks good. I made a suggestion for the error message.
But I wonder if this will be common enough to justify a function in policies. Perhaps it is better as a one-off should-run function. But then upon thinking more I could see many cases where simple splitting on the nodes makes sense when nodes is None and not if e.g. nodes is a single node (or even a small collection of nodes).
So, I think this is the right place for it.
I'll go ahead and approve it now, with final wording of the warning soon to be fixed.
Co-authored-by: Dan Schult <dschult@colgate.edu>
|
Thank you @Schefflera-Arboricola and @dschult! I also removed the handling for the case when |
|
The test failure shows the difference between "should_run" and "can_run". :) |
|
@akshitasure12 and @dschult could you please merge the main branch into this PR's branch? -- I'm not seeing the option to sync fork for some reason.. once merged with main the CI tests should pass, and we can get this PR into the next release. Thanks! |
|
Hi @Schefflera-Arboricola, I've merged the main branch into the current PR branch :) |
There was a problem hiding this comment.
For a consistent and organized test structure, it would be good to split the tests in this file-- tests that test should_run used in nx-parallel can remain in this file, while tests that test the functionality implemented in should_run_policies.py (i.e. tests with dummy functions, data, etc.) can live in utils/tests/test_should_run_policies.py. (like get_chunks)
Fixes #137