graph_attr occasionally fails to update after calling layout

26 views
Skip to first unread message

Andrew

unread,
Apr 11, 2016, 11:51:58 AM4/11/16
to pygraphviz-discuss
I am using pygraphviz to set the layout and then I am grabbing some of the data and using elsewhere. I've noticed that after calling `A.layout(layout, args='-Goverlap=prism')` sometimes `A.graph_attr` will be an empty dict. About 4/5 times this is not a problem. I am trying to grab the bounding box (bb). I have no idea what may be causing my problem. Thanks for any help. I hope this list is still active. Has something replaced pygraphviz?

Aric Hagberg

unread,
Apr 11, 2016, 11:58:06 AM4/11/16
to pygraphvi...@googlegroups.com
That could be a bug.  But it will be pretty hard to track down if we can't reproduce it.   Can you give any more information on the cases when it doesn't work.  What version of pygraphviz and graphviz are you using?

Aric

On Mon, Apr 11, 2016 at 9:51 AM Andrew <andrew...@gmail.com> wrote:
I am using pygraphviz to set the layout and then I am grabbing some of the data and using elsewhere. I've noticed that after calling `A.layout(layout, args='-Goverlap=prism')` sometimes `A.graph_attr` will be an empty dict. About 4/5 times this is not a problem. I am trying to grab the bounding box (bb). I have no idea what may be causing my problem. Thanks for any help. I hope this list is still active. Has something replaced pygraphviz?

--
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 https://groups.google.com/group/pygraphviz-discuss.
For more options, visit https://groups.google.com/d/optout.

Andrew

unread,
Apr 15, 2016, 8:54:40 AM4/15/16
to pygraphviz-discuss
Sorry for the delay. I created a quick test this morning and could not reproduce the problem with just pygraphviz. I was using graph_tool to save a .dot which pygraphviz then opened. That may be the source of my problem. I'll take a better look. If pygraphviz does anything unpredictable, I'll report back.

Andrew

unread,
Apr 15, 2016, 11:47:28 AM4/15/16
to pygraphviz-discuss
Well it appears that calling graph_tool.Graph.save("file.dot") will occasionally create an issue. Interestingly it does not matter whether I read (with pygraphviz) the file graph_tool saves or another dot. Initially I thought pygraphviz was opening an incomplete file. I know I use graph_tool so the issue may not be of much concern, but I've attached an example. The error will only happen occasionally. The error is: KeyError: 'agattr: no key'.

I also forgot to mention in my previous response that I am using pygraphviz 1.3.1 with graphviz 2.38.0
errorExample.py
temp.dot
Reply all
Reply to author
Forward
0 new messages