cudadog / pydot

Automatically exported from code.google.com/p/pydot
MIT License
0 stars 0 forks source link

"strict" directive not properly handled (1.0.2) #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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 brols...@gmail.com on 31 Jul 2008 at 10:26

GoogleCodeExporter commented 9 years ago
The parser will parse what a dot files specifies. If a graph is declared as 
'strict' but its definition includes multiple identical edges, pydot will read 
those.
Although when the graph is rendered, Graphviz will obey the 'strict' directive. 
I feel it's not pydot's work to take on all work of deciding whether the graph 
file adheres to Graphviz's specification.

In this case the rendered end result will be the same.
If you want to obtain a secondary 'dot' file, processed through Graphviz (hence 
will multi-edges and self-arcs removed) you can always run:

g = pydot.pydot.graph_from_dot_file(path_to_file)
processed_dot = g.create(format='dot')

Original comment by ero.carr...@gmail.com on 1 Nov 2010 at 8:29