get_edge() behavior with libgraphviz changes

24 views
Skip to first unread message

Casey Deccio

unread,
Jun 16, 2016, 11:21:03 AM6/16/16
to pygraphvi...@googlegroups.com
Admittedly, I haven't had a chance to dive into this to see what is going on--in part because someone else might know more efficiently where to look to see where the problem is.

In summary, it seems that the behavior of get_edge() changes between graphviz version 2.38 and 2.39.  Specifically, if I use a key with get_edge() from version 2.39, it returns an edge, even if the key doesn't match.  In 2.38 the same call would return KeyError.

Version 2.38:
>>> from pygraphviz import AGraph
>>> g = AGraph(directed=True)
>>> g.add_edge('a','b','123')
>>> g.get_edge('a','b','456')
Traceback (most recent call last):
     ...
KeyError: 'Edge a-b not in graph.'

Version 2.39:
>>> from pygraphviz import AGraph
>>> g = AGraph(directed=True)
>>> g.add_edge('a','b','123')
>>> g.get_edge('a','b','456')
(u'a', u'b')

I'm wondering if this is a libraphviz API change, bug in libgraphviz or pygraphviz, or something else.  It affects my code.  I'm happy to work around it, but it would be nice to know if there's a "fix".

Thanks,
Casey
Reply all
Reply to author
Forward
0 new messages