Sebastian Weber | 11 Mar 2011 14:52
Picon
Favicon

bug in graph_draw?

Hey,

I am using the latest graph-tool 2.2.11, and this happens to stop working:

Traceback (most recent call last):
  File "../python/mfptTest.py", line 40, in <module>
    graph_draw(G, layout="sfdp", output=graphName + ".pdf", eprops = {'arrowsize': 1.0, 'penwidth': Ecap })
  File "/Volumes/Data/sebi/.local/lib/python2.6/site-packages/graph_tool/draw/__init__.py",
line 274, in graph_draw
    gvg = gv.graph("G")
NameError: global name 'gv' is not defined

Inspecting the respective file reveals that gv is indeed not defined...

Typo?

Regards,

--

-- 
Sebastian Weber
Group of Cell Communication and Control
Freiburg Institute for Advanced Studies - FRIAS
School of Life Sciences - LIFENET
Albert-Ludwigs-Universität Freiburg
Albertstr. 19
79104 Freiburg
T.: +49-761-203-97237
Fax:+49-761-203-97334
Tiago de Paula Peixoto | 11 Mar 2011 15:03
Picon
Gravatar

Re: bug in graph_draw?

On 03/11/2011 02:52 PM, Sebastian Weber wrote:
> I am using the latest graph-tool 2.2.11, and this happens to stop working:
> 
> Traceback (most recent call last):
>   File "../python/mfptTest.py", line 40, in <module>
>     graph_draw(G, layout="sfdp", output=graphName + ".pdf", eprops = {'arrowsize': 1.0, 'penwidth':
Ecap })
>   File "/Volumes/Data/sebi/.local/lib/python2.6/site-packages/graph_tool/draw/__init__.py",
line 274, in graph_draw
>     gvg = gv.graph("G")
> NameError: global name 'gv' is not defined
> 
> Inspecting the respective file reveals that gv is indeed not defined...
> 
> Typo?

In the module gv are the python bindings for GraphViz. This means they
are somehow not available in your system. Do you have GraphViz installed
with the python bindings enabled? Are they reachable from your python
path?

Cheers,
Tiago

--

-- 
Tiago de Paula Peixoto <tiago <at> skewed.de>

_______________________________________________
(Continue reading)

Sebastian Weber | 11 Mar 2011 15:29
Picon
Favicon

Re: bug in graph_draw?


Hmm, I have the Mac Version of Graphviz installed, but I am affraid there are no Python-bindings included.
Will grab the sources and install it from scratch...

Thanks, that error was not obvious to me...

Am 11.03.2011 um 15:03 schrieb Tiago de Paula Peixoto:

> On 03/11/2011 02:52 PM, Sebastian Weber wrote:
>> I am using the latest graph-tool 2.2.11, and this happens to stop working:
>> 
>> Traceback (most recent call last):
>>  File "../python/mfptTest.py", line 40, in <module>
>>    graph_draw(G, layout="sfdp", output=graphName + ".pdf", eprops = {'arrowsize': 1.0, 'penwidth':
Ecap })
>>  File "/Volumes/Data/sebi/.local/lib/python2.6/site-packages/graph_tool/draw/__init__.py",
line 274, in graph_draw
>>    gvg = gv.graph("G")
>> NameError: global name 'gv' is not defined
>> 
>> Inspecting the respective file reveals that gv is indeed not defined...
>> 
>> Typo?
> 
> In the module gv are the python bindings for GraphViz. This means they
> are somehow not available in your system. Do you have GraphViz installed
> with the python bindings enabled? Are they reachable from your python
> path?
> 
> Cheers,
(Continue reading)

Sebastian Weber | 16 Mar 2011 08:46
Picon
Favicon

parallel processing

Hi!

I am intending to use the Parallel construct from the joblib library which basically runs an embarassingly
parallel for loop via the multiprocessing facility. The error I get is

Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py",
line 522, in __bootstrap_inner
    self.run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py",
line 477, in run
    self.__target(*self.__args, **self.__kwargs)
  File
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/multiprocessing/pool.py",
line 225, in _handle_tasks
    put(task)
RuntimeError: Pickling of "graph_tool.libgraph_tool_core.Vertex" instances is not enabled (http://www.boost.org/libs/python/doc/v2/pickle.html)

I thought graph-tool graphs are compatible with Python pickle-stuff - or do I have to watch out somewhere?

Thanks for the help,

--

-- 
Sebastian Weber
Group of Cell Communication and Control
Freiburg Institute for Advanced Studies - FRIAS
School of Life Sciences - LIFENET
Albert-Ludwigs-Universität Freiburg
Albertstr. 19
79104 Freiburg
(Continue reading)

Tiago de Paula Peixoto | 16 Mar 2011 09:17
Picon
Gravatar

Re: parallel processing

Hi Sebastian,

On 03/16/2011 08:46 AM, Sebastian Weber wrote:
> RuntimeError: Pickling of "graph_tool.libgraph_tool_core.Vertex" instances is not enabled (http://www.boost.org/libs/python/doc/v2/pickle.html)
> 
> I thought graph-tool graphs are compatible with Python pickle-stuff -
> or do I have to watch out somewhere?

You can only pickle Graph objects, not Vertex or Edge objects.
PropertyMaps can only be pickled if they are made "internal" to the
graph, by storing them in the appropriate "*_properties" dictionary of a
Graph object.

If you want to pickle vertex or edges, you have to convert them to ints
or tuple of ints, respectively, and then recover them later with the
Graph.vertex() and Graph.edge() function.

Cheers,
Tiago

--

-- 
Tiago de Paula Peixoto <tiago <at> skewed.de>

_______________________________________________
graph-tool mailing list
graph-tool <at> skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool
(Continue reading)

kapil gupta | 17 Mar 2011 10:50
Picon

Query regarding graph layout in graph-tool

Hi All,

I am very new to graph-tool and looking into its documentation. I've been playing with the F-R algorithm with weighted edges to layout time series data.

I want to know is it possible in graph-tool to nominate a node to be the centre of the graph and have the layout chose the distance of near by nodes to be directly proportional to the strength of the edge weight. The more two nodes correlate, the closer together they are.

Any help is appreciated.

Thanks,
Kapil

PS: If graph-tool is not yet capable of nominating/fixing a particular node, is there any other python graph package which can do so?

--
Kapil Gupta

Phone: +91-9312505395
Alt Email: kapilgupta.iit <at> gmail.com
_______________________________________________
graph-tool mailing list
graph-tool <at> skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool
Tiago de Paula Peixoto | 19 Mar 2011 18:54
Picon
Gravatar

Re: Query regarding graph layout in graph-tool

Hi Kapil,

Sorry for the late reply.

On 03/17/2011 10:50 AM, kapil gupta wrote:
> I want to know is it possible in graph-tool to nominate a node to be
> the centre of the graph and have the layout chose the distance of near
> by nodes to be directly proportional to the strength of the edge
> weight. The more two nodes correlate, the closer together they are.

I'm not sure if I understand precisely what you want, but you can
definitely "pin down" the position of a subset of the vertices, and let
the layout modify only the remaining ones. You can also set a "len" edge
property, which defines the preferred edge length for the layout. Take a
look at the full graphviz options at http://www.graphviz.org/content/attrs

To use these options with graph-tool, you should do something like:

    len = g.new_edge_property("double")
    len.a = 1.0 / weight.a                # your edge weight
    pin = g.new_vertex_property("bool")
    pin[root] = True   # root is the vertex which should be pinned down
    graph_draw(g, eprops={"len": len}, vprops={"pin": pin})

I hope this helps!

Cheers,
Tiago

--

-- 
Tiago de Paula Peixoto <tiago <at> skewed.de>

_______________________________________________
graph-tool mailing list
graph-tool <at> skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool
kapil gupta | 19 Mar 2011 19:01
Picon

Re: Query regarding graph layout in graph-tool

Thanks a lot Tiago, that was helpful :).

On Sat, Mar 19, 2011 at 11:24 PM, Tiago de Paula Peixoto <tiago <at> skewed.de> wrote:
Hi Kapil,

Sorry for the late reply.

On 03/17/2011 10:50 AM, kapil gupta wrote:
> I want to know is it possible in graph-tool to nominate a node to be
> the centre of the graph and have the layout chose the distance of near
> by nodes to be directly proportional to the strength of the edge
> weight. The more two nodes correlate, the closer together they are.

I'm not sure if I understand precisely what you want, but you can
definitely "pin down" the position of a subset of the vertices, and let
the layout modify only the remaining ones. You can also set a "len" edge
property, which defines the preferred edge length for the layout. Take a
look at the full graphviz options at http://www.graphviz.org/content/attrs

To use these options with graph-tool, you should do something like:

   len = g.new_edge_property("double")
   len.a = 1.0 / weight.a                # your edge weight
   pin = g.new_vertex_property("bool")
   pin[root] = True   # root is the vertex which should be pinned down
   graph_draw(g, eprops={"len": len}, vprops={"pin": pin})

I hope this helps!

Cheers,
Tiago

--
Tiago de Paula Peixoto <tiago <at> skewed.de>


_______________________________________________
graph-tool mailing list
graph-tool <at> skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool




--
Kapil Gupta

Phone: +91-9312505395
Alt Email: kapilgupta.iit <at> gmail.com
_______________________________________________
graph-tool mailing list
graph-tool <at> skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool
dd | 21 Mar 2011 19:55
Picon

graph-tool installing and cygwin

Hi to all, 

I'm trying to configure, build and install graph-tool in a windows
environment using CygWin. 
I already successfully installed all the dependencies reported in the
graph-tool website. 

The problem arises while running "configure" script: when it tries to find a
python version it comes to me the following error: 

checking for python... (cached) /cygdrive/c/Program Files/Python27/python 
checking for a version of Python >= '2.1.0'... configure: line 16603:
/cygdrive/ 
c/Program: No such file or directory 
no 
configure: error: in `/cygdrive/c/Program Files/graph-tool-2.2.11': 
configure: error: 
This version of the AC_PYTHON_DEVEL macro 
doesn't work properly with versions of Python before 
2.1.0. You may need to re-run configure, setting the 
variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG, 
PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand. 
Moreover, to disable this check, set PYTHON_NOVERSIONCHECK 
to something else than an empty string. 

See `config.log' for more details 

I guess the problem is with my python root directory, that is "C:\Program
Files\Python27" and contains a blank space, so when the script receives from
the cygwin environment the path "/cygdrive/c/Program Files/Python27" it
searches for "/cygdrive/c/Program" that doesn't exist. 

I don't know if my supposition is correct... in any case, can anybody please
help me to deal with this problem? 

Thanks in advance, 
DD

--
View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/graph-tool-installing-and-cygwin-tp2711252p2711252.html
Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.
Tiago de Paula Peixoto | 22 Mar 2011 16:49
Picon
Gravatar

Re: graph-tool installing and cygwin

Hi DD,

On 03/21/2011 07:55 PM, dd wrote:
> I'm trying to configure, build and install graph-tool in a windows
> environment using CygWin. 
> I already successfully installed all the dependencies reported in the
> graph-tool website. 
> 
> The problem arises while running "configure" script: when it tries to find a
> python version it comes to me the following error: 
> 
> 
> checking for python... (cached) /cygdrive/c/Program Files/Python27/python 
> checking for a version of Python >= '2.1.0'... configure: line 16603:
> /cygdrive/ 
> c/Program: No such file or directory 
> no 

I've been trying to reproduce this error in my system, but I
can't. There seems to be a problem in autoconf from cygwin with escaping
the space character from the path... Could you try the git version, to
see if the same problem happens?

Cheers,
Tiago

--

-- 
Tiago de Paula Peixoto <tiago <at> skewed.de>

_______________________________________________
graph-tool mailing list
graph-tool <at> skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool

Gmane