2011/10/11 Giuseppe Profiti <[email protected]> > Hi Tiago, > > 2011/10/11 Tiago de Paula Peixoto <[email protected]> > >> Hi Giuseppe, >> >> On 10/10/2011 11:40 AM, Giuseppe Profiti wrote: >> > Hi, >> > I encountered a strange problem. While saving a graph from a script, the >> generated file is mostly )or completely) composed by "NUL" characters. This >> happens with both dot and xml.gz outputs. >> > The script correclty prints the number of edges and vertices. The >> properties list is also correct and the labels of the vertices are correctly >> stored in memory andd printed on screen. >> > The only output to the file is a huge number of NUL and, in the dot >> case, some of the edges. >> > The error happens after building the graph from a data file (with a >> custom script) and also after loading (in the interactive console) graphs >> previously saved in xml.gz format with graph_tool. >> > I cannot reproduce the error via interactive console creating a graph >> with 2 nodes, 1 edge and no properties. >> > >> > OS is ubuntu and graph_tool version is 2.2.15-1 >> > >> > Everything worked just fine until past week. >> >> In order for me to understand what might be going on, you must provide >> some sort of example of this problem happening. I've never experienced >> anything remotely like this. >> >> Try to reproduce the problem with a short script, and send me the script >> so that I may look at it. It would also be useful to take a look at the >> corrupt data file itself... >> >> > I'll try to create a graph similar to those I'm using, because I cannot > share the actual data (NDA and stuff like that). > It seems to be closely related to my graphs: simple graphs (7 nodes, few > edges) are not affected. > However, just a simple script like that: > > from graph_tool.all import * > g = load_graph('old_graph.xml.gz') > g.save('test.dot') > > generates the error. 'old_graph.xml.gz' was created few days ago on another > machine running graph_tool 2.2.14. The output is attached (I can share that, > it contains almost nothing :-) ) > > I'm trying to pinpoint the type of graph affected by this issue and then > I'll share my results with you. > > I purged all the label attributes, so it has become an "anonymous" graph. This is the trace of the python console: as you can see, nodes, edges and properties are correctly loaded
>>> g = load_graph('my.graph.xml.gz')
>>> g.num_vertices()
153
>>> g.num_edges()
1786
>>> g.list_properties()
L (graph) (type: double, val: 1554100010.16)
C(1) (graph) (type: python::object, val: (0.4511453168253582,
0.018514982664053672))
Cdepth (graph) (type: int32_t, val: 3)
C(2) (graph) (type: double, val: 0.720623810024)
label (graph) (type: string, val: my.graph)
h (vertex) (type: string)
weight (edge) (type: double)
bl (edge) (type: double)
identity (edge) (type: double)
but when I save it, the output is corrupted. Just a side note: I'm running
ubuntu on virtualbox.
Thanks,
Giuseppe
my.graph.xml.gz
Description: GNU Zip compressed data
_______________________________________________ graph-tool mailing list [email protected] http://lists.skewed.de/mailman/listinfo/graph-tool
