Graph I/O & pickle

Hi all,
In general which graph format is fastest when writing/reading graphs? I
am also getting errors when I load pickled and cpickled graphs...That is
something like:

"TypeError: No registered converter was able to produce a C++ rvalue of
type std::string from this Python object of type unicode"

Cheers,

Anatol

In general which graph format is fastest when writing/reading graphs?

I've never benchmarked this extensively, but I do believe that either
graphml or gml should be the fastest.

I am also getting errors when I load pickled and cpickled
graphs...That is something like:

"TypeError: No registered converter was able to produce a C++ rvalue of type std::string from this Python object of type unicode"

I'd need more information, such a very simple script where this
happens... What python version are you using?

Cheers,
Tiago

In general which graph format is fastest when writing/reading graphs?

I've never benchmarked this extensively, but I do believe that either
graphml or gml should be the fastest.

I am also getting errors when I load pickled and cpickled
graphs...That is something like:

"TypeError: No registered converter was able to produce a C++ rvalue of type std::string from this Python object of type unicode"

I'd need more information, such a very simple script where this
happens... What python version are you using?

Cheers,
Tiago

_______________________________________________
graph-tool mailing list
graph-tool(a)skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool

The script:
>>> mt=load_graph('m.xml')
>>> import pickle
>>> f=open('graph','w')
>>> pickle.dump(mt,f)
>>> f.close()
>>> g=open('graph','r')
>>> m=pickle.load(g)
Traceback (most recent call last):
   File "<pyshell#11>", line 1, in <module>
     m=pickle.load(g)
   File "/usr/lib/python2.7/pickle.py", line 1378, in load
     return Unpickler(file).load()
   File "/usr/lib/python2.7/pickle.py", line 858, in load
     dispatch[key](self)
   File "/usr/lib/python2.7/pickle.py", line 1217, in load_build
     setstate(state)
   File "/usr/lib/python2.7/dist-packages/graph_tool/__init__.py", line
1789, in __setstate__
     self.load(stream, "xml")
   File "/usr/lib/python2.7/dist-packages/graph_tool/__init__.py", line
1518, in load
     props = self.__graph.ReadFromFile("", file_name, fmt)
TypeError: No registered converter was able to produce a C++ rvalue of
type std::string from this Python object of type unicode
>>>

thanks for the fast reply

Anatol

attachment.html (2.9 KB)

Ok, this looks like a bug. It works fine in Python 3, but I cannot test
with Python 2.7 right now. Could you please put this in a ticket in the
website, so that I don't forget to fix it?

Cheers,
Tiago

Ok, thanks.

attachment.html (2.47 KB)

This has been fixed now in the git version...

Cheers,
Tiago