Repository navigation
Simplify flow func augmentation logic in connectivity module - #7367
Conversation
|
Yes -- good thought! I guess an even simpler way to handle this is to include Users who write their own functions already have to have the other kwargs at least in their signature (they can ignore them). So I guess that would put |
|
I got it, I am going to make the edits in a commit. |
|
There was a problem, that the |
rossbar
left a comment
There was a problem hiding this comment.
The simplification of all the conditional logic seems like an improvement to me. I wonder if it's possible to use functools.partial to solve this problem? Anyways, +1 for this cleanup as-is!
connectivity submodule with match caseconnectivity module
…rkx#7367) * Refactor `connectivity` submodule with match case * Refacotr kwargs for flow functions
Following the steps of #7036 and #7166, I have refactored the if/elif statements in
networkx/algorithms/connectivity/connectivity.pywith match/case statements.There was a couple of unwanted matches since they can be replaced with
or, I guess they were there because of reference equality withis, but matching with name makes it easier to group similar conditions together.