ug = gt.graph_union(g,u,intersection=u.vertex_index,internal_props=True)
#reclaim the lost labels...
ug.vp["copied_label"]=label #or similarly, ug.copy_property(src=g.vp.label,tgt=ug.vp.label)
#ValueError: Received property map for graph <Graph object, undirected, with 77 vertices
and 255 edges, 2 internal vertex properties, 1 internal edge property, 2 internal graph properties, at 0x152bc7410> (base: <Graph object, undirected, with 77 vertices and 255 edges, 2 internal vertex properties, 1 internal edge property, 2 internal graph properties,
at 0x152bc7410>), expected: <Graph object, undirected, with 77 vertices and 447 edges, 2 internal vertex properties, 3 internal edge properties, 3 internal graph properties, at 0x153ebb890> (base: <Graph object, undirected, with 77 vertices and 447 edges,
2 internal vertex properties, 3 internal edge properties, 3 internal graph properties, at 0x153ebb890>)
#naturally, collecting the eprob will cause the same error:
Could you kindly provide a working example to the advised solution?
Am 15.06.20 um 14:20 schrieb James Ruffle:
It seemed reasonable that one might want to review the results of a MixedMeasuredBlockState with respect to the original graph. For instance, perhaps I have certain vertex or edge properties within my original graph object I
want to review for association to this model's collected eprobs. Another example, perhaps I want to run both the Measured and MixedMeasured and compare/contrast the eprobs from the marginals stored as separate edge properties on the graph. Is there a way to
marry up these results of the MixedMeasuredBlockState eprob back to the original graph?
There are many ways to do this, I was just asking you to be more
specific about what you wanted to accomplish.
Unless intuitive syntax within GraphTool I am not aware of, I suppose it would be a case of pulling out the edge list from the original and the model, then taking the union of that.
To take the union of all edges between two graphs, you can use the
graph_union(g1, g2) function, while passing the 'intersection' parameter
with the Graph.vertex_index property map of g2 (to avoid the nodes being
duplicated). This will create parallel edges for those that appear in
both graphs, which you can remove with remove_parallel_edges(). You can
then copy any edge property map from either g1 or g2 by calling
Graph.copy_property() on the union graph.
Tiago de Paula Peixoto <email@example.com
graph-tool mailing list