graph_from_edges, get_node: bugs ?

15 views
Skip to first unread message

emmanuelito

unread,
Jun 23, 2009, 4:22:20 PM6/23/09
to pydot

I upgrade some previous code working with pydot 0.9.10 (Debian 4) to
pydot 1.0.2 (Debian 5).

* First problem:
The following code is supposed to work:

import pydot
g = pydot.graph_from_edges( ( (0,1), (1,2), (2,0) ) )


Under 1.0.2, it does not:
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/var/lib/python-support/python2.4/pydot.py", line 237, in
graph_from_edges
e = Edge( node_prefix + edge[0], node_prefix + edge[1] )
TypeError: cannot concatenate 'str' and 'int' objects

* Second problem:
import pydot
g = pydot.graph_from_edges( ( ('0','1'), ('1','2'), ('2','0') ) )
g.get_node('1')

In version 0.9.10, it was giving <pydot.Node object at 0xb7aaaf2c>

In version 1.0.2: it returns []


So I don't understand. Incompatible API changes or new bugs ?

Help appreciated, as my software depends on pydot and I must take
decision (it's complicated to downgrade to 0.9.10 as it's not packaged
in recent linux distribs).

Emmanuel


Kjell Magne Fauske

unread,
Jun 24, 2009, 2:09:13 AM6/24/09
to py...@googlegroups.com

I faced the same problem with the dot2tex tool that I maintain.
Version 1.0.x broke my code. I soon realized that making the tool
compatible with 1.0.x was not worth the effort in my case. I therefore
ended up writing a small graph library myself based on the pydot graph
parser.
If you don't need to support Windows, I highly recommend trying
Pygraphviz: http://networkx.lanl.gov/pygraphviz/

- Kjell Magne Fauske

Reply all
Reply to author
Forward
0 new messages