Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002591graphvizGVeditpublic2016-03-02 07:582016-03-02 08:29
ReporterLT 
Assigned To 
PrioritynormalSeverityimportantReproducibilityalways
StatusnewResolutionopen 
PlatformOSWindows7OS VersionEnterprise SP1
Summary0002591: Interface with pygraphviz - possible issue with Agedge_t *agedge(...) in edge.c
DescriptionDear all,

Many thanks for producing and maintaining such useful software.

This problem is documented here: http://stackoverflow.com/questions/35610736/passing-a-string-to-agedge-in-agraph-py-issue-with-networkx-and-pygraphviz [^]

My issue relates to interactrion with pygraphviz - a python/SWIG wrapper for graphviz.

When this calls the following function, nothing is return resulting in an error:

Agedge_t *agedge(Agraph_t * g, Agnode_t * t, Agnode_t * h, char *name,
int cflag)

I'm really not convinced that this is an issue with graphviz itself, but I've raised this here just in case it is.

Steps To ReproduceIn python console with Graphviz2.38, networkx 1.11 and pygraphviz installed from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygraphviz: [^]


import networkx as nx
G=nx.MultiGraph()
fromnodes=[0,0,1,1,1,1,1,2,3,4,5,5,5,7,8,9,10]
tonodes=[1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]
dupedgeind=0
for x,y in zip(fromnodes,tonodes):
    if G.has_edge(x,y):
        dupedgeind=dupedgeind+1
        G.add_edge(x,y,key=dupedgeind)
    else:
        dupedgeind=0
        G.add_edge(x,y,key=dupedgeind)

pos=nx.nx_agraph.pygraphviz_layout(G,prog='sfdp')

Produces the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\networkx\drawing\nx_agraph.py", line 262, in pygraphviz_layout
    A=to_agraph(G)
  File "C:\Python27\lib\site-packages\networkx\drawing\nx_agraph.py", line 155, in to_agraph
    A.add_edge(u,v,key=str(key),**str_edgedata)
  File "C:\Python27\lib\site-packages\pygraphviz\agraph.py", line 484, in add_edge
    eh = gv.agedge(self.handle, uh, vh, key, _Action.find)
KeyError: 'agedge: no key'
Additional InformationThis problem is documented here: http://stackoverflow.com/questions/35610736/passing-a-string-to-agedge-in-agraph-py-issue-with-networkx-and-pygraphviz [^]


I think the source of the error is within this pygraphviz file, graphviz_wrap.c, line 3921:

https://github.com/pygraphviz/pygraphviz/blob/245fc9507a9e40f8c35762dd5073e42edb0388d3/pygraphviz/graphviz_wrap.c [^]

I've also raised reports on the networkx and pygraphviz source repositories:

https://github.com/networkx/networkx/issues/2012 [^]
https://github.com/pygraphviz/pygraphviz/issues/88 [^]
TagsNo tags attached.
AUXILLARY-FILES
DATE-FIXED
FIX-COMMENT
FORMER-ID
INPUT-FILE
OUTPUT-FILE
STATUS-COMMENT
VERSION2.38
Attached Files

- Relationships

-  Notes
User avatar (0001037)
LT (reporter)
2016-03-02 08:29

Apologies, GVedit category is incorrect. Should be Other.

- Issue History
Date Modified Username Field Change
2016-03-02 07:58 LT New Issue
2016-03-02 08:29 LT Note Added: 0001037


MantisBT 1.2.5[^]
Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker