-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Polymorphic isomorphism #5031
base: main
Are you sure you want to change the base?
Polymorphic isomorphism #5031
Conversation
Thanks for this! |
Of the three match helpers only two are tested currently. So if this is an objective, coverage could be improved significantly. Testing did however not get worse with the additions. |
5b1c613
to
ea70847
Compare
I think this makes sense... I wonder if we couldn't go a step further and boil the three methods ( Any thoughts on this @pinselimo ? Note that I'm not suggesting this has to be done in this PR, I'm only asking because you've clearly looked at this some. |
ea70847
to
67af702
Compare
Resolves issue networkx#4978 by enabling the isomorphism functions to distinguish multiedge input from other input and act accordingly. For backwards compatibility the old style multiedge functions can still be called, albeit internally using the new style functions.
67af702
to
519d9ea
Compare
I'm all for it. This would definitely simplify the API. Also, removing the doc-patching would clean the module up a lot. Should I open another PR? (and sorry for the double force push, forgot to run black first) |
Agreed, this is exactly what I was thinking. I've never used the |
I understand the desire for fewer functions overall. But in this case it comes at the price of putting the We could reduce the number of functions and still make them fast by including keyword arguments for each option of type. We'd just have to make sure the if clauses stay outside of the |
This PR is a proposal to resolve issue #4978 by enabling the isomorphism functions to distinguish multiedge input from other input and act accordingly.
For backwards compatibility the old style multiedge functions can still be called, albeit internally using the new style functions.
The second commit of this PR changes two
for
loops withif
clauses to use theall
function as I find it much more readable and it short-circuits just fine, so speed should be equal. Feel free to remove this change from the PR however.