Skip to content
This repository was archived by the owner on Nov 19, 2018. It is now read-only.
This repository was archived by the owner on Nov 19, 2018. It is now read-only.

[92] Simplify throws NameError, and, as implemented, doesn't work #29

Open
@prmtl

Description

@prmtl

Reported by TheSoup...@gmail.com, 2014-06-12T04:30:48Z

What steps will reproduce the problem?
  1. invoke set_simplify(true) on a graph
  2. invoke method to_string()
  3. profit
What is the expected output? What do you see instead?

Extraneous edges removed from dot output

What version of the product are you using? On what operating system?

1.0.2

Please provide any additional information below.

This is a patch which both resolves the NameError and enables the desired behavior:

--- /usr/lib/python2.6/site-packages/pydot.py   2014-06-12 06:22:57.000000000 +0400
+++ virtenv/lib/python2.6/site-packages/pydot.py    2014-06-12 06:28:42.515864719 +0400
@@ -1455,11 +1455,11 @@

                 edge = Edge(obj_dict=obj)

-                if self.obj_dict.get('simplify', False) and elm in edges_done:
+                if self.obj_dict.get('simplify', False) and edge.obj_dict['points'] in edges_done:
                     continue
-
+
                 graph.append( edge.to_string() + '\n' )
-                edges_done.add(edge)
+                edges_done.add(edge.obj_dict['points'])

             else:

Attached pydot_simplify.patch (view on Gist)
From: https://code.google.com/p/pydot/issues/detail?id=92

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions