Skip to content
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

Lack of documentation for methods in cgraph package #74

Closed
constraintAutomaton opened this issue Apr 8, 2023 · 2 comments
Closed

Lack of documentation for methods in cgraph package #74

constraintAutomaton opened this issue Apr 8, 2023 · 2 comments

Comments

@constraintAutomaton
Copy link

constraintAutomaton commented Apr 8, 2023

There are some methods in the cgraph package that doesn't have documentations. Their names and parameters don't necessarily make the functioning of those entities obvious, for example the method func (g *Graph) Degree(n *Node, in, out int) int, I don't know what the in and out parameters means, for me the degree of a vertex, is simply the number of edges connected to it, so it should just have the n parameter. I have to look at the source code, find the C function underline agdegree and look at the documentation of graphViz C implementation to figure out what that function does and the role of those parameters.

The function agdegree(g, n, in, out) gives the degree of a node in (sub)graph g, where in and
out select the edge sets.
• agdegree(g,n,TRUE,FALSE) returns the in-degree.
• agdegree(g,n,FALSE,TRUE) returns the out-degree.
• agdegree(g,n,TRUE,TRUE) returns their sum.

And some confusion remains because it seems like the parameters in and out should be boolean, at least in the Go implementation.

So I think that more documentation would be beneficial.

@denk0403
Copy link
Contributor

denk0403 commented Apr 8, 2023

While I certainly agree that the documentation on the Go bindings could be improved, the example above just feels like a case of a missed opportunity to expose a higher-level API. For instance, cgraph should likely expose functions called Indegree(), Outdegree(), and TotalDegree(). Perhaps I'll make a PR for that as well...

@goccy
Copy link
Owner

goccy commented Dec 13, 2023

Merged #75

@goccy goccy closed this as completed Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants