Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • graph-tool graph-tool
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 48
    • Issues 48
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

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
  • #119
Closed
Open
Created Aug 06, 2014 by Tiago Peixoto@count0Owner

Graph.add_edges(n!=1) doesn't take np.int64 type

Python 2.7.5 (default, Sep  6 2013, 08:38:35) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import graph_tool as gt
>>> gt.__version__
'2.2.25 (commit feec13d9, Mon Sep 2 00:01:39 2013 +0200)'
>>> import numpy as np
>>> g=Graph()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'Graph' is not defined
>>> g=gt.Graph()
>>> a=np.int64(5) 
>>> g.add_vertex(a)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib64/python2.7/site-packages/graph_tool/__init__.py", line 1275, in add_vertex
    v = libcore.add_vertex(weakref.ref(self), n)
Boost.Python.ArgumentError: Python argument types in
    graph_tool.libgraph_tool_core.add_vertex(weakref, numpy.int64)
did not match C++ signature:
    add_vertex(boost::python::api::object, unsigned long)
>>> g.add_vertex(n=a)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib64/python2.7/site-packages/graph_tool/__init__.py", line 1275, in add_vertex
    v = libcore.add_vertex(weakref.ref(self), n)
Boost.Python.ArgumentError: Python argument types in
    graph_tool.libgraph_tool_core.add_vertex(weakref, numpy.int64)
did not match C++ signature:
    add_vertex(boost::python::api::object, unsigned long)
>>> 

When I do g.add_vertex(int(a)), it works.

In earlier versions np.int64 type was accepted by Graph.add_vertex

Is it supposed to be like that?

Thanks,

Thomas

Assignee
Assign to
Time tracking