Inconsistency of return types for vertex methods (constraint, closeness, etc.) and misleading docstrings
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
igraph |
Confirmed
|
Medium
|
Tamás Nepusz |
Bug Description
A number of methods of vertex, such as constraint, closeness, and degree, say that they are proxy methods for the corresponding Graph method (e.g. Graph.closeness()). The docstring will say something like:
This method calls the X method of the Graph class with this vertex as the first argument, and returns the result.
But whereas the graph methods always return lists, the vertex methods mostly return scalars. The only exception I found was Vertex.constraint, which still returns a list.
The return types of these methods should be made uniform and, if it's decided that they should all return scalars (which I think makes the most sense), the docstrings should be fixed to reflect this.
I've attached a quick code snippet that demonstrates the problem using 5 methods (it probably affects a few more).
Changed in igraph: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
assignee: | nobody → Tamás Nepusz (ntamas) |
milestone: | none → 0.7 |
The development of igraph has moved to github, so please do not comment on this bug here. You are of course welcome to comment on github, here: /github. com/igraph/ igraph/ issues/ 259
https:/