Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
graph-tool
graph-tool
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 44
    • Issues 44
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards

Please use the issue tracker only to report bugs (i.e. errors in the library that need to be fixed) or feature requests.

For questions about how to compile, install or use the library, please use instead the mailing list at https://graph-tool.skewed.de/mailing
(If unsure, use the mailing list first.)



When opening new issues, please choose the BUG template from the drop-down menu, and fill out the required information.

  • Tiago Peixoto
  • graph-toolgraph-tool
  • Issues
  • #286

Closed
Open
Opened Mar 27, 2016 by Andrew@Shatnerz

Value error when iterating over vertex properties

Something simple like:

g = gt.Graph()
v1 = g.add_vertex()
v2 = g.add_vertex()
label = g.new_vertex_property("string")
for name in label:
    pass

results in an in "ValueError: Invalid vertex index: 2"

Looks just like a one off error.

gt.__version__ gives '2.13 (commit c15ecea6, Tue Mar 1 19:10:53 2016 +0100)'

I may try to look into the source and see if I can fix the issue and push it if I have time. The traceback is below.

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-17-b49b77d7d85a> in <module>()
----> 1 for _ in label:
      2     pass
      3 

/usr/lib/python2.7/dist-packages/graph_tool/__init__.pyc in __getitem__(self, k)
    524         except ArgumentError:
    525             try:
--> 526                 k = self.__key_convert(k)
    527                 return self.__map[k]
    528             except ArgumentError:

/usr/lib/python2.7/dist-packages/graph_tool/__init__.pyc in __key_convert(self, k)
    502             except:
    503                 raise ArgumentError
--> 504             key = self.__g().vertex(key)
    505         return key
    506 

/usr/lib/python2.7/dist-packages/graph_tool/__init__.pyc in vertex(self, i, use_index, add_missing)
   1779                 self.add_vertex(int(i) - self.num_vertices(use_index) + 1)
   1780                 return self.vertex(int(i), use_index)
-> 1781             raise ValueError("Invalid vertex index: %d" % int(i))
   1782         return v
   1783 

ValueError: Invalid vertex index: 2
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: count0/graph-tool#286