-
Notifications
You must be signed in to change notification settings - Fork 249
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
Implement simple cycle search Python binding #804
Conversation
@ntamas What kind of interface do you prefer for returning vertices or edges? This function returns both at the moment. In contrast, I don't have a strong opinion, and I'm not experienced enough with Python to know what's the most natural. |
@@ -8,7 +8,8 @@ requires = [ | |||
# Workaround based on this commit: | |||
# https://github.com/harfbuzz/uharfbuzz/commit/9b607bd06fb17fcb4abe3eab5c4f342ad08309d7 | |||
"setuptools>=64,<72.2.0; platform_python_implementation == 'PyPy'", | |||
"setuptools>=64; platform_python_implementation != 'PyPy'" | |||
"setuptools>=64; platform_python_implementation != 'PyPy'", | |||
"cmake>=3.12" |
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 change is unrelated to the PR but it's a nice addition. File a separate PR with this and I'll be happy to merge.
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.
C/igraph needs CMake 3.18 or later.
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.
@ntamas Is CMake needed even when building with an external igraph? I thought pkg-config
was sufficient then.
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.
It's not needed for an external igraph but it's needed for the vendored one. There's no way to specify this to Python build backends, though so it's easier to just include the build dependency - it won't hurt to have it there even if the user ends up linking to an external igraph.
Well, neither option is really "natural"; I believe that if this was a pure Python package I would have implemented a dataclass with two members, one for the vertices and one for the edges. The new ctypes-based interface would generate a function that returns a tuple with both output arguments. In the case of the now-current Python interface I would try to keep things consistent with |
My argument against that is the fact, that you have to call the function twice if you want both. Given the high performance impact for large graphs, it seems a bit wasteful to force the user to run it twice. To me, returning a tuple is pythonic; there are plenty of built-in Python functions that act just like that, for example Correspondingly, if this is an open discussion, I would rather propose to open a PR to change One possibility: introduce an optional |
For context, a new Python interface is in the works: https://github.com/igraph/python-igraph-ctypes Tuples definitely do make sense and as @ntamas said, the new interface will use them. One possible option for the old interface is to support It is still a question how much effort is worth putting into the old interface given that the new one is coming. Many people do use the old interface, and since at the moment we are very low on resources, it may take a long before it becomes ready. Thus "low resources" becomes and argument both for and against continuing to improve the old interface. The one to make the final decision in @ntamas |
A sorry, I was not aware of this new interface and misemphasized the "would", thank you for the context. Then I agree, it's probably best to stick to what we have now. I will draft a new PR soonish. |
Let's try supporting |
This is superseded by #806, right? |
This is the new iteration of #803 after switching to a new branch.