Cannot pickle graph

Hi everyone,

The following code snippet gives me a TypeError and I am wondering if you have any suggestion.

attachment.html (1.45 KB)

graph.save('filename.xml')

attachment.html (1.64 KB)

Hi,

Thanks fro the prompt reply.

I might consider refactoring the code by using the graph.save function.

To that end, if I save a graph in an xml format, with older versions of graph_tool (e.g., 2.32.2) is it still guaranteed that all the property maps will be stored correctly with it? With such an old version I cannot save it in the most new formats.

Thanks a lot!
Helen

attachment.html (3.53 KB)

I'm sure, but can't speak authoritatively. xml is definately what you want
to save it in.

attachment.html (3.49 KB)

This is a bug in graph-tool when used with Python 2 (Python 3 is fine).
It has already been fixed in git a while ago.

Best,
Tiago

Yes, the graphml format is backwards compatible across all versions,

Best,
Tiago

This is true if you want backwards compatibility.

But if you care only about forwards compatibility, you should also
consider the 'gt' binary format, which is much faster than 'xml', and
supports all property maps as well.

Best,
Tiago