vector string property maps behaviour with masks
When masking a graph, vector<string>
property maps don't behave as other vector property maps do:
import numpy as np
from graph_tool.all import *
graph = Graph(directed=False)
g_vect_str_prop = graph.new_vertex_property('vector<string>')
g_vect_int_prop = graph.new_vertex_property('vector<int>')
g_mask = graph.new_vertex_property('bool')
v1 = graph.add_vertex()
v2 = graph.add_vertex()
v3 = graph.add_vertex()
graph.add_edge(v1, v2)
graph.add_edge(v2, v3)
g_vect_str_prop[v1] = ['a', 'b', 'c']
g_vect_str_prop[v2] = ['d', 'e', 'f']
g_vect_str_prop[v3] = ['g', 'h', 'i']
g_vect_int_prop[v1] = [1, 2, 3]
g_vect_int_prop[v2] = [4, 5, 6]
g_vect_int_prop[v3] = [7, 8, 9]
g_mask.a = np.array([0, 1, 1])
graph.set_vertex_filter(g_mask)
print(g_vect_str_prop.get_2d_array([0]).shape) # (2,)
print(g_vect_str_prop.get_2d_array([0]).tolist()) # ['d', 'g']
print(g_vect_str_prop.get_2d_array([0, 1]).shape) # (1, 3)
print(g_vect_str_prop.get_2d_array([0, 1]).tolist()) # [['', 'e', 'h']]
print(g_vect_int_prop.get_2d_array([0]).shape) # (1, 2)
print(g_vect_int_prop.get_2d_array([0]).tolist()) # [[4, 7]]
print(g_vect_int_prop.get_2d_array([0, 1]).shape) # (2, 2)
print(g_vect_int_prop.get_2d_array([0, 1]).tolist()) # [[4, 7], [5, 8]]
UPDATE: This only appears to happen with vector<string>
property maps
UPDATE: Added code sample