@@ -459,7 +459,7 @@ def test_view_edge_list_for_nxGraph(directed):
459
459
G = nx .florentine_families_graph ()
460
460
df = nx .to_pandas_edgelist (G )
461
461
cG = cugraph .Graph (directed = directed )
462
- cG .from_pandas_edgelist (df , source = ' source' , destination = ' target' )
462
+ cG .from_pandas_edgelist (df , source = " source" , destination = " target" )
463
463
464
464
assert df .shape == cG .view_edge_list ().shape
465
465
@@ -621,26 +621,25 @@ def test_number_of_vertices(graph_file):
621
621
def test_number_of_edges ():
622
622
623
623
# cycle edges
624
- cycle_edges = [
625
- (0 , 1 , 1.0 ),
626
- (1 , 2 , 1.0 ),
627
- (2 , 3 , 1.0 ),
628
- (3 , 0 , 1.0 )
629
- ]
624
+ cycle_edges = [(0 , 1 , 1.0 ), (1 , 2 , 1.0 ), (2 , 3 , 1.0 ), (3 , 0 , 1.0 )]
630
625
631
626
# Create pandas DataFrame
632
- df = pd .DataFrame (cycle_edges , columns = [' source' , ' destination' , ' weight' ])
633
-
627
+ df = pd .DataFrame (cycle_edges , columns = [" source" , " destination" , " weight" ])
628
+
634
629
# Convert to cuDF
635
630
cudf_edges = cudf .DataFrame .from_pandas (df )
636
-
631
+
637
632
# Create directed graph
638
633
G_directed = cugraph .Graph (directed = True )
639
- G_directed .from_cudf_edgelist (cudf_edges , source = 'source' , destination = 'destination' , edge_attr = 'weight' )
640
-
634
+ G_directed .from_cudf_edgelist (
635
+ cudf_edges , source = "source" , destination = "destination" , edge_attr = "weight"
636
+ )
637
+
641
638
# Create undirected graph
642
639
G_undirected = cugraph .Graph (directed = False )
643
- G_undirected .from_cudf_edgelist (cudf_edges , source = 'source' , destination = 'destination' , edge_attr = 'weight' )
640
+ G_undirected .from_cudf_edgelist (
641
+ cudf_edges , source = "source" , destination = "destination" , edge_attr = "weight"
642
+ )
644
643
645
644
assert G_directed .number_of_edges () == G_undirected .number_of_edges ()
646
645
0 commit comments