Inconsistency of return types for vertex methods (constraint, closeness, etc.) and misleading docstrings

Bug #1170016 reported by Colin Morris
6
This bug affects 1 person
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).

Revision history for this message
Colin Morris (colin-morris2) wrote :
Tamás Nepusz (ntamas)
Changed in igraph:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Tamás Nepusz (ntamas)
milestone: none → 0.7
Revision history for this message
Gábor Csárdi (gabor.csardi) wrote : Continue on github

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:
https://github.com/igraph/igraph/issues/259

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.