On 22.04.2015 10:54, François wrote:
Hello,
I realize that my C++ skill aren't sufficient to produce quality / maintainable / efficient code for this feature. Would you take care of this ?
I've update my github repo <https://github.com/Fkawala/gcloud-python>, it compiles but does not work.
The current error stack is:
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/dist-packages/graph_tool/topology/__init__.py", line 1337, in shortest_path pred_map=True)[1] File "/usr/lib/python2.7/dist-packages/graph_tool/topology/__init__.py", line 1263, in shortest_distance dist_map = dist_map[target] File "/usr/lib/python2.7/dist-packages/graph_tool/__init__.py", line 438, in __getitem__ return self.__map[self.__key_trans(k)] Boost.Python.ArgumentError: Python argument types in VertexPropertyMap<int32_t>.__getitem__(VertexPropertyMap<int32_t>, tuple) did not match C++ signature: __getitem__(graph_tool::PythonPropertyMap<boost::checked_vector_property_map<int, boost::typed_identity_property_map<unsigned long> > > {lvalue}, graph_tool::PythonVertex)
This is not really a C++ thing, you are trying to access a vertex property map with a tuple, instead of a vertex object. This tuple is probably your list of targets. You need only to update line 1259 in topology/__init__.py and exclude the case when 'target' is an iterable. For instance: if source is not None and target != -1: try: dist_map = [dist_map[t] for t in target] except TypeError: dist_map = dist_map[target] It seems you are almost there! Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>