-
Notifications
You must be signed in to change notification settings - Fork 248
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
Cannot use integers as vertex names #693
Comments
Related issue: #664 |
This is breaking decompilation. Fixed by pinning version for now. Upstream issue: igraph/python-igraph#693 SkyTemple issue: SkyTemple/skytemple-files#378
I would suggest reverting this change, changing it to a deprecation warning instead and then raising the exception at earliest in version 0.11.x. |
The problem is that there is no disambiguation mechanism to distinguish between vertex IDs and vertex names. When vertex names are integers, they cannot be referred to in certain contexts. Integers will just be interpreted as IDs. People often do not realize this and are getting invalid results. @theCapypara Are you sure that this sort of ID-vs-name confusion never happens in your code? The most desirable solution would be implementing a disambiguation mechanism, but this is a complicated long term project that would need to be a more severely breaking change. There is no doubt that lookup-by-integer-name is desirable, but it seems to me that the current limitations make this infeasible. If you simply need to associate an integer with each vertex, but you do not need to look up vertices by that integer, then use a different attribute than P.S. Please don't take this comment as a statement on how this issue will be resolved. |
Thanks for the response! I'm pretty sure I had no issues with name/ID confusion in the past. The code in question* only adds vertices and traverses the graph via the edges IIRC, so maybe that's why I haven't really noticed any issues here. Internally everything seems to still work correctly and from what I remember the vertex IDs and names were seperate and not the same. To be clear, I don't really need vertex names as integers, I can spend some time fixing this code up to use string names, it's just that this update now resulted in the code immediately breaking. I don't think igraph uses semantic versioning, but this change isn't even documented in the changelog, and it would be nice if patch-level updates still don't break existing code, semantic versioning or not. *: it's part of a decompiler for an obscure machine language. |
@theCapypara Taking a practical approach here, after a cursory look at your code, it seems to me that you are not making use of the special features of the We will discuss the consequences of the breaking change, and what the best approach is, internally. |
Thanks! I'll definetly do that. |
A decision has been made to revert the change and turn it into a deprecation warning for 0.10.6; the behaviour will change in 0.11.0. A new release will come soon. |
Describe the bug
Version 0.10.5 of python-igraph introduced a breaking change: It is no longer possible to use integers as vertex names.
In previous versions this was allowed and functioned, I see nothing in the documentation for
add_vertex
that indicates that this wasn't allowed. This change breaks existing code that used integers as vertex names.To reproduce
Use python-igraph 0.10.5, create a simple graph and try to add a vertex with a name that is an integer. The following exception is raised:
Version information
python-igraph 0.10.5
The text was updated successfully, but these errors were encountered: