-
-
Notifications
You must be signed in to change notification settings - Fork 31
Add should_run
policy for when nodes
is None
#141
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
base: main
Are you sure you want to change the base?
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.
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 |
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 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". :) |
Fixes #137