Ejemplo n.º 1
0
 def test_select_by_node_in_nodes_selection_mode(self):
     graph = Graph(((self.source, self.source+1), self.nodes))
     selection = Graph(([(1, 2)], list(zip(*self.nodes))[1:3]))
     self.assertEqual(graph.select(index=(1, 3), selection_mode='nodes'), selection)
Ejemplo n.º 2
0
 def test_select_by_edge_data(self):
     graph = Graph(((self.target, self.source, self.edge_info),), vdims=['info'])
     selection = Graph(([(0, 0, 0), (0, 1, 1)], list(zip(*self.nodes))[:2]), vdims=['info'])
     self.assertEqual(graph.select(info=(0, 2)), selection)
Ejemplo n.º 3
0
 def test_select_by_node_in_edges_selection_mode(self):
     graph = Graph(((self.source, self.target),))
     selection = Graph(([(1, 0), (2, 0)], list(zip(*self.nodes))[0:3]))
     self.assertEqual(graph.select(index=(1, 3)), selection)
Ejemplo n.º 4
0
 def test_select_by_target(self):
     graph = Graph(((self.source, self.target),))
     selection = Graph(([(0,0), (1, 0)], list(zip(*self.nodes))[:2]))
     self.assertEqual(graph.select(start=(0, 2)), selection)
Ejemplo n.º 5
0
 def test_select_by_source_and_target(self):
     graph = Graph(((self.source, self.source+1), self.nodes))
     selection = Graph(([(0,1)], list(zip(*self.nodes))[:2]))
     self.assertEqual(graph.select(start=(0, 3), end=1), selection)
Ejemplo n.º 6
0
 def test_select_by_edge_data(self):
     graph = Graph(((self.target, self.source, self.edge_info), ),
                   vdims=['info'])
     selection = Graph(([(0, 0, 0), (0, 1, 1)], list(zip(*self.nodes))[:2]),
                       vdims=['info'])
     self.assertEqual(graph.select(info=(0, 2)), selection)
Ejemplo n.º 7
0
 def test_select_by_source_and_target(self):
     graph = Graph(((self.source, self.source + 1), self.nodes))
     selection = Graph(([(0, 1)], list(zip(*self.nodes))[:2]))
     self.assertEqual(graph.select(start=(0, 3), end=1), selection)
Ejemplo n.º 8
0
 def test_select_by_target(self):
     graph = Graph(((self.source, self.target), ))
     selection = Graph(([(0, 0), (1, 0)], list(zip(*self.nodes))[:2]))
     self.assertEqual(graph.select(start=(0, 2)), selection)
Ejemplo n.º 9
0
 def test_select_by_node_in_nodes_selection_mode(self):
     graph = Graph(((self.source, self.source+1), self.nodes))
     selection = Graph(([(1, 2)], list(zip(*self.nodes))[1:3]))
     self.assertEqual(graph.select(index=(1, 3), selection_mode='nodes'), selection)
Ejemplo n.º 10
0
 def test_select_by_node_in_edges_selection_mode(self):
     graph = Graph(((self.source, self.target),))
     selection = Graph(([(1, 0), (2, 0)], list(zip(*self.nodes))[0:3]))
     self.assertEqual(graph.select(index=(1, 3)), selection)