Skip to content

_add_edge and MultiDiGraph parameters #4

Description

Hello,

I may be missing something here - but there seems to be an issue with https://github.com/davebshow/ipython-gremlin/blob/master/gremlin/resultset.py#L169 and the current version of networkx. I get the following error message:

 /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/ipython_gremlin-1.0.0-py3.5.egg/gremlin/resultset.py in _add_vertex(self, v)
     167 
     168     def _add_vertex(self, v):
 --> 169         self._graph.add_node(v.id, {'label': v.label})
     170 
     171     def _add_edge(self, e):
 
 TypeError: add_node() takes 2 positional arguments but 3 were given

Changing it to the following seems to resolve the error:

self._graph.add_node(v.id, label=v.label)

https://networkx.github.io/documentation/latest/reference/classes/generated/networkx.MultiDiGraph.add_node.html

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions