Thanks.
I presume that the block model could be picked because it contains a whole graph, not 'naked' vertices?

Get Outlook for Android


From: graph-tool <graph-tool-bounces@skewed.de> on behalf of Tiago de Paula Peixoto <tiago@skewed.de>
Sent: Wednesday, June 26, 2019 10:37:02 PM
To: Main discussion list for the graph-tool project
Subject: Re: [graph-tool] a RuntimeError I don't understand
 
Am 26.06.19 um 05:27 schrieb JeanPierre Paillet:
> Hello Tiago:
> While attempting to save a binary structure I encountered this error
> RuntimeError: Pickling of "graph_tool.libgraph_tool_core.Vertex" instances
> is not enabled (http://www.boost.org/libs/python/doc/v2/pickle.html)
>
> I don't understand why I was able to pickle.dump a stochastic block model
> (which contains vertices) and not this structure which contains a list of
> vertices.

Vertex and Edge descriptor objects are supposed to be lightweight, and they
contain only a C++ pointer to the specific graph view to which they refer.
This means that they cannot be pickled, as the parent Graph (Python) object
cannot be resolved.

If you want to pickle Vertex objects, you should convert them to ints first.

Best,
Tiago

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