parallel edges doesn't work, bug?

57 views
Skip to first unread message

ligo...@gmail.com

unread,
Nov 27, 2013, 2:53:12 PM11/27/13
to pygraphvi...@googlegroups.com
I followed:
http://pygraphviz.github.io/documentation/latest/reference/agraph.html
but the sample code only outputs the first edge instead of both on my computer.

environment:
Win7 x64 / Graphviz 2.34 / pygraphviz 1.2 / Python 2.7.6

>>> from pygraphviz import *
>>> G=AGraph(strict=False)
>>> G.add_edge('a','b','first')
>>> G.add_edge('a','b','second')
>>> sorted(G.edges(keys=True))
[(u'a', u'b', u'first')]


Aric Hagberg

unread,
Nov 27, 2013, 3:13:11 PM11/27/13
to pygraphvi...@googlegroups.com
It is supposed to work. On my system (Linux, sorry not Win7 to try)

IIn [1]: import pygraphviz

In [2]: pygraphviz.__version__
Out[2]: '1.2'

In [3]: >>> from pygraphviz import *

In [4]: >>> G=AGraph(strict=False)

In [5]: >>> G.add_edge('a','b','first')

In [6]: >>> G.add_edge('a','b','second')

In [7]: >>> sorted(G.edges(keys=True))
Out[7]: [(u'a', u'b', u'first'), (u'a', u'b', u'second')]


$ dot -V
dot - graphviz version 2.34.0 (20131127.2001)

What happens with
>>> import pygraphviz
>>> pygraphviz.test()

Aric
> --
> You received this message because you are subscribed to the Google Groups
> "pygraphviz-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pygraphviz-disc...@googlegroups.com.
> To post to this group, send email to pygraphvi...@googlegroups.com.
> Visit this group at http://groups.google.com/group/pygraphviz-discuss.
> For more options, visit https://groups.google.com/groups/opt_out.

ligo...@gmail.com

unread,
Nov 27, 2013, 6:08:20 PM11/27/13
to pygraphvi...@googlegroups.com
>>> pygraphviz.test()
FFFF
======================================================================
FAIL: C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\graph.txt
Doctest: graph.txt
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Program Files\Python27\lib\doctest.py", line 2201, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for graph.txt
  File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\graph.txt", line 0

----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\graph.txt", line 47, in graph.txt
Failed example:
    print A    
Expected:
    strict graph test {
    }
    <BLANKLINE>
Got:
    strict digraph test {

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\graph.txt", line 52, in graph.txt
Failed example:
    print A
Expected:
    strict graph {
    }
    <BLANKLINE>
Got:
    strict digraph {

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\graph.txt", line 363, in graph.txt
Failed example:
    A.is_strict()
Expected:
    False
Got:
    True
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\graph.txt", line 371, in graph.txt
Failed example:
    A.edges()
Expected:
    [(u'1', u'2'), (u'1', u'2')]
Got:
    [(u'1', u'2')]
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\graph.txt", line 374, in graph.txt
Failed example:
    A.edges()
Expected:
    [(u'1', u'2'), (u'1', u'2'), (u'3', u'3')]
Got:
    [(u'1', u'2')]
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\graph.txt", line 382, in graph.txt
Failed example:
    A.edges()
Expected:
    [(u'1', u'2'), (u'1', u'2'), (u'3', u'3'), (u'3', u'3')]
Got:
    [(u'1', u'2')]
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\graph.txt", line 384, in graph.txt
Failed example:
    A.edges(keys=True)
Expected:
    [(u'1', u'2', None), (u'1', u'2', None), (u'3', u'3', None), (u'3', u'3', u'foo')]
Got:
    [(u'1', u'2', None)]
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\graph.txt", line 386, in graph.txt
Failed example:
    eone=A.get_edge(3,3,'foo')
Exception raised:
    Traceback (most recent call last):
      File "C:\Program Files\Python27\lib\doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest graph.txt[161]>", line 1, in <module>
        eone=A.get_edge(3,3,'foo')
      File "C:\Program Files\Python27\lib\site-packages\pygraphviz\agraph.py", line 491, in get_edge
        return Edge(self,u,v,key)
      File "C:\Program Files\Python27\lib\site-packages\pygraphviz\agraph.py", line 1601, in __new__
        raise KeyError("Edge %s-%s not in graph."%(source,target))
    KeyError: 'Edge 3-3 not in graph.'
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\graph.txt", line 388, in graph.txt
Failed example:
    edge=Edge(A,3,3,'foo')
Exception raised:
    Traceback (most recent call last):
      File "C:\Program Files\Python27\lib\doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest graph.txt[163]>", line 1, in <module>
        edge=Edge(A,3,3,'foo')
      File "C:\Program Files\Python27\lib\site-packages\pygraphviz\agraph.py", line 1601, in __new__
        raise KeyError("Edge %s-%s not in graph."%(source,target))
    KeyError: 'Edge 3-3 not in graph.'
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\graph.txt", line 391, in graph.txt
Failed example:
    edge
Expected:
    (u'3', u'3')
Got:
    (u'1', u'2')
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\graph.txt", line 393, in graph.txt
Failed example:
    eone
Expected:
    (u'3', u'3')
Got:
    (u'1', u'2')
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\graph.txt", line 395, in graph.txt
Failed example:
    edge.name
Expected:
    u'foo'
Got nothing
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\graph.txt", line 404, in graph.txt
Failed example:
    A.is_undirected()
Expected:
    True
Got:
    False
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\graph.txt", line 409, in graph.txt
Failed example:
    A.has_edge(2,1)
Expected:
    True
Got:
    False
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\graph.txt", line 415, in graph.txt
Failed example:
    sorted([tuple(sorted(e)) for e in A.edges()])
Expected:
    [(u'1', u'2'), (u'1', u'2'), (u'2', u'3'), (u'2', u'3')]
Got:
    [(u'1', u'2'), (u'2', u'3')]
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\graph.txt", line 420, in graph.txt
Failed example:
    A.is_directed()
Expected:
    False
Got:
    True
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\graph.txt", line 502, in graph.txt
Failed example:
    A.string()
Expected:
    u'strict digraph {\n\t1 -> 2;\n\t2 -> 3;\n}\n'
Got:
    u'strict digraph {\r\n\t1 -> 2;\r\n\t2 -> 3;\r\n}\r\n'
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\graph.txt", line 504, in graph.txt
Failed example:
    A.reverse().string()
Expected:
    u'strict digraph {\n\t2 -> 1;\n\t3 -> 2;\n}\n'
Got:
    u'strict digraph {\r\n\t2 -> 1;\r\n\t3 -> 2;\r\n}\r\n'


======================================================================
FAIL: C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\layout_draw.txt
Doctest: layout_draw.txt
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Program Files\Python27\lib\doctest.py", line 2201, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for layout_draw.txt
  File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\layout_draw.txt", line 0

----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\layout_draw.txt", line 11, in layout_draw.txt
Failed example:
    print A
Expected:
    strict graph {
    }
    <BLANKLINE>
Got:
    strict digraph {

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\layout_draw.txt", line 16, in layout_draw.txt
Failed example:
    print A.string().expandtabs()
Expected:
    strict graph {
    }
    <BLANKLINE>
Got:
    strict digraph {

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\layout_draw.txt", line 26, in layout_draw.txt
Failed example:
    print A.string().expandtabs()
Expected:
    strict graph test {
            1 -- 2;
    }
    <BLANKLINE>
Got:
    strict digraph test {

            1 -> 2;

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\layout_draw.txt", line 38, in layout_draw.txt
Failed example:
    print A.string().expandtabs()
Expected:
    strict graph "test graph" {
            1 -- 2;
            2 -- 3;
            3 -- 4;
            4 -- 5;
            5 -- 6;
            6 -- 7;
            7 -- 8;
            8 -- 9;
            9 -- 10;
            11;
    }
    <BLANKLINE>
Got:
    strict digraph "test graph" {

            1 -> 2;

            2 -> 3;

            3 -> 4;

            4 -> 5;

            5 -> 6;

            6 -> 7;

            7 -> 8;

            8 -> 9;

            9 -> 10;

            11;

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\layout_draw.txt", line 94, in layout_draw.txt
Failed example:
    len(d.splitlines())
Expected:
    11
Got:
    19
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\layout_draw.txt", line 105, in layout_draw.txt
Failed example:
    os.unlink(fname)
Exception raised:
    Traceback (most recent call last):
      File "C:\Program Files\Python27\lib\doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest layout_draw.txt[40]>", line 1, in <module>
        os.unlink(fname)
    WindowsError: [Error 32] The process cannot access the file because it is being used by another process: 'c:\\users\\ligon.liu\\appdata\\local\\temp\\tmpjnyip3'


======================================================================
FAIL: C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt
Doctest: attributes.txt
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Program Files\Python27\lib\doctest.py", line 2201, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for attributes.txt
  File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 0

----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 20, in attributes.txt
Failed example:
    print A.string().expandtabs(2)
Expected:
    strict graph {
      graph [label=test,
        spam=eggs
      ];
    }
    <BLANKLINE>
Got:
    strict digraph {

      graph [label=test,

        spam=eggs

      ];

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 29, in attributes.txt
Failed example:
    print A.string().expandtabs(2)
Expected:
    strict graph {
    }
    <BLANKLINE>
Got:
    strict digraph {

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 36, in attributes.txt
Failed example:
    print A.string().expandtabs(2)
Expected:
    strict graph {
    }
    <BLANKLINE>
Got:
    strict digraph {

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 42, in attributes.txt
Failed example:
    print A.string().expandtabs(2)
Expected:
    strict graph {
      graph [pack=true,
        rankdir=LR
      ];
    }
    <BLANKLINE>
Got:
    strict digraph {

      graph [pack=true,

        rankdir=LR

      ];

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 65, in attributes.txt
Failed example:
    print A.string().expandtabs(2)
Expected:
    strict graph {
      node [label=test];
    }
    <BLANKLINE>
Got:
    strict digraph {

      node [label=test];

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 71, in attributes.txt
Failed example:
    print A.string().expandtabs(2)
Expected:
    strict graph {
    }
    <BLANKLINE>
Got:
    strict digraph {

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 78, in attributes.txt
Failed example:
    print A.string().expandtabs(2)
Expected:
    strict graph {
    }
    <BLANKLINE>
Got:
    strict digraph {

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 86, in attributes.txt
Failed example:
    print A.string().expandtabs(2)
Expected:
    strict graph {
      graph [fontname="graph font"];
      node [fontname="node font"];
      edge [fontname="edge font"];
    }
    <BLANKLINE>
Got:
    strict digraph {

      graph [fontname="graph font"];

      node [fontname="node font"];

      edge [fontname="edge font"];

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 109, in attributes.txt
Failed example:
    print A.string().expandtabs(2)
Expected:
    strict graph {
      edge [label=test];
    }
    <BLANKLINE>
Got:
    strict digraph {

      edge [label=test];

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 115, in attributes.txt
Failed example:
    print A.string().expandtabs(2)
Expected:
    strict graph {
    }
    <BLANKLINE>
Got:
    strict digraph {

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 121, in attributes.txt
Failed example:
    print A.string().expandtabs(2)
Expected:
    strict graph {
    }
    <BLANKLINE>
Got:
    strict digraph {

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 131, in attributes.txt
Failed example:
    print A.string().expandtabs(2)
Expected:
    strict graph {
      node [label="\N"];
      1  [label=test,
        spam=eggs];
    }
    <BLANKLINE>
Got:
    strict digraph {

      node [label="\N"];

      1  [label=test,

        spam=eggs];

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 150, in attributes.txt
Failed example:
    print A.string().expandtabs(2)
Expected:
    strict graph {
      node [label="\N"];
      1  [label=test,
        spam=eggs];
    }
    <BLANKLINE>
Got:
    strict digraph {

      node [label="\N"];

      1  [label=test,

        spam=eggs];

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 159, in attributes.txt
Failed example:
    print A.string().expandtabs(2)
Expected:
    strict graph {
      node [label="\N"];
      1  [label=""];
    }
    <BLANKLINE>
Got:
    strict digraph {

      node [label="\N"];

      1  [label=""];

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 167, in attributes.txt
Failed example:
    print A.string().expandtabs(2)
Expected:
    strict graph {
      node [label="\N"];
      1  [label=""];
    }
    <BLANKLINE>
Got:
    strict digraph {

      node [label="\N"];

      1  [label=""];

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 179, in attributes.txt
Failed example:
    print A.string().expandtabs(2)
Expected:
    strict graph {
      1 -- 2   [label=test,
        spam=eggs];
    }
    <BLANKLINE>
Got:
    strict digraph {

      1 -> 2   [label=test,

        spam=eggs];

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 196, in attributes.txt
Failed example:
    print A.string().expandtabs(2)
Expected:
    strict graph {
      1 -- 2   [label=test,
        spam=eggs];
    }
    <BLANKLINE>
Got:
    strict digraph {

      1 -> 2   [label=test,

        spam=eggs];

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 204, in attributes.txt
Failed example:
    print A.string().expandtabs(2)
Expected:
    strict graph {
      1 -- 2;
    }
    <BLANKLINE>
Got:
    strict digraph {

      1 -> 2;

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 211, in attributes.txt
Failed example:
    print A.string().expandtabs(2)
Expected:
    strict graph {
      1 -- 2;
    }
    <BLANKLINE>
Got:
    strict digraph {

      1 -> 2;

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 226, in attributes.txt
Failed example:
    print A.string().expandtabs(2)
Expected:
    graph test {
      a -- b   [label=edge1];
      a -- b   [label=edge2];
    }
    <BLANKLINE>
Got:
    graph test {

      a -- b   [label=edge1];

      a -- b   [label=edge2];

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 240, in attributes.txt
Failed example:
    print G.string().expandtabs(2)
Expected:
    strict graph {
      graph [label=<Hello<BR/>Graph>];
      node [label="\N"];
      {
        graph [label=<Hello<BR/>Subgraph>];
        sa     [label=<Hello<BR/>Subgraph Node b>];
      }
      a  [label=<Hello<BR/>Node>];
      a -- b   [label=<Hello<BR/>Edge>];
    }
    <BLANKLINE>
Got:
    strict digraph {

      graph [label=<Hello<BR/>Graph>];

      node [label="\N"];

      {

        graph [label=<Hello<BR/>Subgraph>];

        sa     [label=<Hello<BR/>Subgraph Node b>];

      }

      a  [label=<Hello<BR/>Node>];

      a -> b   [label=<Hello<BR/>Edge>];

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 260, in attributes.txt
Failed example:
    print G.string().expandtabs(2)
Expected:
    strict graph {
      graph [label=foo];
      {
        graph [label=<Hello<BR/>World>];
        sa;
      }
      a;
    }
    <BLANKLINE>
Got:
    strict digraph {

      graph [label=foo];

      {

        graph [label=<Hello<BR/>World>];

        sa;

      }

      a;

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\attributes.txt", line 275, in attributes.txt
Failed example:
    print G.string().expandtabs(2)
Expected:
    strict graph {
      node [foo=baz];
      subgraph cluster_a {
        graph [foo=bar];
      }
      a;
    }
    <BLANKLINE>
Got:
    strict digraph {

      node [foo=baz];

      subgraph cluster_a {

        graph [foo=bar];

      }

      a;

    }

    <BLANKLINE>


======================================================================
FAIL: C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\unicode.txt
Doctest: unicode.txt
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Program Files\Python27\lib\doctest.py", line 2201, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for unicode.txt
  File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\unicode.txt", line 0

----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\unicode.txt", line 5, in unicode.txt
Failed example:
    print A    
Expected:
    strict graph unicode {
    }
    <BLANKLINE>
Got:
    strict digraph unicode {

    }

    <BLANKLINE>
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\unicode.txt", line 17, in unicode.txt
Failed example:
    unicode(A)
Expected:
    u'strict graph {\n\tgraph [encoding="UTF-8"];\n\t"\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435!";\n}\n'
Got:
    u'strict digraph {\r\n\tgraph [encoding="UTF-8"];\r\n\t"\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435!";\r\n}\r\n'
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\unicode.txt", line 31, in unicode.txt
Failed example:
    e=A.get_edge(hello,hello)
Exception raised:
    Traceback (most recent call last):
      File "C:\Program Files\Python27\lib\doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest unicode.txt[15]>", line 1, in <module>
        e=A.get_edge(hello,hello)
      File "C:\Program Files\Python27\lib\site-packages\pygraphviz\agraph.py", line 491, in get_edge
        return Edge(self,u,v,key)
      File "C:\Program Files\Python27\lib\site-packages\pygraphviz\agraph.py", line 1601, in __new__
        raise KeyError("Edge %s-%s not in graph."%(source,target))
    KeyError: u'Edge \u05e9\u05dc\u05d5\u05dd-\u05e9\u05dc\u05d5\u05dd not in graph.'
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\unicode.txt", line 32, in unicode.txt
Failed example:
    e.name
Exception raised:
    Traceback (most recent call last):
      File "C:\Program Files\Python27\lib\doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest unicode.txt[16]>", line 1, in <module>
        e.name
    NameError: name 'e' is not defined
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\unicode.txt", line 34, in unicode.txt
Failed example:
    e==(hello,hello)
Exception raised:
    Traceback (most recent call last):
      File "C:\Program Files\Python27\lib\doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest unicode.txt[17]>", line 1, in <module>
        e==(hello,hello)
    NameError: name 'e' is not defined
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\unicode.txt", line 36, in unicode.txt
Failed example:
    unicode(A)
Expected:
    u'strict graph {\n\tgraph [encoding="UTF-8"];\n\t\u05e9\u05dc\u05d5\u05dd -- \u05e9\u05dc\u05d5\u05dd [key=1];\n}\n'
Got:
    u'strict digraph {\r\n\tgraph [encoding="UTF-8"];\r\n\t\u05e9\u05dc\u05d5\u05dd;\r\n}\r\n'
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\unicode.txt", line 40, in unicode.txt
Failed example:
    e.attr['hello']=hello
Exception raised:
    Traceback (most recent call last):
      File "C:\Program Files\Python27\lib\doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest unicode.txt[19]>", line 1, in <module>
        e.attr['hello']=hello
    NameError: name 'e' is not defined
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\unicode.txt", line 41, in unicode.txt
Failed example:
    e.attr['hello']==hello
Exception raised:
    Traceback (most recent call last):
      File "C:\Program Files\Python27\lib\doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest unicode.txt[20]>", line 1, in <module>
        e.attr['hello']==hello
    NameError: name 'e' is not defined
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\unicode.txt", line 43, in unicode.txt
Failed example:
    e.attr
Exception raised:
    Traceback (most recent call last):
      File "C:\Program Files\Python27\lib\doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest unicode.txt[21]>", line 1, in <module>
        e.attr
    NameError: name 'e' is not defined
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\unicode.txt", line 55, in unicode.txt
Failed example:
    unicode(G1)
Expected:
    u'strict graph {\n\t\xe6\xb5\x8b\xe8\xaf\x95;\n}\n'
Got:
    u'strict digraph {\r\n\t\xe6\xb5\x8b\xe8\xaf\x95;\r\n}\r\n'
----------------------------------------------------------------------
File "C:\Program Files\Python27\lib\site-packages\pygraphviz\tests\unicode.txt", line 57, in unicode.txt
Failed example:
    unicode(G2)
Expected:
    u'strict graph {\n\t\xe6\xb5\x8b\xe8\xaf\x95;\n}\n'
Got:
    u'strict digraph {\r\n\t\xe6\xb5\x8b\xe8\xaf\x95;\r\n}\r\n'


----------------------------------------------------------------------
Ran 4 tests in 2.006s

FAILED (failures=4)
>>>

Aric Hagberg

unread,
Nov 27, 2013, 6:28:36 PM11/27/13
to pygraphvi...@googlegroups.com
Well, clearly something is wrong with your installation.
I know other people have this working with Windows so maybe they will
chime in with some help. You might try using the latest development
version - we just made a bunch of changes aimed at making PyGraphviz
easier to build on windows https://github.com/pygraphviz/pygraphviz

Aric

Jurryt Pietersma

unread,
Jul 17, 2014, 3:22:38 AM7/17/14
to pygraphvi...@googlegroups.com
I had the same problem (Windows 7, WinPython-32bit-2.7.6.4, graphviz-2.38, pygraphviz-1.2.win32-py2.7)

import pygraphviz as pgv
g=pgv.AGraph(strict=False, directed=True)
g.strict

Out[3]: True

The following lets you work around it:

import pygraphviz as pgv
g=pgv.AGraph(string="digraph  {}")
g.strict

Out[5]: False




Op woensdag 27 november 2013 21:13:11 UTC+1 schreef A Hagberg:
Reply all
Reply to author
Forward
0 new messages