1
- # Copyright (c) 2020-2024 , NVIDIA CORPORATION.
1
+ # Copyright (c) 2020-2025 , NVIDIA CORPORATION.
2
2
# Licensed under the Apache License, Version 2.0 (the "License");
3
3
# you may not use this file except in compliance with the License.
4
4
# You may obtain a copy of the License at
@@ -63,6 +63,7 @@ def test_multigraph(graph_file):
63
63
@pytest .mark .parametrize ("graph_file" , DEFAULT_DATASETS )
64
64
def test_Graph_from_MultiGraph (graph_file ):
65
65
# FIXME: Migrate to new test fixtures for Graph setup once available
66
+ # Test undirected Multigraph
66
67
GM = graph_file .get_graph (create_using = cugraph .MultiGraph ())
67
68
dataset_path = graph_file .get_path ()
68
69
nxM = utils .read_csv_for_nx (dataset_path , read_weights_in_sp = True )
@@ -76,7 +77,9 @@ def test_Graph_from_MultiGraph(graph_file):
76
77
77
78
G = cugraph .Graph (GM )
78
79
Gnx = nx .Graph (GnxM )
79
- assert Gnx .number_of_edges () == G .number_of_edges (directed_edges = True )
80
+ assert Gnx .number_of_edges () == G .number_of_edges (directed_edges = False )
81
+
82
+ # Test directed Multigraph
80
83
GdM = graph_file .get_graph (create_using = cugraph .MultiGraph (directed = True ))
81
84
GnxdM = nx .from_pandas_edgelist (
82
85
nxM ,
@@ -87,7 +90,7 @@ def test_Graph_from_MultiGraph(graph_file):
87
90
)
88
91
Gd = cugraph .Graph (GdM , directed = True )
89
92
Gnxd = nx .DiGraph (GnxdM )
90
- assert Gnxd .number_of_edges () == Gd .number_of_edges ()
93
+ assert Gnxd .number_of_edges () == Gd .number_of_edges (directed_edges = True )
91
94
92
95
93
96
@pytest .mark .sg
0 commit comments