@@ -37,7 +37,7 @@ def test_plot_simple_graph(self):
3737 plot = mpl_renderer .get_plot (self .graph )
3838 nodes = plot .handles ['nodes' ]
3939 edges = plot .handles ['edges' ]
40- self .assertEqual (nodes .get_offsets (), self .graph .nodes .array ([0 , 1 ]))
40+ self .assertEqual (np . asarray ( nodes .get_offsets () ), self .graph .nodes .array ([0 , 1 ]))
4141 self .assertEqual ([p .vertices for p in edges .get_paths ()],
4242 [p .array () for p in self .graph .edgepaths .split ()])
4343
@@ -59,7 +59,7 @@ def test_plot_graph_numerically_colored_nodes(self):
5959 g = self .graph3 .opts (plot = dict (color_index = 'Weight' ), style = dict (cmap = 'viridis' ))
6060 plot = mpl_renderer .get_plot (g )
6161 nodes = plot .handles ['nodes' ]
62- self .assertEqual (nodes .get_array (), self .weights )
62+ self .assertEqual (np . asarray ( nodes .get_array () ), self .weights )
6363 self .assertEqual (nodes .get_clim (), (self .weights .min (), self .weights .max ()))
6464
6565 def test_plot_graph_categorical_colored_edges (self ):
@@ -123,7 +123,7 @@ def test_graph_op_node_color_linear(self):
123123 graph = Graph ((edges , nodes )).options (node_color = 'color' )
124124 plot = mpl_renderer .get_plot (graph )
125125 artist = plot .handles ['nodes' ]
126- self .assertEqual (artist .get_array (), np .array ([0.5 , 1.5 , 2.5 ]))
126+ self .assertEqual (np . asarray ( artist .get_array () ), np .array ([0.5 , 1.5 , 2.5 ]))
127127 self .assertEqual (artist .get_clim (), (0.5 , 2.5 ))
128128
129129 def test_graph_op_node_color_linear_update (self ):
@@ -150,7 +150,7 @@ def test_graph_op_node_color_categorical(self):
150150 graph = Graph ((edges , nodes )).options (node_color = 'color' )
151151 plot = mpl_renderer .get_plot (graph )
152152 artist = plot .handles ['nodes' ]
153- self .assertEqual (artist .get_array (), np .array ([0 , 1 , 0 ]))
153+ self .assertEqual (np . asarray ( artist .get_array () ), np .array ([0 , 1 , 0 ]))
154154
155155 def test_graph_op_node_size (self ):
156156 edges = [(0 , 1 ), (0 , 2 )]
@@ -306,7 +306,7 @@ def test_plot_simple_trimesh(self):
306306 nodes = plot .handles ['nodes' ]
307307 edges = plot .handles ['edges' ]
308308 self .assertIsInstance (edges , LineCollection )
309- self .assertEqual (nodes .get_offsets (), self .trimesh .nodes .array ([0 , 1 ]))
309+ self .assertEqual (np . asarray ( nodes .get_offsets () ), self .trimesh .nodes .array ([0 , 1 ]))
310310 self .assertEqual ([p .vertices for p in edges .get_paths ()],
311311 [p .array () for p in self .trimesh ._split_edgepaths .split ()])
312312
@@ -315,7 +315,7 @@ def test_plot_simple_trimesh_filled(self):
315315 nodes = plot .handles ['nodes' ]
316316 edges = plot .handles ['edges' ]
317317 self .assertIsInstance (edges , PolyCollection )
318- self .assertEqual (nodes .get_offsets (), self .trimesh .nodes .array ([0 , 1 ]))
318+ self .assertEqual (np . asarray ( nodes .get_offsets () ), self .trimesh .nodes .array ([0 , 1 ]))
319319 paths = self .trimesh ._split_edgepaths .split (datatype = 'array' )
320320 self .assertEqual ([p .vertices [:4 ] for p in edges .get_paths ()],
321321 paths )
@@ -364,7 +364,7 @@ def test_trimesh_op_node_color_linear(self):
364364 trimesh = TriMesh ((edges , Nodes (nodes , vdims = 'color' ))).options (node_color = 'color' )
365365 plot = mpl_renderer .get_plot (trimesh )
366366 artist = plot .handles ['nodes' ]
367- self .assertEqual (artist .get_array (), np .array ([2 , 1 , 3 , 4 ]))
367+ self .assertEqual (np . asarray ( artist .get_array () ), np .array ([2 , 1 , 3 , 4 ]))
368368 self .assertEqual (artist .get_clim (), (1 , 4 ))
369369
370370 def test_trimesh_op_node_color_categorical (self ):
@@ -373,7 +373,7 @@ def test_trimesh_op_node_color_categorical(self):
373373 trimesh = TriMesh ((edges , Nodes (nodes , vdims = 'color' ))).options (node_color = 'color' )
374374 plot = mpl_renderer .get_plot (trimesh )
375375 artist = plot .handles ['nodes' ]
376- self .assertEqual (artist .get_array (), np .array ([0 , 1 , 2 , 0 ]))
376+ self .assertEqual (np . asarray ( artist .get_array () ), np .array ([0 , 1 , 2 , 0 ]))
377377 self .assertEqual (artist .get_clim (), (0 , 2 ))
378378
379379 def test_trimesh_op_node_size (self ):
@@ -494,7 +494,7 @@ def test_chord_node_color_style_mapping(self):
494494 plot = mpl_renderer .get_plot (g )
495495 arcs = plot .handles ['arcs' ]
496496 nodes = plot .handles ['nodes' ]
497- self .assertEqual (nodes .get_array (), np .array ([0 , 1 , 2 ]))
497+ self .assertEqual (np . asarray ( nodes .get_array () ), np .array ([0 , 1 , 2 ]))
498498 self .assertEqual (arcs .get_array (), np .array ([0 , 1 , 2 ]))
499499 self .assertEqual (nodes .get_clim (), (0 , 2 ))
500500 self .assertEqual (arcs .get_clim (), (0 , 2 ))
0 commit comments