-
Notifications
You must be signed in to change notification settings - Fork 19
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
Should graph[label]
return the vertex metadata or the integer code?
#44
Comments
and how would you get the vertex metadata ? define a |
Yeah that's always the compromise, if you get one fast you get the other one slowly. I would favor I have no strong opinion, I just thought it's a matter worth discussing while we stabilize the API |
so what previously in #39 was done with
and I wanted it to be like
with your proposition it will end up looking:
which is still pretty wordy. |
No matter what we do, if we want to use functions from Graphs.jl with labels, it will have to be wordy. I tried to explain it here (#39 (comment)): basically the only alternative would be to reimplement all of Graphs.jl with labels, not juste a few functions like |
there is still some space to work before thinking of doing such a mass forwarding which I also find demanding. For example, we could tread
so |
That's an idea I actually like. The only reasonable use of integer labels is to compensate for vertex code updating following deletions or to provide default identifiers (as seen in #37 for instance). Maybe that's worth giving up on for shorter syntax. @bramtayl thoughts? |
I think I'm ready to fully ban integer labels. Then we can use multiple dispatch to make codes and labels interchangeable, which several people have asked for. We might need to add a note to the documentation that using codes can be more performant in some cases, because it avoids having to look up the label multiple times.
If we make codes and labels interchangable, then hopefully users won't even have to interact with the codes at all. In that case, I think returning the vertex metadata would be more useful?
That seems maybe a bit confusing: I'd expect them to return the same thing? |
Then what do you mean by using multiple dispatch on codes and labels? |
Oh, just so that you could do e.g. |
The thing is, if we do that, there's no reason to stop there, and we might end up re-implementing all of Graphs.jl with labels instead of codes. |
The text was updated successfully, but these errors were encountered: