return_maps not working in clustering.motifs
I am trying to return the maps of the motifs to identify the vertex on the original graph but this exception rises:
Exception Traceback (most recent call last)
<ipython-input-292-1c9ba08feccd> in <module>
----> 1 motifs, counts = graph_tool.clustering.motifs(g,3,return_maps=True)
2 motifs
/usr/lib/python3/dist-packages/graph_tool_hack/graph_tool/clustering/__init__.py in motifs(g, k, p, motif_list, return_maps)
416 for i, vlist in enumerate(vertex_maps):
417 sub = sub_list[i]
--> 418 vertex_maps[i] = [PropertyMap(vm, sub, "v") for vm in vlist]
419 return sub_list, hist, vertex_maps
420 return sub_list, hist
/usr/lib/python3/dist-packages/graph_tool_hack/graph_tool/clustering/__init__.py in <listcomp>(.0)
416 for i, vlist in enumerate(vertex_maps):
417 sub = sub_list[i]
--> 418 vertex_maps[i] = [PropertyMap(vm, sub, "v") for vm in vlist]
419 return sub_list, hist, vertex_maps
420 return sub_list, hist
/usr/lib/python3/dist-packages/graph_tool_hack/graph_tool/__init__.py in __init__(self, pmap, g, key_type)
388 def __init__(self, pmap, g, key_type):
389 if type(self) == PropertyMap:
--> 390 raise Exception("PropertyMap cannot be instantiated directly")
391 self.__map = pmap
392 self.__g = weakref.ref(g)
Exception: PropertyMap cannot be instantiated directly
My code is simply :
motifs, counts = graph_tool.clustering.motifs(g,3,return_maps=True)
(g has vertex properties)