cudadog / pydot Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/pydot
License: MIT License
Automatically exported from code.google.com/p/pydot
License: MIT License
What steps will reproduce the problem?
1. install pydot 1.0.2
2. compile the example
What is the expected output? What do you see instead?
TypeError: cannot concatenate 'str' and 'int' objects
What version of the product are you using? On what operating system?
graphviz 2.18
python 2.5+
pyparsing 1.4.11
pydot 1.0.2
win vista and winxp sp2
Please provide any additional information below.
i find the example at http://dkbza.org/pydot.html like this:
import pydot
edges=[(1,2), (1,3), (1,4), (3,4)]
g=pydot.graph_from_edges(edges)
g.write_jpeg('graph_from_edges_dot.jpg', prog='dot')
but i get error
i change it like this
edges=[('1','2'), ('1','3'), ('1','4'), ('3','4')]
that is ok.
Original issue reported on code.google.com by [email protected]
on 7 May 2008 at 3:49
This graph is parsed OK:
a -> b
a -> c
But this shortening don't work:
a -> {b, c}
Original issue reported on code.google.com by [email protected]
on 14 Jan 2008 at 4:11
What steps will reproduce the problem?
1. for a dot node, try node.set_fontsize(8), without the string quotes
2. write the graph to an external file
3. pydot will break in some to_string routine
What is the expected output? What do you see instead?
I expected to have the int converted to string
I used a python int value when setting stuff:
node.set_fontsize(8)
has to be
node.set_fontsize("8")
I couldn't point my finger directly on where to put a good fix
Original issue reported on code.google.com by [email protected]
on 8 Apr 2008 at 11:09
This works:
pydot.Dot(rankdir="LR", overlap="False", graph_type='digraph',
simplify=True)
This works not:
pydot.Dot(rankdir="LR", overlap=False, graph_type='digraph',
simplify=True)
File "file.py", line 374, in function
dot.write_svg(directory+'/region_graph_%s.svg'%name, prog='neato')
File "/var/lib/python-support/python2.5/pydot.py", line 1602, in <lambda>
lambda path, f=frmt, prog=self.prog : self.write(path, format=f,
prog=prog))
File "/var/lib/python-support/python2.5/pydot.py", line 1696, in write
dot_fd.write(self.create(prog, format))
File "/var/lib/python-support/python2.5/pydot.py", line 1740, in create
self.write(tmp_name)
File "/var/lib/python-support/python2.5/pydot.py", line 1694, in write
dot_fd.write(self.to_string())
File "/var/lib/python-support/python2.5/pydot.py", line 1472, in
to_string
return ''.join(graph)
TypeError: sequence item 5: expected string, bool found
Why not allowing the natural data types?
Original issue reported on code.google.com by [email protected]
on 17 Feb 2009 at 9:09
Any layout attempt using prog="sfdp" fails.
Original issue reported on code.google.com by [email protected]
on 4 Nov 2010 at 11:42
What steps will reproduce the problem?
# encoding: utf-8
import pydot
dot = pydot.Dot(charset='utf-8')
dot.add_node(pydot.Node('test',
label=u'<<font color="red">Проба</font>>'.encode('utf-8')))
dot.write_png('test.png')
What is the expected output? What do you see instead?
expected:
digraph G {
graph [charset="utf-8"];
node [label="\N"];
graph [bb="0,0,384,36"];
test [label=<<font color="red">Проба</font>>, pos="192,18", width="5.33", height="0.50"];
}
now:
digraph G {
graph [charset="utf-8"];
node [label="\N"];
graph [bb="0,0,384,36"];
test [label="<<font color=\"red\">Проба</font>>", pos="192,18", width="5.33", height="0.50"];
}
What version of the product are you using? On what operating system?
pydot 1.0.25, Python 2.6.5, ubuntu 10.04
Original issue reported on code.google.com by [email protected]
on 18 May 2011 at 9:47
...where X is (keys|values|items).
It depends on the usage, but if the iteration does not involve modifying
the underlying collection, then you should use iterX() instead, as X() will
create a copy of the collection.
Original issue reported on code.google.com by [email protected]
on 21 Mar 2010 at 12:38
Can a Windows installation binary be made for this?
Original issue reported on code.google.com by [email protected]
on 30 Jan 2009 at 9:36
Can this be tested with Python 2.6 to ensure it works?
Original issue reported on code.google.com by [email protected]
on 30 Jan 2009 at 9:35
What steps will reproduce the problem?
1. Change to test directory
2. python pydot_unittest.py
What is the expected output? What do you see instead?
Expected: no warnings or errors.
Actual:
# python pydot_unittest.py
test_add_style (__main__.TestGraphAPI) ... ok
test_attribute_with_implicit_value (__main__.TestGraphAPI) ... ok
test_create_simple_graph_with_node (__main__.TestGraphAPI) ... ok
test_executable_not_found_exception (__main__.TestGraphAPI) ... ok
test_graph_add_edge_argument_type (__main__.TestGraphAPI) ... ok
test_graph_add_node_argument_type (__main__.TestGraphAPI) ... ok
test_graph_add_subgraph_argument_type (__main__.TestGraphAPI) ... ok
test_graph_pickling (__main__.TestGraphAPI) ... ok
test_graph_with_shapefiles (__main__.TestGraphAPI) ... Warning: AI_icon was
already in a rankset, ignored in cluster G
Warning: Biology_icon was already in a rankset, ignored in cluster G
Warning: Social_Networks_icon was already in a rankset, ignored in cluster G
Warning: Turing_icon was already in a rankset, ignored in cluster G
Warning: Rejewski_icon was already in a rankset, ignored in cluster G
Warning: Dertouzos_icon was already in a rankset, ignored in cluster G
Warning: Berners_Lee_icon was already in a rankset, ignored in cluster G
ok
test_graphviz_regression_tests (__main__.TestGraphAPI) ...
###############Warning: node columns_foo_insider, port foo unrecognized
Warning: cluster_foo -> label_xxxxxxx: head not inside head cluster cluster_foo
#######################################Warning: hot_pink is not a known color.
###########Warning: slate_blue is not a known color.
Warning: hot pink is not a known color.
######################################################################Warning:
layers not supported in jpe output
#Warning: layers not supported in jpe output
#Warning: layers not supported in jpe output
#############################Warning: using box for unknown shape DFDbox
##Warning: using box for unknown shape sdl_task
Warning: using box for unknown shape sdl_input_from_right
Warning: using box for unknown shape sdl_input_from_left
Warning: using box for unknown shape sdl_priority_input_from_right
Warning: using box for unknown shape sdl_priority_input_from_left
Warning: using box for unknown shape sdl_start
Warning: using box for unknown shape sdl_procedure_start
Warning: using box for unknown shape sdl_state
Warning: using box for unknown shape sdl_output_to_right
Warning: using box for unknown shape sdl_output_to_left
Warning: using box for unknown shape sdl_condition
Warning: using box for unknown shape sdl_save
Warning: using box for unknown shape sdl_stop
Warning: using box for unknown shape sdl_return
Warning: using box for unknown shape sdl_create
Warning: using box for unknown shape sdl_call
Warning: using box for unknown shape sdl_text
Warning: using box for unknown shape sdl_text_extension_from_left
Warning: using box for unknown shape sdl_text_extension_from_right
Warning: using box for unknown shape sdl_comment_from_left
Warning: using box for unknown shape sdl_comment_from_right
Warning: using box for unknown shape sdl_connector
Warning: using box for unknown shape sdl_set
Warning: using box for unknown shape sdl_reset
Warning: using box for unknown shape sdl_export
########################Warning: No such file or directory while opening jcr.gif
Warning: No or improper shapefile="jcr.gif" for node "n"
Warning: No such file or directory while opening jcr.gif
Warning: No or improper shapefile="jcr.gif" for node "x"
#####ok
test_keep_graph_type (__main__.TestGraphAPI) ... ok
test_keyword_node_id (__main__.TestGraphAPI) ... ok
test_keyword_node_id_to_string_no_attributes (__main__.TestGraphAPI) ... ok
test_keyword_node_id_to_string_with_attributes (__main__.TestGraphAPI) ... ok
test_multiple_graphs (__main__.TestGraphAPI) ... ok
test_my_regression_tests (__main__.TestGraphAPI) ... ####ok
test_names_of_a_thousand_nodes (__main__.TestGraphAPI) ... ok
test_numeric_node_id (__main__.TestGraphAPI) ... ok
test_quoted_node_id (__main__.TestGraphAPI) ... ok
test_quoted_node_id_to_string_no_attributes (__main__.TestGraphAPI) ... ok
test_subgraphs (__main__.TestGraphAPI) ... ok
test_unicode_ids (__main__.TestGraphAPI) ... ok
----------------------------------------------------------------------
Ran 22 tests in 253.656s
OK
What version of the product are you using? On what operating system?
SVN Revision 17
Please provide any additional information below.
Also, are there any docs anywhere?
Original issue reported on code.google.com by [email protected]
on 26 Nov 2010 at 3:36
Is it possible to provide alternative pydot download with dependencies
included? So that dependencies will be checked and upgraded/installed when
needed.
Original issue reported on code.google.com by [email protected]
on 19 May 2008 at 1:51
What steps will reproduce the problem?
1. Fix a bug in pydot (e.g. 17)
2. Produce a patch
3. Wait more than 6 months for the patch to be applied and the bug even
acknowledged by the maintainers
What is the expected output? What do you see instead?
Bug should be acknowledged, marked as nextrelease or something.
What version of the product are you using? On what operating system?
1.0.2
Please provide any additional information below.
Folks, I know everyone is busy. I also have open source projects and I
don't always get to them on time, but when people submit a patch I think
you should at least send and ACK back.
Cheers,
Leo.
Original issue reported on code.google.com by [email protected]
on 8 Feb 2010 at 1:35
What steps will reproduce the problem?
1. create a diagram using pydot.
2. put one of the nodes name as 'Testnode:###@'
3. or put labels on arrow as 'testlabel:###,@'
What is the expected output? What do you see instead?
It Should consider the name as a string and should be shown on the node/label
What version of the product are you using? On what operating system?
pydot 1.0.2
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 20 Aug 2010 at 10:00
The current example code is in a single line:
# Now it's possible to use rank to lay out nodes at the same level
graph = pydot.Dot('graphname', graph_type='digraph') subg = pydot.Subgraph('', rank='same') subg.add_node(pydot.Node('a')) graph.add_subgraph(subg) subg.add_node(pydot.Node('b')) subg.add_node(pydot.Node('c'))
It would be nice to have it separated by line feeds to aid in easy
copy-pasting. :)
~
musically_ut
Original issue reported on code.google.com by musically.ut
on 24 Nov 2010 at 12:39
What steps will reproduce the problem?
1. in file test.dot, add a node with "." eg 2.3 [label="dot_node"]
2. pydot.graph_from_dot_file(test.dot)
3. parse will fail
What is the expected output? What do you see instead?
node 2.3 will fail to parse. result in runtime exception
What version of the product are you using? On what operating system?
1.0.4 ubuntu 10.10
Possible fix:
In dot_parser.py, replace the line:
indentifier = Word(alphanums + "_").setName("identifier")
with
indentifier = Word(alphanums + "_" + ".").setName("identifier")
Original issue reported on code.google.com by [email protected]
on 3 Mar 2011 at 3:36
GraphViz 2.26.3 (which I installed just today) uses a different registry key to
store the install path. Instead of "SOFTWARE\ATT\Graphviz" the key used is
"Software\AT&T Research Labs\GraphViz".
The simplest solution is to check the both locations.
for regkey in ("SOFTWARE\ATT\Graphviz",
"SOFTWARE\AT&T Research Labs\GraphViz") :
try :
hkey = win32api.RegOpenKeyEx( win32con.HKEY_LOCAL_MACHINE,
regkey, 0, win32con.KEY_QUERY_VALUE )
except win32api.error :
continue
else :
break
else :
# Raise error that registry not found
raise Exception("Unable to find graphviz")
(Modified to fit whatever style conventions you have.)
Since Graphviz puts its bin in the path, a simpler, more logical check, would
be to just call "dot -V" (or whatever program) and search the output for the
string "graphviz".
Original issue reported on code.google.com by [email protected]
on 15 Jul 2010 at 2:49
What steps will reproduce the problem?
import pydot
graph = pydot.Dot('graphname', graph_type='graph')
node_a = pydot.Node("Node A", style="filled", fillcolor="#21e1d2",
shape="folder")
graph.add_node(node_a)
#graph.write_jpg('hu.jpeg')
#graph.write_gif('hu.gif')
#print graph.create(format="jpeg")
graph.write_cmap('hu.cmap')
print graph.create(format="cmap")
#graph.write_dot('hu.dot')
# leads to
# ========
#Traceback (most recent call last):
# File "test_pydot2.py", line 9, in <module>
# graph.write_cmap('hu.cmap')
# File "build/bdist.linux-i686/egg/pydot.py", line 1602, in <lambda>
# File "build/bdist.linux-i686/egg/pydot.py", line 1696, in write
#TypeError: argument 1 must be string or buffer, not list
Please provide any additional information below.
patch:
+++ pydot.py 2010-09-01 11:25:11.000000000 +0200
@@ -1807,5 +1807,5 @@
os.unlink(tmp_name)
- return stdout_output
+ return stdout_output or ''
Original issue reported on code.google.com by [email protected]
on 1 Sep 2010 at 9:29
Hi Ero,
I am running pydot on Mac OS X 10.5.1 and am experiencing the empty output
file problem as described in
http://code.google.com/p/pydot/wiki/EmptyOutputFiles.
I added the path to graphviz to my path and the executables are being
found. This was verified via a debugger by stepping through the pydot
source code.
The source of my problem is the statement "data = stdout.read()" in
Dot.create() is not returning anything and thus "data" has no value.
I examined the temporary file referenced by stdout and verified that it
contains data.
I am running with the following versioned software:
* pydot - 0.9.10
* graphviz - 2.14
* python - 2.5
Keith
Original issue reported on code.google.com by [email protected]
on 18 Dec 2007 at 9:34
Just tripped over this bug, i guess it should be edge instead of elm.
Otherwise working great, thanks a lot.
Original issue reported on code.google.com by [email protected]
on 25 Mar 2008 at 3:46
What steps will reproduce the problem?
>>> import pydot
>>> import pickle
>>> test = pydot.Dot()
>>> output = open("data.pkl", "wb")
>>> pickle.dump(test, output)
What is the expected output? What do you see instead?
Expect no output and I get this:
AttributeError: 'Dot' object has no attribute 'attributes'
What version of the product are you using? On what operating system?
version: '1.0.2'
operating system: Linux
Please provide any additional information below.
I like turtles. I like this project too. Thanks
Original issue reported on code.google.com by [email protected]
on 27 Aug 2008 at 6:40
What steps will reproduce the problem?
1. Copy the example pydot Python script into a file:
$ cat example.py
import pydot
edges=[(1,2), (1,3), (1,4), (3,4)]
g=pydot.graph_from_edges(edges)
g.write_jpeg('graph_from_edges_dot.jpg', prog='dot')
2. Run this script:
$ python example.py
Traceback (most recent call last):
File "example.py", line 4, in ?
g=pydot.graph_from_edges(edges)
File "/d0/home/sramapra/personal/pydot-read-only/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
What is the expected output? What do you see instead?
I should get a jpeg file that contains the graph. I instead see the
traceback mentioned above.
What version of the product are you using? On what operating system?
$ uname -a
Linux arakkis 2.6.18.8-0.11-default #1 SMP Sat Oct 11 16:17:11 UTC 2008
x86_64 x86_64 x86_64 GNU/Linux
From pydot help:
VERSION
1.0.2
Comments:
It appears that simply coercing the edge elements to strings will fix the
issue:
e = Edge( node_prefix + str( edge[0] ), node_prefix + str( edge[1] ) )
Original issue reported on code.google.com by [email protected]
on 17 Oct 2008 at 10:23
What steps will reproduce the problem?
1. Click the link, it goes to a redirect page; the homepage for the project has
moved
What is the expected output? What do you see instead?
Should just go to the new home page: http://pyparsing.wikispaces.com/
Original issue reported on code.google.com by [email protected]
on 24 Nov 2010 at 2:12
What steps will reproduce the problem?
1. Install pydot
2. Try creating a .jpg of a graph.
3. Observe that pydot fails to find the .EXEs of GV
What is the expected output? What do you see instead?
I expect pydot to find the executables :)
What version of the product are you using? On what operating system?
1.0.2. Windows 7 64 bit.
Please provide any additional information below.
First of all you should know that the executables that pydot needs are
found in the directory - C:\Program Files (x86)\Graphviz2.26.3\bin .
The first method for detecting the path of the executables (using pywin32)
doesnt work. I had to delete the first case, and put C:\Program Files
(x86)\Graphviz2.26.3\bin in the PATH, and then everything was fine :).
Original issue reported on code.google.com by [email protected]
on 12 May 2010 at 7:04
pydot is only at v1.02 on PyPI http://pypi.python.org/pypi/pydot but has seen
several significant updates since the 1.02 release. It would be nice if the
pydot maintainers kept the PyPI download link, if not the actual packages
uploaded to PyPI, in closer sync.
Original issue reported on code.google.com by [email protected]
on 7 Apr 2011 at 6:58
What steps will reproduce the problem?
1. Install (multiple versions of) graphviz into multiple locations
2. Include in PATH more than one directory containing graphviz
3. call pydot.find_graphviz()
What is the expected output? What do you see instead?
I expect the first executable in the path. pydot.find_graphviz() finds the
last executable in the path.
What version of the product are you using? On what operating system?
pydot-0.9.10, python-2.5, Ubuntu 7.04 (Intel 32-bit)
Please provide any additional information below.
Reordering the loops and inserting breaks ought to produce correct results:
for prg in progs.keys():
for path in os.environ['PATH'].split(os.pathsep):
if os.path.exists(path+os.path.sep+prg):
progs[prg] = path+os.path.sep+prg
break
elif os.path.exists(path+os.path.sep+prg + '.exe'):
progs[prg] = path+os.path.sep+prg + '.exe'
break
Original issue reported on code.google.com by [email protected]
on 18 Sep 2007 at 10:37
I have a graph from the python-graph library that I am rendering to a dot file.
python-graph uses this library to interact with graphviz. The graph has
approximately 1,200 nodes and 266,000 edges and runs out of memory on a 4 GB
machine.
After some profiling, I found that it spent a majority of its time inside of
pydot and memory usage started increasing dramatically in the to_string method.
Looking at the code, I found that pydot keeps all of the lines of the file in
memory and then combines it into a single stream. With such a large file, it
was keeping an absolutely huge list of strings in memory at the same time.
I think a solution to this is to optionally write the results to a file. This
can be accomplished by having a "to_stream" method added to every class with a
"to_string" method. Roughly it would be doing this for each "to_string"
function.
Rename "to_string(self)" to "to_stream(self, graph)". Change all times when it
does something like:
graph.append('text to write')
to
graph.write('text to write')
From there, you can implement "to_string" by using the builtin StringIO class.
from StringIO import StringIO
def to_string(self):
try:
buffer = StringIO()
self.to_stream(buffer)
return buffer.getvalue()
finally:
buffer.close()
I don't know if the close matters for StringIO. It frees the memory buffer
(which you've already copied after using getvalue), but that buffer is probably
freed by the destructor of StringIO.
You keep the old functionality and gain some additional functionality. Anybody
who wants to use "to_stream" will have to manage whatever stream they want to
send it to.
I can write this up and submit a patch later, but I won't have time until late
tonight/tomorrow.
Original issue reported on code.google.com by [email protected]
on 12 Apr 2011 at 8:12
From the DOT user's guide at
http://www.graphviz.org/Documentation/dotguide.pdf: "In the top-level graph
heading, a graph may be declared a strict digraph. This forbids the
creation of self-arcs and multi-edges; they are ignored in the input file."
The pydot parser does not do this. It creates the self-arcs and multi-edges
anyway, regardless of whether a graph is declared as "strict."
Original issue reported on code.google.com by [email protected]
on 31 Jul 2008 at 10:26
What steps will reproduce the problem?
1. Run the following (or similar) interactive Python session:
>>> import pydot
>>> g = pydot.Graph()
>>> s = pydot.Subgraph("foo")
>>> g.get_subgraphs()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/var/lib/python-support/python2.6/pydot.py", line 1345, in
get_subgraphs
return get_subgraph_list()
NameError: global name 'get_subgraph_list' is not defined
>>> g.get_subgraph_list()
[]
>>> sgs = g.add_subgraph(s)
>>> g.get_subgraphs()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/var/lib/python-support/python2.6/pydot.py", line 1345, in
get_subgraphs
return get_subgraph_list()
NameError: global name 'get_subgraph_list' is not defined
>>> g.get_subgraph_list()
[<pydot.Subgraph object at 0xa279d2c>]
>>> g.get_subgraph("foo")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/var/lib/python-support/python2.6/pydot.py", line 1330, in get_subgraph
if self.obj_dict['subgraphs'].has_key( sgraph.get_name() ):
NameError: global name 'sgraph' is not defined
What is the expected output? What do you see instead?
There are global name problems in the implementations of the
Graph.get_subgraphs() and Graph.get_subgraph(<name>) functions. This may
just be a case of having forgotten to include the "self" argument, which
has skipped by testing if the tests don't use subgraphs.
What version of the product are you using? On what operating system?
I'm using the system package of pydot on Ubuntu 9.04 (Jaunty)
>>> pydot.__version__
'1.0.2'
Original issue reported on code.google.com by [email protected]
on 16 May 2009 at 4:10
What steps will reproduce the problem?
1. generate a Cluster object "node"
2. try node.set_color("Red")
3. pydot will complain
Please provide any additional information below.
I found that cluster object lacked "set_color" and more,
so I had to add:
self.create_attribute_methods(CLUSTER_ATTRIBUTES)
to the end of Cluster.__init__ to get the cluster specific attributes
Original issue reported on code.google.com by [email protected]
on 8 Apr 2008 at 11:05
1: When adding an edge to a Graph via add_edge(Edge('foo', 'bar')) the key
value that ends up in the obj_dict['edges'] dictionary is not the ('foo',
'bar') pair, but rather the following: ('"foo"', '"bar"')
This causes me to have to do something silly when using the get_edge
function such as: Graph.get_edge('"%s"'%src, '"%s"'%dst) in order for it to
create ('"foo"', '"bar"') internally and actually find the edge i'm looking
for.
2: The documentation for get_edge() in incorrect. It states:
"""Retrieved an edge from the graph.
Given an edge's source and destination the corresponding
Edge instance will be returned.
If multiple edges exist with that source and destination,
a list of Edge instances is returned.
If only one edge exists, the instance is returned.
None is returned otherwise.
"""
However in the code there is no place where None is actually returned:
snippet:
if len(match)==1:
return match[0]
return match
should be:
if len(match)==0:
return None
elif len(match)==1:
return match[0]
return match
3: It would be nice if get_edge always returned an Edge or always returned
a list of Edges, but by being able to return both it requires users code to
check what it actually got in return. If you simply returned a list of
Edges then it is easy for the user to check for None or len() of 1
Original issue reported on code.google.com by [email protected]
on 24 Dec 2008 at 4:49
Is there any way to remove edges from a graph?
Original issue reported on code.google.com by [email protected]
on 8 Sep 2010 at 2:45
What steps will reproduce the problem?
1. Call the get_subgraph function
What is the expected output? What do you see instead?
The expected output is a return type of Subgraph. The current issue is a
simple coding bug. But I don't believe the implementation is correct.
What version of the product are you using? On what operating system?
1.02
Please provide any additional information below.
Here is the function fixed so that it doesn't fail. As mentioned in the
discussion group, I believe the subgraph functions as a whole need to be
reviewed. The subgraphs are being reconstructed incorrectly.
---------------------------------------------------------------------------
def get_subgraph(self, name):
match = []
if self.obj_dict['subgraphs'].has_key( name ):
sgraphs_obj_dict = self.obj_dict['subgraphs'].get( name )
for obj_dict_list in sgraphs_obj_dict:
match = [ Subgraph( obj_dict = obj_d ) for obj_d in
obj_dict_list ]
if len(match)==1:
return match[0]
return match
---------------------------------------------------------------------------
Original issue reported on code.google.com by [email protected]
on 7 Jul 2009 at 1:42
What steps will reproduce the problem?
1. Create the following Dot file:
digraph {
a -> b[label="hi", decorate];
}
(The validity of this graph can be verified by running Dot on it.)
2. Run pydot.dot_parser.graph_definition().parseFile('/path/to/file.dot')
PyDot complains, 'ParseException: Expected "}" (at char 24), (line:2, col:15).'
This issue appears to be caused by an erroneous assumption in the P_AttrList
class that attributes always appear in name/value pairs.
I'm using the latest release of PyDot on Scientific Linux with Python 2.5.1.
I have provided a patch to fix this problem; it merely prevents suppression of
the '=' character in attribute lists and uses that in P_AttrList construction
to determine which attributes have values and which do not.
Original issue reported on code.google.com by [email protected]
on 2 Jul 2010 at 6:33
Attachments:
The python-graph team are working on porting our project to Python 3.x -
naturally we'd like to retain our support for pydot. Can any member of this
project comment if a python 3.x version is likely in the near future.
Thanks!
Original issue reported on code.google.com by [email protected]
on 1 Oct 2009 at 11:24
What steps will reproduce the problem?
1. File attached - direct DOT text file works fine on simple test graph
2. Occurs when attempting to create table-like structure using multiple
node lines with rank=same. Works fine in direct DOT calls (where I'm using
much more complex structures including embedded clusters and subgraphs).
3. I've remove all comment lines to make sure they were not triggering the
problem (although I can't image why, it shortens the file).
What is the expected output? What do you see instead?
Instead of two lines of nodes, I receive a single long row. The subgraphs
are not maintaining their independencies.
Let me know if you need additional information/data.
What version of the product are you using? On what operating system?
XP-SP3, DOT 2.21, pydot 1.02, Python 2.5, IDLE (python's standard IDE) for
testing purposes (to keep it simple).
Please provide any additional information below.
- Objective - create multi-tier embedded table structure using pydot. I
can do this in DOT (directly, see attached sample).
- Objective - add distance values to edges which can be used in
least-distance calculations.
- Objective - create cluster structures as supported in DOT.
Suggestions (class extensions):
- support for Cluster function which is very useful in DOT.
- add_edge_list (not the graph_from_edge, but a full list of tuples)
- add_node_list (list with attributes)
- add_edge_chain - ordered list where each member is assumed to be linked
to the next member in the list. This is supported in DOT.
- add_edge_matrix(self, list_edges, length_subchain,
status_links_bidirectional) - ordered list that creates table-like grid
where automatic links are generated between vertical pairs and horizontal
pairs. For example, if a list of 12 members (essentially 4 rows of 3
members) is passed, used the length_subchain (in this case 3) to parse out
horizontal edges. If status_links_bidirectional==True, then link each row
(neighbor)member with the member in the row above it (so row 2, position 2
would link to row 1, position 2 and row 3, position 2) without having to
explicitly map out each each.
Original issue reported on code.google.com by [email protected]
on 14 Feb 2009 at 9:09
Attachments:
I have a problem with finding of path to GraphViz system in pydot module
version 1.0.2.
GraphVis catalog is "C:\Program Files\Graphviz 2.21\bin" by default, but
function find_graphvis() returned "None" value. It just because there
was "C:\Program Files\ATT\Graphviz\bin" as a default path to binaries.
Solving of problem is such
# Method 3 (Windows only)
#
if os.sys.platform == 'win32':
print 'win32'
# Try and work out the equivalent of "C:\Program Files" on this
# machine (might be on drive D:, or in a different language)
#
if os.environ.has_key('PROGRAMFILES'):
# Note, we could also use the win32api to get this
# information, but win32api may not be installed.
#path = os.path.join(os.environ
['PROGRAMFILES'], 'ATT', 'GraphViz', 'bin')
#print path
#else:
#Just in case, try the default...
path = r"C:\Program Files\Graphviz 2.21\bin"
print path
progs = __find_executables(path)
print progs
if progs is not None :
#print "Used default install location"
return progs
Original issue reported on code.google.com by [email protected]
on 28 Jan 2009 at 1:03
The documentation for the class Graph repeatedly and incorrectly says there's
an option "type"
which can be digraph or graph. It should read "graph_type".
here's the current documentation, with the errors marked by *****:
class Graph(object, Common):
"""Class representing a graph in Graphviz's dot language.
This class implements the methods to work on a representation
of a graph in Graphviz's dot language.
graph(graph_name='G', *****type='digraph', strict=False, suppress_disconnected=False,
attribute=value, ...)
graph_name:
the graph's name
*****type:
can be 'graph' or 'digraph'
Original issue reported on code.google.com by [email protected]
on 21 Jan 2008 at 5:44
What steps will reproduce the problem?
edges=[('1','2'), ('1','3'), ('1','4'), ('3','4')]
g=pydot.graph_from_edges(edges)
nodes = g.get_node_list()
print len(nodes)
What is the expected output? What do you see instead?
Should see 4, get 0
Note that if you have a graph with only one node, you do get a one element list
What version of the product are you using? On what operating system?
1.0.2 on windows with python 2.5
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 9 May 2008 at 9:21
What steps will reproduce the problem?
1. Install Graphviz on Windows.
2. If it was created then remove the SOFTWARE\ATT\Graphviz key from the
registry.
3. import pydot; pydot.find_graphviz()
What is the expected output? What do you see instead?
I would expect the registry check to fail and for the code to fall back to
checking paths. Instead, an (C++?)
exception is raised when calling win32api.RegOpenKeyEx(...).
What version of the product are you using? On what operating system?
pydot 1.0.2, Graphviz 2.22.2 (?) on Windows XP
Please provide any additional information below.
The following alternate "Method 1" for find_graphviz() that uses winreg/_winreg
appears to work:
# Method 1 (Windows only)
#
if os.sys.platform == 'win32':
# Get the GraphViz install path from the registry
#
try:
import winreg # Python 3.0+
except:
try:
import _winreg as winreg # Python 2.0+
except:
winreg = None
if winreg is not None:
hkey = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE)
try:
gvkey = winreg.OpenKey(hkey, "SOFTWARE\\ATT\\Graphviz", 0, winreg.KEY_READ)
if gvkey is not None:
path = winreg.QueryValueEx(gvkey, "InstallPath")[0]
if path is not None:
progs = __find_executables(path + os.sep + "bin")
if progs is not None :
#print "Used Windows registry"
return progs
except:
pass
finally:
winreg.CloseKey(hkey)
Original issue reported on code.google.com by [email protected]
on 22 Apr 2009 at 8:07
[deleted issue]
What steps will reproduce the problem?
>>> import pydot
>>> pydot.Node('a:').get_name()
'a'
What is the expected output?
'a:'
What do you see instead?
'a'
What version of the product are you using? On what operating system?
pydot-1.0.25 / GNU/Linux
Please provide any additional information below.
This works when pydot.needs_quotes(name). For example, it will work when name
== ":a".
Original issue reported on code.google.com by [email protected]
on 26 May 2011 at 8:09
What steps will reproduce the problem?
1. Install Graphviz to some directory with space e.g. C:\Program Files\...
2. Use pydot
3.
What is the expected output? What do you see instead?
Expected: pydot should be able to locate and execute appropriate executable
file in Graphviz
What I see: pydot does not found executable files.
What version of the product are you using? On what operating system?
Windows XP SP2
pydot 0.9.1
Python 2.4.4
Please provide any additional information below.
Workaround:
modify pydot's code in find_graphviz() as follows:
if os.path.exists(path+os.path.sep+prg):
progs[prg] = path+os.path.sep+prg
elif os.path.exists(path+os.path.sep+prg + '.exe'):
# BEGIN Edited by Chat to add " to the path namew with spaces
prog_path = path+os.path.sep+prg + '.exe'
if (" " in prog_path):
prog_path = '"' + prog_path + '"'
progs[prg] = prog_path
# END Edited by Chat to add " to the path namew with spaces
return progs
Original issue reported on code.google.com by [email protected]
on 22 Jan 2008 at 6:52
simplify=True does not work because class Edge does not provide an
appropriate __hash__ function, so that the test
if self.obj_dict.get('simplify', False) and edge in edges_done:
continue
tests only for reference identify.
This patch helps:
836a835,836
> def __hash__(self):
> return hash(self.get_source()+self.get_destination())
1457,1458c1457,1458
<
< if self.obj_dict.get('simplify', False) and elm in
edges_done:
---
>
> if self.obj_dict.get('simplify', False) and edge in
edges_done:
Original issue reported on code.google.com by [email protected]
on 17 Feb 2009 at 10:05
Whenever a colon(:) occurs in the value field of any of the
attributes, pydot throws an error. Please someone fix this as soon as
possible.
It is very likely to have ":" in the value provided to the URL
attribute. In my case I tried to create a node with URL='http://
www.google.com' but unfortunately this does not work. If I remove the
colon i.e give URL='http//www.google.com', it works without any error
but that doesn't serve the purpose. So it needs to be handled.
Original issue reported on code.google.com by [email protected]
on 24 Mar 2009 at 2:32
What steps will reproduce the problem?
set_penwidth() or get_penwidth() don't work until they get added by
pydot.EDGE_ATTRIBUTES.add('penwidth')
Original issue reported on code.google.com by [email protected]
on 5 Sep 2010 at 4:30
What steps will reproduce the problem?
import pydot
n1 = u"Thérèse Doe"
n2 = u"Jean-Pierre Toué"
# Does not work
g = pydot.Dot()
g.add_edge(pydot.Edge(n1, n2))
g.write_jpeg('test.jpg')
# Works :)
g = pydot.Dot()
g.add_edge(pydot.Edge(n1.encode('UTF-8'), n2.encode('UTF-8')))
g.write_jpeg('test.jpg')
What version of the product are you using? On what operating system?
1.0.2, on Fedora 10.
Please provide any additional information below.
Originally filed here: https://bugzilla.redhat.com/show_bug.cgi?id=481786
Original issue reported on code.google.com by [email protected]
on 3 Feb 2009 at 8:27
Sorry I did not find a forum or group can send my question so I paste it
here. If not approperiate, please just remove it.
I want to figure out a way to set default attributes for all fllowing
nodes' shape, but I could not find a method that can generate 'node
[shape='box']' sentense as ususaly seen in Dot file.
Any tips?
Original issue reported on code.google.com by [email protected]
on 5 Feb 2008 at 11:03
What steps will reproduce the problem?
import pydot
g = pydot.Dot()
g.add_node(pydot.Node("Anne-Cécile"))
g.add_edge(pydot.Edge(src='Anne-Cécile', dst='Anne-Marie'))
g.write('test.jpg', format='raw')
g.write_jpeg('test.jpg')
What is the expected output? What do you see instead?
>>> g.write_jpeg('test.jpg')
True
What do you see instead?
>>> g.write_jpeg('test.jpg')
Anne-Cécile [195, 169]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/site-packages/pydot.py", line 1603, in <lambda>
lambda path, f=frmt, prog=self.prog : self.write(path, format=f,
prog=prog))
File "/usr/lib/python2.5/site-packages/pydot.py", line 1697, in write
dot_fd.write(self.create(prog, format))
File "/usr/lib/python2.5/site-packages/pydot.py", line 1797, in create
status, stderr_output) )
pydot.InvocationException: Program terminated with status: 6. stderr follows:
Error: /tmp/tmpVEABbQ:2: syntax error near line 2
context: >>> Anne- <<< Cécile;
What version of the product are you using? On what operating system?
1.0.2 on Fedora 10 (also occurs in Rawhide)
Please provide any additional information below.
Originally filed here: https://bugzilla.redhat.com/show_bug.cgi?id=481540
Original issue reported on code.google.com by [email protected]
on 3 Feb 2009 at 8:25
Hi Ero,
Thanks for maintaining PyDot, it's very handy. PyDot has trouble finding
the graphviz executables on my machine (a Mac). The Mac version of GraphViz
tucks the executables into an application, so they don't usually make it
onto the path. They get put in
prefix/Graphviz.app/Contents/MacOS/ ,
where 'prefix' is usually but not necessarily '/Applications'. I don't know
if there's anything you can do about this, but thought you might like to know.
Original issue reported on code.google.com by [email protected]
on 14 Aug 2007 at 7:01
What steps will reproduce the problem?
1. Try to simple use the set(<attr>, <value>) method
What is the expected output? What do you see instead?
The use of set method don't make effect in result.
What version of the product are you using? On what operating system?
Linux Slackware 12.0, GraphViz 2.16.1, pydot 1.0.2.
Please provide any additional information below.
You can contact me at [email protected] for more information.
Original issue reported on code.google.com by [email protected]
on 29 Feb 2008 at 12:25
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.