diff --git a/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py b/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py index ac1f48dc6e8..ff24024ef0c 100644 --- a/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py @@ -14,16 +14,15 @@ import gc import pytest - -import cugraph -from cugraph.datasets import karate_disjoint -from cugraph.testing import utils, SMALL_DATASETS import random import numpy as np +import networkx as nx + import cudf import cupy - -import networkx as nx +import cugraph +from cugraph.datasets import karate_disjoint +from cugraph.testing import utils, SMALL_DATASETS # ============================================================================= diff --git a/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality_mg.py b/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality_mg.py index e36e50c91aa..930f80c1bfa 100644 --- a/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality_mg.py +++ b/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality_mg.py @@ -11,16 +11,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cugraph.dask as dcg import gc + import pytest -import cugraph + import dask_cudf import cupy import cudf - - -# from cugraph.dask.common.mg_utils import is_single_gpu +import cugraph +import cugraph.dask as dcg from cugraph.testing import utils from pylibcugraph.testing import gen_fixture_params_product diff --git a/python/cugraph/cugraph/tests/centrality/test_degree_centrality.py b/python/cugraph/cugraph/tests/centrality/test_degree_centrality.py index dda35c9f0eb..921b419c3ae 100644 --- a/python/cugraph/cugraph/tests/centrality/test_degree_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_degree_centrality.py @@ -14,13 +14,12 @@ import gc import pytest +import networkx as nx import cudf import cugraph from cugraph.testing import utils, UNDIRECTED_DATASETS -import networkx as nx - # ============================================================================= # Pytest Setup / Teardown - called for each test function diff --git a/python/cugraph/cugraph/tests/centrality/test_degree_centrality_mg.py b/python/cugraph/cugraph/tests/centrality/test_degree_centrality_mg.py index ba49a131d91..a46f4b9463b 100644 --- a/python/cugraph/cugraph/tests/centrality/test_degree_centrality_mg.py +++ b/python/cugraph/cugraph/tests/centrality/test_degree_centrality_mg.py @@ -12,14 +12,15 @@ # limitations under the License. import gc + import pytest + import cudf import dask_cudf -from cudf.testing import assert_series_equal - import cugraph from cugraph.dask.common.mg_utils import is_single_gpu from cugraph.testing.utils import RAPIDS_DATASET_ROOT_DIR_PATH +from cudf.testing import assert_series_equal # ============================================================================= # Pytest Setup / Teardown - called for each test function diff --git a/python/cugraph/cugraph/tests/centrality/test_edge_betweenness_centrality.py b/python/cugraph/cugraph/tests/centrality/test_edge_betweenness_centrality.py index f1abaa7ea9d..81d02e77e4f 100644 --- a/python/cugraph/cugraph/tests/centrality/test_edge_betweenness_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_edge_betweenness_centrality.py @@ -14,25 +14,16 @@ import gc import pytest - -import cugraph -from cugraph.datasets import karate_disjoint -from cugraph.testing import utils, SMALL_DATASETS import random +import networkx as nx import numpy as np + import cupy import cudf +import cugraph +from cugraph.datasets import karate_disjoint +from cugraph.testing import utils, SMALL_DATASETS -# Temporarily suppress warnings till networkX fixes deprecation warnings -# (Using or importing the ABCs from 'collections' instead of from -# 'collections.abc' is deprecated, and in 3.8 it will stop working) for -# python 3.7. Also, this import networkx needs to be relocated in the -# third-party group once this gets fixed. -import warnings - -with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - import networkx as nx # NOTE: Endpoint parameter is not currently being tested, there could be a test # to verify that python raise an error if it is used diff --git a/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py b/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py index 38af1e20061..62e996e50ad 100644 --- a/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py @@ -14,12 +14,12 @@ import gc import pytest +import networkx as nx import cugraph from cugraph.testing import utils, UNDIRECTED_DATASETS, DEFAULT_DATASETS from cugraph.datasets import toy_graph, karate -import networkx as nx # This toy graph is used in multiple tests throughout libcugraph_c and pylib. TOY = toy_graph diff --git a/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality_mg.py b/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality_mg.py index 220b275e4c2..cf5f0eabcef 100644 --- a/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality_mg.py +++ b/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality_mg.py @@ -11,13 +11,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -# import numpy as np -import pytest -import cugraph.dask as dcg import gc -import cugraph -import dask_cudf + +import pytest + import cudf +import dask_cudf +import cugraph +import cugraph.dask as dcg from cugraph.dask.common.mg_utils import is_single_gpu from cugraph.testing.utils import DEFAULT_DATASETS diff --git a/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py b/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py index 3befff8643d..e9477dc0aca 100644 --- a/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py @@ -14,6 +14,7 @@ import gc import pytest +import networkx as nx import cudf import cugraph @@ -24,16 +25,6 @@ ) from cugraph.datasets import toy_graph_undirected, karate -# Temporarily suppress warnings till networkX fixes deprecation warnings -# (Using or importing the ABCs from 'collections' instead of from -# 'collections.abc' is deprecated, and in 3.8 it will stop working) for -# python 3.7. Also, this import networkx needs to be relocated in the -# third-party group once this gets fixed. -import warnings - -with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - import networkx as nx # This toy graph is used in multiple tests throughout libcugraph_c and pylib. TOY = toy_graph_undirected diff --git a/python/cugraph/cugraph/tests/centrality/test_katz_centrality_mg.py b/python/cugraph/cugraph/tests/centrality/test_katz_centrality_mg.py index 9a6ee2d2668..1dcbcbae3cd 100644 --- a/python/cugraph/cugraph/tests/centrality/test_katz_centrality_mg.py +++ b/python/cugraph/cugraph/tests/centrality/test_katz_centrality_mg.py @@ -11,13 +11,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -# import numpy as np -import pytest -import cugraph.dask as dcg import gc -import cugraph -import dask_cudf + +import pytest + import cudf +import dask_cudf +import cugraph +import cugraph.dask as dcg from cugraph.dask.common.mg_utils import is_single_gpu from cugraph.testing.utils import RAPIDS_DATASET_ROOT_DIR_PATH diff --git a/python/cugraph/cugraph/tests/comms/test_comms_mg.py b/python/cugraph/cugraph/tests/comms/test_comms_mg.py index cebb97923ee..d4b33641c1a 100644 --- a/python/cugraph/cugraph/tests/comms/test_comms_mg.py +++ b/python/cugraph/cugraph/tests/comms/test_comms_mg.py @@ -11,16 +11,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +import gc + import pytest import cugraph.dask as dcg -import gc -# import pytest -import cugraph -import dask_cudf import cudf - -# from cugraph.dask.common.mg_utils import is_single_gpu +import dask_cudf +import cugraph from cugraph.testing.utils import RAPIDS_DATASET_ROOT_DIR_PATH # ============================================================================= diff --git a/python/cugraph/cugraph/tests/community/test_balanced_cut.py b/python/cugraph/cugraph/tests/community/test_balanced_cut.py index 4049b9d0eb9..0a95a1846ce 100644 --- a/python/cugraph/cugraph/tests/community/test_balanced_cut.py +++ b/python/cugraph/cugraph/tests/community/test_balanced_cut.py @@ -12,11 +12,12 @@ # limitations under the License. import gc -import random +import random import pytest import networkx as nx import pandas as pd + import cudf import cugraph from cugraph.testing import DEFAULT_DATASETS diff --git a/python/cugraph/cugraph/tests/community/test_ecg.py b/python/cugraph/cugraph/tests/community/test_ecg.py index 95c7cd763b8..4440973df83 100644 --- a/python/cugraph/cugraph/tests/community/test_ecg.py +++ b/python/cugraph/cugraph/tests/community/test_ecg.py @@ -12,16 +12,15 @@ # limitations under the License. import gc +from pathlib import PurePath import pytest import networkx as nx -import cugraph +import cugraph from cugraph.testing import utils from cugraph.datasets import karate, dolphins, netscience -from pathlib import PurePath - def cugraph_call(G, min_weight, ensemble_size): df = cugraph.ecg(G, min_weight, ensemble_size) diff --git a/python/cugraph/cugraph/tests/community/test_induced_subgraph_mg.py b/python/cugraph/cugraph/tests/community/test_induced_subgraph_mg.py index 34cbf73aae6..3a6a6e0d409 100644 --- a/python/cugraph/cugraph/tests/community/test_induced_subgraph_mg.py +++ b/python/cugraph/cugraph/tests/community/test_induced_subgraph_mg.py @@ -12,17 +12,17 @@ # limitations under the License. import gc + import pytest -import dask_cudf +import cudf from cudf.testing.testing import assert_frame_equal -from pylibcugraph.testing import gen_fixture_params_product - +import dask_cudf import cugraph import cugraph.dask as dcg from cugraph.testing import utils from cugraph.dask.common.mg_utils import is_single_gpu -import cudf +from pylibcugraph.testing import gen_fixture_params_product # ============================================================================= diff --git a/python/cugraph/cugraph/tests/community/test_k_truss_subgraph.py b/python/cugraph/cugraph/tests/community/test_k_truss_subgraph.py index 72b504dc6b7..552702acf46 100644 --- a/python/cugraph/cugraph/tests/community/test_k_truss_subgraph.py +++ b/python/cugraph/cugraph/tests/community/test_k_truss_subgraph.py @@ -14,26 +14,14 @@ import gc import pytest - +import networkx as nx import numpy as np -from numba import cuda import cugraph from cugraph.testing import utils from cugraph.datasets import polbooks, ktruss_polbooks, karate_asymmetric +from numba import cuda -# Temporarily suppress warnings till networkX fixes deprecation warnings -# (Using or importing the ABCs from 'collections' instead of from -# 'collections.abc' is deprecated, and in 3.8 it will stop working) for -# python 3.7. Also, this import networkx needs to be relocated in the -# third-party group once this gets fixed. -import warnings - -with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - import networkx as nx - -print("Networkx version : {} ".format(nx.__version__)) DATASETS_KTRUSS = [(polbooks, ktruss_polbooks)] diff --git a/python/cugraph/cugraph/tests/community/test_leiden.py b/python/cugraph/cugraph/tests/community/test_leiden.py index ef312d36159..a06b0dd22c5 100644 --- a/python/cugraph/cugraph/tests/community/test_leiden.py +++ b/python/cugraph/cugraph/tests/community/test_leiden.py @@ -15,8 +15,8 @@ import time import pytest - import networkx as nx + import cugraph import cudf from cugraph.testing import utils, UNDIRECTED_DATASETS diff --git a/python/cugraph/cugraph/tests/community/test_leiden_mg.py b/python/cugraph/cugraph/tests/community/test_leiden_mg.py index e76696e5769..69fccdae260 100644 --- a/python/cugraph/cugraph/tests/community/test_leiden_mg.py +++ b/python/cugraph/cugraph/tests/community/test_leiden_mg.py @@ -13,13 +13,12 @@ import pytest -import cugraph.dask as dcg -import cugraph import dask_cudf +import cugraph +import cugraph.dask as dcg from cugraph.testing import utils -# from cugraph.dask.common.mg_utils import is_single_gpu try: from rapids_pytest_benchmark import setFixtureParamNames diff --git a/python/cugraph/cugraph/tests/community/test_louvain.py b/python/cugraph/cugraph/tests/community/test_louvain.py index 7b8347bc5e2..183be071a44 100644 --- a/python/cugraph/cugraph/tests/community/test_louvain.py +++ b/python/cugraph/cugraph/tests/community/test_louvain.py @@ -12,9 +12,10 @@ # limitations under the License. import gc -import time +import time import pytest +import networkx as nx import cugraph import cupyx @@ -22,16 +23,6 @@ from cugraph.testing import utils, UNDIRECTED_DATASETS from cugraph.datasets import karate_asymmetric -# Temporarily suppress warnings till networkX fixes deprecation warnings -# (Using or importing the ABCs from 'collections' instead of from -# 'collections.abc' is deprecated, and in 3.8 it will stop working) for -# python 3.7. Also, these import community and import networkx need to be -# relocated in the third-party group once this gets fixed. -import warnings - -with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - import networkx as nx try: import community diff --git a/python/cugraph/cugraph/tests/community/test_louvain_mg.py b/python/cugraph/cugraph/tests/community/test_louvain_mg.py index a766f804673..5318262fe26 100644 --- a/python/cugraph/cugraph/tests/community/test_louvain_mg.py +++ b/python/cugraph/cugraph/tests/community/test_louvain_mg.py @@ -19,7 +19,6 @@ import dask_cudf from cugraph.testing import utils -# from cugraph.dask.common.mg_utils import is_single_gpu try: from rapids_pytest_benchmark import setFixtureParamNames diff --git a/python/cugraph/cugraph/tests/community/test_modularity.py b/python/cugraph/cugraph/tests/community/test_modularity.py index cc919700490..ac44b6c89c1 100644 --- a/python/cugraph/cugraph/tests/community/test_modularity.py +++ b/python/cugraph/cugraph/tests/community/test_modularity.py @@ -12,17 +12,16 @@ # limitations under the License. import gc -import random +import random import pytest +import networkx as nx import cudf import cugraph from cugraph.testing import utils, DEFAULT_DATASETS from cugraph.utilities import ensure_cugraph_obj_for_nx -import networkx as nx - def cugraph_call(G, partitions): df = cugraph.spectralModularityMaximizationClustering( diff --git a/python/cugraph/cugraph/tests/community/test_triangle_count.py b/python/cugraph/cugraph/tests/community/test_triangle_count.py index 4de624a3321..a4d267719ba 100644 --- a/python/cugraph/cugraph/tests/community/test_triangle_count.py +++ b/python/cugraph/cugraph/tests/community/test_triangle_count.py @@ -12,27 +12,16 @@ # limitations under the License. import gc -import random +import random +import networkx as nx import pytest -import cudf -from pylibcugraph.testing.utils import gen_fixture_params_product +import cudf import cugraph from cugraph.testing import utils, UNDIRECTED_DATASETS from cugraph.datasets import karate_asymmetric - - -# Temporarily suppress warnings till networkX fixes deprecation warnings -# (Using or importing the ABCs from 'collections' instead of from -# 'collections.abc' is deprecated, and in 3.8 it will stop working) for -# python 3.7. Also, this import networkx needs to be relocated in the -# third-party group once this gets fixed. -import warnings - -with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - import networkx as nx +from pylibcugraph.testing.utils import gen_fixture_params_product # ============================================================================= diff --git a/python/cugraph/cugraph/tests/community/test_triangle_count_mg.py b/python/cugraph/cugraph/tests/community/test_triangle_count_mg.py index 4127b6ea4bd..2cf0525d2ad 100644 --- a/python/cugraph/cugraph/tests/community/test_triangle_count_mg.py +++ b/python/cugraph/cugraph/tests/community/test_triangle_count_mg.py @@ -11,17 +11,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -import random import gc +import random import pytest + import cudf import dask_cudf -from pylibcugraph.testing.utils import gen_fixture_params_product - import cugraph -from cugraph.testing import utils import cugraph.dask as dcg +from cugraph.testing import utils +from pylibcugraph.testing.utils import gen_fixture_params_product # ============================================================================= diff --git a/python/cugraph/cugraph/tests/components/test_connectivity.py b/python/cugraph/cugraph/tests/components/test_connectivity.py index 1b8787cb1da..df45e055c5e 100644 --- a/python/cugraph/cugraph/tests/components/test_connectivity.py +++ b/python/cugraph/cugraph/tests/components/test_connectivity.py @@ -12,13 +12,14 @@ # limitations under the License. import gc + import time from collections import defaultdict -import warnings import pytest import cupy as cp import numpy as np +import networkx as nx from cupyx.scipy.sparse import coo_matrix as cp_coo_matrix from cupyx.scipy.sparse import csr_matrix as cp_csr_matrix from cupyx.scipy.sparse import csc_matrix as cp_csc_matrix @@ -35,16 +36,6 @@ DATASETS_BATCH = [dolphins, netscience, email_Eu_core] -# Temporarily suppress warnings till networkX fixes deprecation warnings -# (Using or importing the ABCs from 'collections' instead of from -# 'collections.abc' is deprecated, and in 3.8 it will stop working) for -# python 3.7. Also, this import networkx needs to be relocated in the -# third-party group once this gets fixed. - -with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - import networkx as nx - print("Networkx version : {} ".format(nx.__version__)) diff --git a/python/cugraph/cugraph/tests/components/test_connectivity_mg.py b/python/cugraph/cugraph/tests/components/test_connectivity_mg.py index 691e85e51cd..e809ab66438 100644 --- a/python/cugraph/cugraph/tests/components/test_connectivity_mg.py +++ b/python/cugraph/cugraph/tests/components/test_connectivity_mg.py @@ -11,18 +11,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest -import cugraph.dask as dcg import gc -# import pytest -import cugraph -import dask_cudf -import cudf +import pytest -# from cugraph.dask.common.mg_utils import is_single_gpu +import cudf +import dask_cudf +import cugraph +import cugraph.dask as dcg from cugraph.testing.utils import RAPIDS_DATASET_ROOT_DIR_PATH + # ============================================================================= # Pytest Setup / Teardown - called for each test function # ============================================================================= diff --git a/python/cugraph/cugraph/tests/core/test_core_number.py b/python/cugraph/cugraph/tests/core/test_core_number.py index eba775dd26f..a01b837ff61 100644 --- a/python/cugraph/cugraph/tests/core/test_core_number.py +++ b/python/cugraph/cugraph/tests/core/test_core_number.py @@ -14,12 +14,12 @@ import gc import pytest -import cudf -from pylibcugraph.testing.utils import gen_fixture_params_product import networkx as nx +import cudf import cugraph from cugraph.testing import utils, UNDIRECTED_DATASETS +from pylibcugraph.testing.utils import gen_fixture_params_product # ============================================================================= diff --git a/python/cugraph/cugraph/tests/core/test_core_number_mg.py b/python/cugraph/cugraph/tests/core/test_core_number_mg.py index cff2ae11ef3..23214b5f51b 100644 --- a/python/cugraph/cugraph/tests/core/test_core_number_mg.py +++ b/python/cugraph/cugraph/tests/core/test_core_number_mg.py @@ -14,12 +14,12 @@ import gc import pytest -import dask_cudf -from pylibcugraph.testing.utils import gen_fixture_params_product +import dask_cudf import cugraph -from cugraph.testing import utils import cugraph.dask as dcg +from cugraph.testing import utils +from pylibcugraph.testing.utils import gen_fixture_params_product # ============================================================================= diff --git a/python/cugraph/cugraph/tests/core/test_k_core.py b/python/cugraph/cugraph/tests/core/test_k_core.py index c1351276fa5..f0169238ece 100644 --- a/python/cugraph/cugraph/tests/core/test_k_core.py +++ b/python/cugraph/cugraph/tests/core/test_k_core.py @@ -14,21 +14,11 @@ import gc import pytest +import networkx as nx import cugraph from cugraph.testing import utils, UNDIRECTED_DATASETS -# Temporarily suppress warnings till networkX fixes deprecation warnings -# (Using or importing the ABCs from 'collections' instead of from -# 'collections.abc' is deprecated, and in 3.8 it will stop working) for -# python 3.7. Also, this import networkx needs to be relocated in the -# third-party group once this gets fixed. -import warnings - -with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - import networkx as nx - print("Networkx version : {} ".format(nx.__version__)) diff --git a/python/cugraph/cugraph/tests/core/test_k_core_mg.py b/python/cugraph/cugraph/tests/core/test_k_core_mg.py index d8e7ef98d24..c68108ce241 100644 --- a/python/cugraph/cugraph/tests/core/test_k_core_mg.py +++ b/python/cugraph/cugraph/tests/core/test_k_core_mg.py @@ -14,14 +14,14 @@ import gc import pytest -import dask_cudf -from cudf.testing.testing import assert_frame_equal -from pylibcugraph.testing import gen_fixture_params_product +import dask_cudf import cugraph -from cugraph.testing import utils import cugraph.dask as dcg +from cugraph.testing import utils +from cudf.testing.testing import assert_frame_equal from cugraph.structure.symmetrize import symmetrize_df +from pylibcugraph.testing import gen_fixture_params_product # ============================================================================= diff --git a/python/cugraph/cugraph/tests/data_store/test_gnn_feat_storage.py b/python/cugraph/cugraph/tests/data_store/test_gnn_feat_storage.py index 2b7a5a2b1c9..2d1537d11e3 100644 --- a/python/cugraph/cugraph/tests/data_store/test_gnn_feat_storage.py +++ b/python/cugraph/cugraph/tests/data_store/test_gnn_feat_storage.py @@ -11,10 +11,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # Import FeatureStore class -from cugraph.gnn import FeatureStore + +import pytest import numpy as np + import cudf -import pytest +from cugraph.gnn import FeatureStore @pytest.mark.sg diff --git a/python/cugraph/cugraph/tests/data_store/test_property_graph.py b/python/cugraph/cugraph/tests/data_store/test_property_graph.py index 8459b296307..a33d4f753db 100644 --- a/python/cugraph/cugraph/tests/data_store/test_property_graph.py +++ b/python/cugraph/cugraph/tests/data_store/test_property_graph.py @@ -17,11 +17,16 @@ import pytest import pandas as pd import numpy as np + import cudf import cupy as cp +import cugraph +from cugraph.generators import rmat +from cugraph.datasets import cyber from cudf.testing import assert_frame_equal, assert_series_equal from pylibcugraph.testing.utils import gen_fixture_params_product + # If the rapids-pytest-benchmark plugin is installed, the "gpubenchmark" # fixture will be available automatically. Check that this fixture is available # by trying to import rapids_pytest_benchmark, and if that fails, set @@ -44,10 +49,6 @@ SettingWithCopyWarning as pandas_SettingWithCopyWarning, ) -import cugraph -from cugraph.generators import rmat -from cugraph.datasets import cyber - def type_is_categorical(pG): return ( diff --git a/python/cugraph/cugraph/tests/data_store/test_property_graph_mg.py b/python/cugraph/cugraph/tests/data_store/test_property_graph_mg.py index 42ecf0a6eb5..dd48fc72e36 100644 --- a/python/cugraph/cugraph/tests/data_store/test_property_graph_mg.py +++ b/python/cugraph/cugraph/tests/data_store/test_property_graph_mg.py @@ -10,20 +10,22 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + import gc -import dask_cudf import pytest import pandas as pd +import numpy as np + import cudf +import cugraph +import dask_cudf import cupy as cp -import numpy as np -from cudf.testing import assert_frame_equal, assert_series_equal +import cugraph.dask as dcg from cupy.testing import assert_array_equal +from cudf.testing import assert_frame_equal, assert_series_equal from pylibcugraph.testing.utils import gen_fixture_params_product from cugraph.dask.common.mg_utils import is_single_gpu - -import cugraph.dask as dcg from cugraph.datasets import cyber, netscience # If the rapids-pytest-benchmark plugin is installed, the "gpubenchmark" @@ -38,8 +40,6 @@ gpubenchmark = pytest_benchmark.plugin.benchmark -import cugraph - def type_is_categorical(pG): return ( diff --git a/python/cugraph/cugraph/tests/generators/test_rmat.py b/python/cugraph/cugraph/tests/generators/test_rmat.py index f52190f1576..c487f87d54e 100644 --- a/python/cugraph/cugraph/tests/generators/test_rmat.py +++ b/python/cugraph/cugraph/tests/generators/test_rmat.py @@ -15,9 +15,8 @@ import pytest import cudf - -from cugraph.generators import rmat import cugraph +from cugraph.generators import rmat ############################################################################## diff --git a/python/cugraph/cugraph/tests/generators/test_rmat_mg.py b/python/cugraph/cugraph/tests/generators/test_rmat_mg.py index d5d6db4d70f..0e1808d2f80 100644 --- a/python/cugraph/cugraph/tests/generators/test_rmat_mg.py +++ b/python/cugraph/cugraph/tests/generators/test_rmat_mg.py @@ -15,7 +15,8 @@ import pytest import dask_cudf - +import cugraph +from cugraph.generators import rmat from cugraph.testing.mg_utils import ( start_dask_client, stop_dask_client, @@ -23,8 +24,6 @@ from cugraph.dask.common.mg_utils import ( is_single_gpu, ) -from cugraph.generators import rmat -import cugraph ############################################################################## diff --git a/python/cugraph/cugraph/tests/gnn/test_dgl_uniform_sampler.py b/python/cugraph/cugraph/tests/gnn/test_dgl_uniform_sampler.py index 8d94aa6137d..eeb9d06b162 100644 --- a/python/cugraph/cugraph/tests/gnn/test_dgl_uniform_sampler.py +++ b/python/cugraph/cugraph/tests/gnn/test_dgl_uniform_sampler.py @@ -11,12 +11,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cudf +import pytest import pandas as pd import numpy as np -import cupy as cp -import pytest +import cudf +import cupy as cp from cugraph.gnn.dgl_extensions.dgl_uniform_sampler import DGLUniformSampler diff --git a/python/cugraph/cugraph/tests/gnn/test_dgl_uniform_sampler_mg.py b/python/cugraph/cugraph/tests/gnn/test_dgl_uniform_sampler_mg.py index 45a64a1f4ca..bc36e5f0631 100644 --- a/python/cugraph/cugraph/tests/gnn/test_dgl_uniform_sampler_mg.py +++ b/python/cugraph/cugraph/tests/gnn/test_dgl_uniform_sampler_mg.py @@ -10,13 +10,14 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -import dask_cudf -import cudf + +import pytest import pandas as pd import numpy as np -import cupy as cp -import pytest +import dask_cudf +import cudf +import cupy as cp from cugraph.gnn.dgl_extensions.dgl_uniform_sampler import DGLUniformSampler diff --git a/python/cugraph/cugraph/tests/internals/test_renumber.py b/python/cugraph/cugraph/tests/internals/test_renumber.py index eb396dc66f1..cd27dfecfe9 100644 --- a/python/cugraph/cugraph/tests/internals/test_renumber.py +++ b/python/cugraph/cugraph/tests/internals/test_renumber.py @@ -15,11 +15,11 @@ import gc -import pandas as pd import pytest +import pandas as pd + import cudf from cudf.testing import assert_series_equal - from cugraph.structure.number_map import NumberMap from cugraph.testing import utils, DEFAULT_DATASETS diff --git a/python/cugraph/cugraph/tests/internals/test_renumber_mg.py b/python/cugraph/cugraph/tests/internals/test_renumber_mg.py index cc7ee0368a5..c0abc61b050 100644 --- a/python/cugraph/cugraph/tests/internals/test_renumber_mg.py +++ b/python/cugraph/cugraph/tests/internals/test_renumber_mg.py @@ -18,17 +18,17 @@ import pandas import numpy as np -import dask_cudf + import dask import cudf -from cudf.testing import assert_frame_equal, assert_series_equal - +import dask_cudf import cugraph.dask as dcg import cugraph from cugraph.testing import utils from cugraph.structure.number_map import NumberMap from cugraph.dask.common.mg_utils import is_single_gpu from cugraph.testing.utils import RAPIDS_DATASET_ROOT_DIR_PATH +from cudf.testing import assert_frame_equal, assert_series_equal # ============================================================================= diff --git a/python/cugraph/cugraph/tests/internals/test_symmetrize.py b/python/cugraph/cugraph/tests/internals/test_symmetrize.py index 30395862a20..654ed3296d9 100644 --- a/python/cugraph/cugraph/tests/internals/test_symmetrize.py +++ b/python/cugraph/cugraph/tests/internals/test_symmetrize.py @@ -14,8 +14,8 @@ import gc import pytest - import pandas as pd + import cudf import cugraph from cugraph.testing import DEFAULT_DATASETS diff --git a/python/cugraph/cugraph/tests/internals/test_symmetrize_mg.py b/python/cugraph/cugraph/tests/internals/test_symmetrize_mg.py index d7b59e4f73a..05cc06e6282 100644 --- a/python/cugraph/cugraph/tests/internals/test_symmetrize_mg.py +++ b/python/cugraph/cugraph/tests/internals/test_symmetrize_mg.py @@ -15,11 +15,11 @@ import pytest import pandas as pd -import dask_cudf -from pylibcugraph.testing.utils import gen_fixture_params_product +import dask_cudf import cugraph from cugraph.testing import utils +from pylibcugraph.testing.utils import gen_fixture_params_product # ============================================================================= diff --git a/python/cugraph/cugraph/tests/layout/test_force_atlas2.py b/python/cugraph/cugraph/tests/layout/test_force_atlas2.py index a99ca73cab8..495a2d945c0 100644 --- a/python/cugraph/cugraph/tests/layout/test_force_atlas2.py +++ b/python/cugraph/cugraph/tests/layout/test_force_atlas2.py @@ -13,20 +13,14 @@ import time import pytest +import scipy.io +from sklearn.manifold import trustworthiness import cudf import cugraph from cugraph.internals import GraphBasedDimRedCallback -from sklearn.manifold import trustworthiness -import scipy.io from cugraph.datasets import karate, polbooks, dolphins, netscience -# Temporarily suppress warnings till networkX fixes deprecation warnings -# (Using or importing the ABCs from 'collections' instead of from -# 'collections.abc' is deprecated, and in 3.8 it will stop working) for -# python 3.7. Also, these import fa2 and import networkx need to be -# relocated in the third-party group once this gets fixed. - def cugraph_call( cu_M, diff --git a/python/cugraph/cugraph/tests/link_analysis/test_hits.py b/python/cugraph/cugraph/tests/link_analysis/test_hits.py index b21265f16c8..1c5a135e944 100644 --- a/python/cugraph/cugraph/tests/link_analysis/test_hits.py +++ b/python/cugraph/cugraph/tests/link_analysis/test_hits.py @@ -16,12 +16,12 @@ import pytest import networkx as nx import pandas as pd -import cudf -from pylibcugraph.testing.utils import gen_fixture_params_product +import cudf import cugraph from cugraph.testing import utils, UNDIRECTED_DATASETS from cugraph.datasets import email_Eu_core, karate +from pylibcugraph.testing.utils import gen_fixture_params_product # ============================================================================= diff --git a/python/cugraph/cugraph/tests/link_analysis/test_hits_mg.py b/python/cugraph/cugraph/tests/link_analysis/test_hits_mg.py index 9885d47b24a..bfb33ccd619 100644 --- a/python/cugraph/cugraph/tests/link_analysis/test_hits_mg.py +++ b/python/cugraph/cugraph/tests/link_analysis/test_hits_mg.py @@ -12,16 +12,14 @@ # limitations under the License. import gc + import pytest import dask_cudf -from pylibcugraph.testing.utils import gen_fixture_params_product - import cugraph import cugraph.dask as dcg - -# from cugraph.dask.common.mg_utils import is_single_gpu from cugraph.testing import utils +from pylibcugraph.testing.utils import gen_fixture_params_product # ============================================================================= diff --git a/python/cugraph/cugraph/tests/link_analysis/test_pagerank.py b/python/cugraph/cugraph/tests/link_analysis/test_pagerank.py index af371722c01..8e8ab13574d 100644 --- a/python/cugraph/cugraph/tests/link_analysis/test_pagerank.py +++ b/python/cugraph/cugraph/tests/link_analysis/test_pagerank.py @@ -13,9 +13,10 @@ import gc import time -import numpy as np import pytest +import numpy as np +import networkx as nx import cudf import cugraph @@ -23,18 +24,6 @@ from cugraph.datasets import karate -# Temporarily suppress warnings till networkX fixes deprecation warnings -# (Using or importing the ABCs from 'collections' instead of from -# 'collections.abc' is deprecated, and in 3.8 it will stop working) for -# python 3.7. Also, this import networkx needs to be relocated in the -# third-party group once this gets fixed. -import warnings - -with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - import networkx as nx - - print("Networkx version : {} ".format(nx.__version__)) diff --git a/python/cugraph/cugraph/tests/link_analysis/test_pagerank_mg.py b/python/cugraph/cugraph/tests/link_analysis/test_pagerank_mg.py index 14a512c59e5..d68aeda4a2f 100644 --- a/python/cugraph/cugraph/tests/link_analysis/test_pagerank_mg.py +++ b/python/cugraph/cugraph/tests/link_analysis/test_pagerank_mg.py @@ -10,23 +10,23 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import pytest -import cugraph.dask as dcg + import gc + +import pytest +import numpy as np + +import cudf import cugraph +import cugraph.dask as dcg import dask_cudf from cugraph.testing import utils -import cudf - from cugraph.dask.common.mg_utils import is_single_gpu from cugraph.testing.utils import RAPIDS_DATASET_ROOT_DIR_PATH # The function selects personalization_perc% of accessible vertices in graph M # and randomly assigns them personalization values - - def personalize(vertices, personalization_perc): personalization = None if personalization_perc != 0: diff --git a/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py b/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py index dd0cd226916..da4ff5bef4f 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py @@ -12,27 +12,17 @@ # limitations under the License. import gc -import pytest +import pytest import cudf -from cudf.testing import assert_series_equal, assert_frame_equal +import networkx as nx import cugraph +from cugraph.datasets import netscience from cugraph.testing import utils, UNDIRECTED_DATASETS -from cugraph.experimental import jaccard_coefficient as exp_jaccard_coefficient from cugraph.experimental import jaccard as exp_jaccard -from cugraph.datasets import netscience - -# Temporarily suppress warnings till networkX fixes deprecation warnings -# (Using or importing the ABCs from 'collections' instead of from -# 'collections.abc' is deprecated, and in 3.8 it will stop working) for -# python 3.7. Also, this import networkx needs to be relocated in the -# third-party group once this gets fixed. -import warnings - -with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - import networkx as nx +from cudf.testing import assert_series_equal, assert_frame_equal +from cugraph.experimental import jaccard_coefficient as exp_jaccard_coefficient print("Networkx version : {} ".format(nx.__version__)) diff --git a/python/cugraph/cugraph/tests/link_prediction/test_jaccard_mg.py b/python/cugraph/cugraph/tests/link_prediction/test_jaccard_mg.py index 35f17d99184..1f7c0a9cadb 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_jaccard_mg.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_jaccard_mg.py @@ -15,11 +15,12 @@ import random import pytest + import dask_cudf -from pylibcugraph.testing import gen_fixture_params_product -import cugraph.dask as dcg import cugraph +import cugraph.dask as dcg from cugraph.testing import utils +from pylibcugraph.testing import gen_fixture_params_product # ============================================================================= diff --git a/python/cugraph/cugraph/tests/link_prediction/test_overlap.py b/python/cugraph/cugraph/tests/link_prediction/test_overlap.py index 1b5396aad92..032b264367d 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_overlap.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_overlap.py @@ -12,17 +12,16 @@ # limitations under the License. import gc + import pytest import numpy as np import scipy import cudf -from cudf.testing import assert_series_equal, assert_frame_equal - -from cugraph.experimental import overlap as exp_overlap - import cugraph from cugraph.testing import utils, UNDIRECTED_DATASETS +from cugraph.experimental import overlap as exp_overlap +from cudf.testing import assert_series_equal, assert_frame_equal # ============================================================================= diff --git a/python/cugraph/cugraph/tests/link_prediction/test_overlap_mg.py b/python/cugraph/cugraph/tests/link_prediction/test_overlap_mg.py index 541e3123e78..220b90cbb47 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_overlap_mg.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_overlap_mg.py @@ -15,12 +15,12 @@ import random import pytest -import dask_cudf -from pylibcugraph.testing import gen_fixture_params_product import cugraph +import dask_cudf import cugraph.dask as dcg from cugraph.testing import utils +from pylibcugraph.testing import gen_fixture_params_product # ============================================================================= diff --git a/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py b/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py index 24db3d3b895..e5a84010c49 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py @@ -12,26 +12,16 @@ # limitations under the License. import gc + import pytest +import networkx as nx import cudf -from cudf.testing import assert_series_equal, assert_frame_equal - import cugraph -from cugraph.testing import utils, UNDIRECTED_DATASETS from cugraph.datasets import netscience +from cugraph.testing import utils, UNDIRECTED_DATASETS from cugraph.experimental import sorensen as exp_sorensen - -# Temporarily suppress warnings till networkX fixes deprecation warnings -# (Using or importing the ABCs from 'collections' instead of from -# 'collections.abc' is deprecated, and in 3.8 it will stop working) for -# python 3.7. Also, this import networkx needs to be relocated in the -# third-party group once this gets fixed. -import warnings - -with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - import networkx as nx +from cudf.testing import assert_series_equal, assert_frame_equal print("Networkx version : {} ".format(nx.__version__)) diff --git a/python/cugraph/cugraph/tests/link_prediction/test_sorensen_mg.py b/python/cugraph/cugraph/tests/link_prediction/test_sorensen_mg.py index 7c84fce989b..d9d013c7e35 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_sorensen_mg.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_sorensen_mg.py @@ -12,16 +12,16 @@ # limitations under the License. import gc + import random import pytest +import cugraph import dask_cudf -from pylibcugraph.testing import gen_fixture_params_product -from cugraph.dask.common.mg_utils import is_single_gpu - import cugraph.dask as dcg -import cugraph from cugraph.testing import utils +from cugraph.dask.common.mg_utils import is_single_gpu +from pylibcugraph.testing import gen_fixture_params_product # ============================================================================= diff --git a/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py b/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py index bb017841241..0691ddb8775 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py @@ -13,27 +13,16 @@ import gc -import numpy as np import pytest +import numpy as np +import networkx as nx import cudf -from cudf.testing import assert_series_equal - import cugraph from cugraph.testing import utils, UNDIRECTED_DATASETS +from cudf.testing import assert_series_equal -# Temporarily suppress warnings till networkX fixes deprecation warnings -# (Using or importing the ABCs from 'collections' instead of from -# 'collections.abc' is deprecated, and in 3.8 it will stop working) for -# python 3.7. Also, this import networkx needs to be relocated in the -# third-party group once this gets fixed. -import warnings - -with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - import networkx as nx - print("Networkx version : {} ".format(nx.__version__)) diff --git a/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py b/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py index c37af976c7a..bfff9c7658b 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py @@ -16,10 +16,10 @@ import pytest import scipy import numpy as np -import cudf -from cudf.testing import assert_series_equal +import cudf import cugraph +from cudf.testing import assert_series_equal from cugraph.testing import utils, UNDIRECTED_DATASETS diff --git a/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py b/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py index 5c537f7aa54..c74878be9db 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py @@ -13,27 +13,16 @@ import gc -import numpy as np import pytest +import numpy as np +import networkx as nx import cudf -from cudf.testing import assert_series_equal - import cugraph +from cudf.testing import assert_series_equal from cugraph.testing import utils, UNDIRECTED_DATASETS -# Temporarily suppress warnings till networkX fixes deprecation warnings -# (Using or importing the ABCs from 'collections' instead of from -# 'collections.abc' is deprecated, and in 3.8 it will stop working) for -# python 3.7. Also, this import networkx needs to be relocated in the -# third-party group once this gets fixed. -import warnings - -with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - import networkx as nx - print("Networkx version : {} ".format(nx.__version__)) diff --git a/python/cugraph/cugraph/tests/nx/test_compat_algo.py b/python/cugraph/cugraph/tests/nx/test_compat_algo.py index 2a074d588eb..4b9160da416 100644 --- a/python/cugraph/cugraph/tests/nx/test_compat_algo.py +++ b/python/cugraph/cugraph/tests/nx/test_compat_algo.py @@ -11,8 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cugraph.experimental.compat.nx as nx import pytest +import cugraph.experimental.compat.nx as nx @pytest.mark.sg diff --git a/python/cugraph/cugraph/tests/nx/test_compat_pr.py b/python/cugraph/cugraph/tests/nx/test_compat_pr.py index a8dc6f7bb22..9be3912a33f 100644 --- a/python/cugraph/cugraph/tests/nx/test_compat_pr.py +++ b/python/cugraph/cugraph/tests/nx/test_compat_pr.py @@ -22,10 +22,10 @@ import pytest import numpy as np -from pylibcugraph.testing.utils import gen_fixture_params_product from cugraph.testing import utils from cugraph.experimental.datasets import karate +from pylibcugraph.testing.utils import gen_fixture_params_product MAX_ITERATIONS = [100, 200] diff --git a/python/cugraph/cugraph/tests/nx/test_nx_convert.py b/python/cugraph/cugraph/tests/nx/test_nx_convert.py index 86e1eaa7fe4..58b89a4bda9 100644 --- a/python/cugraph/cugraph/tests/nx/test_nx_convert.py +++ b/python/cugraph/cugraph/tests/nx/test_nx_convert.py @@ -11,26 +11,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pandas as pd import pytest -import cudf +import pandas as pd +import networkx as nx +import cudf import cugraph from cugraph.testing import utils, DEFAULT_DATASETS -# Temporarily suppress warnings till networkX fixes deprecation warnings -# (Using or importing the ABCs from 'collections' instead of from -# 'collections.abc' is deprecated, and in 3.8 it will stop working) for -# python 3.7. Also, this import networkx needs to be relocated in the -# third-party group once this gets fixed. -import warnings - -with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - import networkx as nx - - def _compare_graphs(nxG, cuG, has_wt=True): assert nxG.number_of_nodes() == cuG.number_of_nodes() assert nxG.number_of_edges() == cuG.number_of_edges() diff --git a/python/cugraph/cugraph/tests/sampling/test_bulk_sampler.py b/python/cugraph/cugraph/tests/sampling/test_bulk_sampler.py index eba59d5c3d7..06a0d192412 100644 --- a/python/cugraph/cugraph/tests/sampling/test_bulk_sampler.py +++ b/python/cugraph/cugraph/tests/sampling/test_bulk_sampler.py @@ -11,16 +11,17 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os +import tempfile + import pytest + import cudf import cupy import cugraph from cugraph.datasets import karate from cugraph.experimental.gnn import BulkSampler -import tempfile -import os - @pytest.mark.sg def test_bulk_sampler_simple(): diff --git a/python/cugraph/cugraph/tests/sampling/test_bulk_sampler_io.py b/python/cugraph/cugraph/tests/sampling/test_bulk_sampler_io.py index 83d20ea2cf5..2dccc27e2fe 100644 --- a/python/cugraph/cugraph/tests/sampling/test_bulk_sampler_io.py +++ b/python/cugraph/cugraph/tests/sampling/test_bulk_sampler_io.py @@ -11,11 +11,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest -import cudf -import tempfile import os +import tempfile +import pytest + +import cudf from cugraph.gnn.data_loading.bulk_sampler_io import write_samples diff --git a/python/cugraph/cugraph/tests/sampling/test_bulk_sampler_io_mg.py b/python/cugraph/cugraph/tests/sampling/test_bulk_sampler_io_mg.py index eacd697b7b3..bd4e47038a5 100644 --- a/python/cugraph/cugraph/tests/sampling/test_bulk_sampler_io_mg.py +++ b/python/cugraph/cugraph/tests/sampling/test_bulk_sampler_io_mg.py @@ -11,14 +11,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os +import tempfile + import pytest import cudf import dask_cudf - -import tempfile -import os - from cugraph.gnn.data_loading.bulk_sampler_io import write_samples diff --git a/python/cugraph/cugraph/tests/sampling/test_bulk_sampler_mg.py b/python/cugraph/cugraph/tests/sampling/test_bulk_sampler_mg.py index 856940829fe..e947115497b 100644 --- a/python/cugraph/cugraph/tests/sampling/test_bulk_sampler_mg.py +++ b/python/cugraph/cugraph/tests/sampling/test_bulk_sampler_mg.py @@ -11,16 +11,17 @@ # See the License for the specific language governing permissions and # limitations under the License. +import tempfile + import pytest + import cudf -import dask_cudf import cupy import cugraph +import dask_cudf from cugraph.datasets import karate from cugraph.experimental import BulkSampler -import tempfile - @pytest.mark.mg def test_bulk_sampler_simple(dask_client): diff --git a/python/cugraph/cugraph/tests/sampling/test_egonet.py b/python/cugraph/cugraph/tests/sampling/test_egonet.py index 83f0aa66af1..1ae7fcc0c88 100644 --- a/python/cugraph/cugraph/tests/sampling/test_egonet.py +++ b/python/cugraph/cugraph/tests/sampling/test_egonet.py @@ -12,22 +12,14 @@ # limitations under the License. import gc + import pytest +import networkx as nx import cudf import cugraph from cugraph.testing import utils, DEFAULT_DATASETS -# Temporarily suppress warnings till networkX fixes deprecation warnings -# (Using or importing the ABCs from 'collections' instead of from -# 'collections.abc' is deprecated, and in 3.8 it will stop working) for -# python 3.7. Also, this import networkx needs to be relocated in the -# third-party group once this gets fixed. -import warnings - -with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - import networkx as nx print("Networkx version : {} ".format(nx.__version__)) diff --git a/python/cugraph/cugraph/tests/sampling/test_egonet_mg.py b/python/cugraph/cugraph/tests/sampling/test_egonet_mg.py index 172296c07f9..7f5891abdd3 100644 --- a/python/cugraph/cugraph/tests/sampling/test_egonet_mg.py +++ b/python/cugraph/cugraph/tests/sampling/test_egonet_mg.py @@ -12,16 +12,16 @@ # limitations under the License. import gc -import pytest -import dask_cudf -from cudf.testing.testing import assert_frame_equal, assert_series_equal -from pylibcugraph.testing import gen_fixture_params_product +import pytest import cugraph +import dask_cudf import cugraph.dask as dcg from cugraph.testing import utils from cugraph.dask.common.mg_utils import is_single_gpu +from pylibcugraph.testing import gen_fixture_params_product +from cudf.testing.testing import assert_frame_equal, assert_series_equal # ============================================================================= diff --git a/python/cugraph/cugraph/tests/sampling/test_node2vec.py b/python/cugraph/cugraph/tests/sampling/test_node2vec.py index c3441801169..678d5d76632 100644 --- a/python/cugraph/cugraph/tests/sampling/test_node2vec.py +++ b/python/cugraph/cugraph/tests/sampling/test_node2vec.py @@ -13,12 +13,13 @@ import gc import random + import pytest -from cugraph.testing import utils, SMALL_DATASETS -import cugraph import cudf +import cugraph from cugraph.datasets import small_line, karate +from cugraph.testing import utils, SMALL_DATASETS # ============================================================================= diff --git a/python/cugraph/cugraph/tests/sampling/test_random_walks.py b/python/cugraph/cugraph/tests/sampling/test_random_walks.py index 8e446c3955e..48629fa03a6 100644 --- a/python/cugraph/cugraph/tests/sampling/test_random_walks.py +++ b/python/cugraph/cugraph/tests/sampling/test_random_walks.py @@ -15,14 +15,15 @@ import random import pytest -from cudf.testing import assert_series_equal +import networkx as nx -import cugraph import cudf -import networkx as nx +import cugraph +from cudf.testing import assert_series_equal from cugraph.utilities import ensure_cugraph_obj_for_nx from cugraph.testing import SMALL_DATASETS, DEFAULT_DATASETS + # ============================================================================= # Parameters # ============================================================================= diff --git a/python/cugraph/cugraph/tests/sampling/test_random_walks_mg.py b/python/cugraph/cugraph/tests/sampling/test_random_walks_mg.py index b2db08aac92..a8aa34710ec 100644 --- a/python/cugraph/cugraph/tests/sampling/test_random_walks_mg.py +++ b/python/cugraph/cugraph/tests/sampling/test_random_walks_mg.py @@ -15,15 +15,13 @@ import random import pytest -import dask_cudf -from pylibcugraph.testing.utils import gen_fixture_params_product import cugraph - -# from cugraph.dask.common.mg_utils import is_single_gpu +import dask_cudf import cugraph.dask as dcg -from cugraph.datasets import karate_asymmetric from cugraph.testing import SMALL_DATASETS +from cugraph.datasets import karate_asymmetric +from pylibcugraph.testing.utils import gen_fixture_params_product # ============================================================================= diff --git a/python/cugraph/cugraph/tests/sampling/test_uniform_neighbor_sample.py b/python/cugraph/cugraph/tests/sampling/test_uniform_neighbor_sample.py index 4a67e8b2ae1..b8109ed240b 100644 --- a/python/cugraph/cugraph/tests/sampling/test_uniform_neighbor_sample.py +++ b/python/cugraph/cugraph/tests/sampling/test_uniform_neighbor_sample.py @@ -14,13 +14,13 @@ import random import pytest -import cudf -from pylibcugraph.testing.utils import gen_fixture_params_product +import cudf import cugraph from cugraph import uniform_neighbor_sample -from cugraph.datasets import email_Eu_core, small_tree from cugraph.testing import UNDIRECTED_DATASETS +from cugraph.datasets import email_Eu_core, small_tree +from pylibcugraph.testing.utils import gen_fixture_params_product # ============================================================================= diff --git a/python/cugraph/cugraph/tests/sampling/test_uniform_neighbor_sample_mg.py b/python/cugraph/cugraph/tests/sampling/test_uniform_neighbor_sample_mg.py index 4ac8a044c22..e8fa8061abf 100644 --- a/python/cugraph/cugraph/tests/sampling/test_uniform_neighbor_sample_mg.py +++ b/python/cugraph/cugraph/tests/sampling/test_uniform_neighbor_sample_mg.py @@ -15,18 +15,17 @@ import os import pytest + import cupy import cudf +import cugraph import dask_cudf -from pylibcugraph.testing.utils import gen_fixture_params_product -from cugraph.dask.common.mg_utils import is_single_gpu - import cugraph.dask as dcg -import cugraph - +from cugraph.testing import UNDIRECTED_DATASETS from cugraph.dask import uniform_neighbor_sample +from cugraph.dask.common.mg_utils import is_single_gpu from cugraph.datasets import email_Eu_core, small_tree -from cugraph.testing import UNDIRECTED_DATASETS +from pylibcugraph.testing.utils import gen_fixture_params_product # If the rapids-pytest-benchmark plugin is installed, the "gpubenchmark" # fixture will be available automatically. Check that this fixture is available diff --git a/python/cugraph/cugraph/tests/structure/test_convert_matrix.py b/python/cugraph/cugraph/tests/structure/test_convert_matrix.py index cc044d774af..2158cae3ab2 100644 --- a/python/cugraph/cugraph/tests/structure/test_convert_matrix.py +++ b/python/cugraph/cugraph/tests/structure/test_convert_matrix.py @@ -12,21 +12,13 @@ # limitations under the License. import gc + import pytest -import cugraph -from cugraph.testing import utils import numpy as np +import networkx as nx -# Temporarily suppress warnings till networkX fixes deprecation warnings -# (Using or importing the ABCs from 'collections' instead of from -# 'collections.abc' is deprecated, and in 3.8 it will stop working) for -# python 3.7. Also, this import networkx needs to be relocated in the -# third-party group once this gets fixed. -import warnings - -with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - import networkx as nx +import cugraph +from cugraph.testing import utils # ============================================================================= diff --git a/python/cugraph/cugraph/tests/structure/test_graph.py b/python/cugraph/cugraph/tests/structure/test_graph.py index 02219002a7e..6af152944a8 100644 --- a/python/cugraph/cugraph/tests/structure/test_graph.py +++ b/python/cugraph/cugraph/tests/structure/test_graph.py @@ -12,43 +12,29 @@ # limitations under the License. import gc - import time -import pandas as pd import pytest - +import pandas as pd import scipy +import networkx as nx + +import cupy import cudf -from cudf.testing.testing import assert_frame_equal import cugraph from cugraph.testing import utils from cudf.testing import assert_series_equal - -import cupy +from cudf.testing.testing import assert_frame_equal # MG +import dask_cudf import cugraph.dask as dcg -from cugraph.dask.common.mg_utils import is_single_gpu -from dask_cuda import LocalCUDACluster from dask.distributed import Client -import dask_cudf - -from pylibcugraph import bfs as pylibcugraph_bfs +from dask_cuda import LocalCUDACluster from pylibcugraph import ResourceHandle - +from pylibcugraph import bfs as pylibcugraph_bfs from cugraph.dask.traversal.bfs import convert_to_cudf - -# Temporarily suppress warnings till networkX fixes deprecation warnings -# (Using or importing the ABCs from 'collections' instead of from -# 'collections.abc' is deprecated, and in 3.8 it will stop working) for -# python 3.7. Also, this import networkx needs to be relocated in the -# third-party group once this gets fixed. -import warnings - -with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - import networkx as nx +from cugraph.dask.common.mg_utils import is_single_gpu # ============================================================================= diff --git a/python/cugraph/cugraph/tests/structure/test_graph_mg.py b/python/cugraph/cugraph/tests/structure/test_graph_mg.py index ebaae38a8a4..707b195dfa8 100644 --- a/python/cugraph/cugraph/tests/structure/test_graph_mg.py +++ b/python/cugraph/cugraph/tests/structure/test_graph_mg.py @@ -12,23 +12,24 @@ # limitations under the License. import gc import random -import copy + import pytest +import copy + import cupy -from dask.distributed import wait import cudf -import dask_cudf -from pylibcugraph import bfs as pylibcugraph_bfs -from pylibcugraph import ResourceHandle -from pylibcugraph.testing.utils import gen_fixture_params_product -from cudf.testing.testing import assert_frame_equal - import cugraph +import dask_cudf import cugraph.dask as dcg +import cugraph.dask.comms.comms as Comms from cugraph.testing import utils +from dask.distributed import wait +from pylibcugraph import ResourceHandle +from pylibcugraph import bfs as pylibcugraph_bfs +from cudf.testing.testing import assert_frame_equal from cugraph.dask.traversal.bfs import convert_to_cudf -import cugraph.dask.comms.comms as Comms from cugraph.dask.common.input_utils import get_distributed_data +from pylibcugraph.testing.utils import gen_fixture_params_product # ============================================================================= diff --git a/python/cugraph/cugraph/tests/structure/test_multigraph.py b/python/cugraph/cugraph/tests/structure/test_multigraph.py index 3c0d6f52975..af78c238d4e 100644 --- a/python/cugraph/cugraph/tests/structure/test_multigraph.py +++ b/python/cugraph/cugraph/tests/structure/test_multigraph.py @@ -14,8 +14,8 @@ import gc import pytest -import networkx as nx import numpy as np +import networkx as nx import cugraph from cugraph.testing import utils, DEFAULT_DATASETS diff --git a/python/cugraph/cugraph/tests/traversal/test_bfs.py b/python/cugraph/cugraph/tests/traversal/test_bfs.py index 340f5812ab7..89b00e66baa 100644 --- a/python/cugraph/cugraph/tests/traversal/test_bfs.py +++ b/python/cugraph/cugraph/tests/traversal/test_bfs.py @@ -15,35 +15,24 @@ import random import pytest -import pandas as pd import cupy as cp import numpy as np -from cupyx.scipy.sparse import coo_matrix as cp_coo_matrix -from cupyx.scipy.sparse import csr_matrix as cp_csr_matrix -from cupyx.scipy.sparse import csc_matrix as cp_csc_matrix +import pandas as pd +import networkx as nx +import networkx.algorithms.centrality.betweenness as nxacb from scipy.sparse import coo_matrix as sp_coo_matrix from scipy.sparse import csr_matrix as sp_csr_matrix from scipy.sparse import csc_matrix as sp_csc_matrix -import cudf -from pylibcugraph.testing.utils import gen_fixture_params_product +import cudf import cugraph +from cupyx.scipy.sparse import coo_matrix as cp_coo_matrix +from cupyx.scipy.sparse import csr_matrix as cp_csr_matrix +from cupyx.scipy.sparse import csc_matrix as cp_csc_matrix +from pylibcugraph.testing.utils import gen_fixture_params_product from cugraph.testing import utils, DEFAULT_DATASETS, SMALL_DATASETS -# Temporarily suppress warnings till networkX fixes deprecation warnings -# (Using or importing the ABCs from 'collections' instead of from -# 'collections.abc' is deprecated, and in 3.8 it will stop working) for -# python 3.7. Also, this import networkx needs to be relocated in the -# third-party group once this gets fixed. -import warnings - -with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - import networkx as nx - import networkx.algorithms.centrality.betweenness as nxacb - - # ============================================================================= # Parameters # ============================================================================= diff --git a/python/cugraph/cugraph/tests/traversal/test_bfs_mg.py b/python/cugraph/cugraph/tests/traversal/test_bfs_mg.py index 4b5c270034f..38b5a2734d6 100644 --- a/python/cugraph/cugraph/tests/traversal/test_bfs_mg.py +++ b/python/cugraph/cugraph/tests/traversal/test_bfs_mg.py @@ -11,16 +11,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest -import cugraph.dask as dcg import gc -# import pytest +import pytest + +import cudf import cugraph import dask_cudf -import cudf - -# from cugraph.dask.common.mg_utils import is_single_gpu +import cugraph.dask as dcg from cugraph.testing.utils import RAPIDS_DATASET_ROOT_DIR_PATH # ============================================================================= diff --git a/python/cugraph/cugraph/tests/traversal/test_filter_unreachable.py b/python/cugraph/cugraph/tests/traversal/test_filter_unreachable.py index 9ae746e2820..c9a44eea1e6 100644 --- a/python/cugraph/cugraph/tests/traversal/test_filter_unreachable.py +++ b/python/cugraph/cugraph/tests/traversal/test_filter_unreachable.py @@ -13,19 +13,14 @@ import gc import time + import pytest import numpy as np +import networkx as nx import cugraph from cugraph.testing import DEFAULT_DATASETS -# Temporarily suppress warnings till networkX fixes deprecation warnings -# (Using or importing the ABCs from 'collections' instead of from -# 'collections.abc' is deprecated, and in 3.8 it will stop working) for -# python 3.7. Also, this import networkx needs to be relocated in the -# third-party group once this gets fixed. -import warnings - # ============================================================================= # Pytest Setup / Teardown - called for each test function @@ -34,11 +29,6 @@ def setup_function(): gc.collect() -with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - import networkx as nx - - print("Networkx version : {} ".format(nx.__version__)) SOURCES = [1] diff --git a/python/cugraph/cugraph/tests/traversal/test_paths.py b/python/cugraph/cugraph/tests/traversal/test_paths.py index 8938ae74553..8a751ba8840 100644 --- a/python/cugraph/cugraph/tests/traversal/test_paths.py +++ b/python/cugraph/cugraph/tests/traversal/test_paths.py @@ -15,13 +15,13 @@ from tempfile import NamedTemporaryFile import math -import cudf -from cupyx.scipy.sparse import coo_matrix as cupy_coo_matrix -import cupy -import networkx as nx import pytest +import networkx as nx +import cudf +import cupy import cugraph +from cupyx.scipy.sparse import coo_matrix as cupy_coo_matrix CONNECTED_GRAPH = """1,5,3 diff --git a/python/cugraph/cugraph/tests/traversal/test_sssp.py b/python/cugraph/cugraph/tests/traversal/test_sssp.py index 41dc915e116..0d2646b29be 100644 --- a/python/cugraph/cugraph/tests/traversal/test_sssp.py +++ b/python/cugraph/cugraph/tests/traversal/test_sssp.py @@ -14,33 +14,24 @@ import gc import time -import numpy as np import pytest +import numpy as np import pandas as pd -import cupy as cp +import networkx as nx + +import cudf import cupyx +import cugraph +import cupy as cp from cupyx.scipy.sparse import coo_matrix as cp_coo_matrix from cupyx.scipy.sparse import csr_matrix as cp_csr_matrix from cupyx.scipy.sparse import csc_matrix as cp_csc_matrix from scipy.sparse import coo_matrix as sp_coo_matrix from scipy.sparse import csr_matrix as sp_csr_matrix from scipy.sparse import csc_matrix as sp_csc_matrix -import cudf from pylibcugraph.testing.utils import gen_fixture_params_product - -import cugraph from cugraph.testing import utils, UNDIRECTED_DATASETS, SMALL_DATASETS -# Temporarily suppress warnings till networkX fixes deprecation warnings -# (Using or importing the ABCs from 'collections' instead of from -# 'collections.abc' is deprecated, and in 3.8 it will stop working) for -# python 3.7. Also, this import networkx needs to be relocated in the -# third-party group once this gets fixed. -import warnings - -with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - import networkx as nx print("Networkx version : {} ".format(nx.__version__)) diff --git a/python/cugraph/cugraph/tests/traversal/test_sssp_mg.py b/python/cugraph/cugraph/tests/traversal/test_sssp_mg.py index 867f125ea6f..1720a051ee7 100644 --- a/python/cugraph/cugraph/tests/traversal/test_sssp_mg.py +++ b/python/cugraph/cugraph/tests/traversal/test_sssp_mg.py @@ -11,18 +11,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest -import cugraph.dask as dcg import gc -# import pytest +import pytest + +import cudf import cugraph import dask_cudf -import cudf - -# from cugraph.dask.common.mg_utils import is_single_gpu +import cugraph.dask as dcg from cugraph.testing.utils import RAPIDS_DATASET_ROOT_DIR_PATH + # ============================================================================= # Pytest Setup / Teardown - called for each test function # ============================================================================= diff --git a/python/cugraph/cugraph/tests/tree/test_maximum_spanning_tree.py b/python/cugraph/cugraph/tests/tree/test_maximum_spanning_tree.py index 5037866fd27..824239dfea7 100644 --- a/python/cugraph/cugraph/tests/tree/test_maximum_spanning_tree.py +++ b/python/cugraph/cugraph/tests/tree/test_maximum_spanning_tree.py @@ -14,27 +14,17 @@ import time import gc +import rmm import pytest import numpy as np -import rmm -import cudf +import networkx as nx +import cudf import cugraph from cugraph.testing import utils from cugraph.datasets import netscience -# Temporarily suppress warnings till networkX fixes deprecation warnings -# (Using or importing the ABCs from 'collections' instead of from -# 'collections.abc' is deprecated, and in 3.8 it will stop working) for -# python 3.7. Also, this import networkx needs to be relocated in the -# third-party group once this gets fixed. -import warnings - -with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - import networkx as nx - print("Networkx version : {} ".format(nx.__version__)) UNDIRECTED_WEIGHTED_DATASET = [netscience] diff --git a/python/cugraph/cugraph/tests/tree/test_minimum_spanning_tree.py b/python/cugraph/cugraph/tests/tree/test_minimum_spanning_tree.py index 14457239f32..cef963af445 100644 --- a/python/cugraph/cugraph/tests/tree/test_minimum_spanning_tree.py +++ b/python/cugraph/cugraph/tests/tree/test_minimum_spanning_tree.py @@ -14,25 +14,16 @@ import time import gc -import pytest -import numpy as np import rmm import cudf +import pytest +import numpy as np +import networkx as nx import cugraph from cugraph.testing import utils from cugraph.datasets import netscience -# Temporarily suppress warnings till networkX fixes deprecation warnings -# (Using or importing the ABCs from 'collections' instead of from -# 'collections.abc' is deprecated, and in 3.8 it will stop working) for -# python 3.7. Also, this import networkx needs to be relocated in the -# third-party group once this gets fixed. -import warnings - -with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=DeprecationWarning) - import networkx as nx print("Networkx version : {} ".format(nx.__version__)) diff --git a/python/cugraph/cugraph/tests/utils/mg_context.py b/python/cugraph/cugraph/tests/utils/mg_context.py index 25ad4ee5e15..af147c7633d 100644 --- a/python/cugraph/cugraph/tests/utils/mg_context.py +++ b/python/cugraph/cugraph/tests/utils/mg_context.py @@ -16,11 +16,10 @@ import pytest +import cugraph.dask.comms as Comms from dask.distributed import Client - -from cugraph.dask.common.mg_utils import get_visible_devices from dask_cuda import LocalCUDACluster as CUDACluster -import cugraph.dask.comms as Comms +from cugraph.dask.common.mg_utils import get_visible_devices # Maximal number of verifications of the number of workers diff --git a/python/cugraph/cugraph/tests/utils/test_replication_mg.py b/python/cugraph/cugraph/tests/utils/test_replication_mg.py index 95e7c1c7dbd..2f9c0d0189b 100644 --- a/python/cugraph/cugraph/tests/utils/test_replication_mg.py +++ b/python/cugraph/cugraph/tests/utils/test_replication_mg.py @@ -11,16 +11,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest import gc +import pytest -import cudf -from cudf.testing import assert_series_equal, assert_frame_equal +import cudf import cugraph +import cugraph.testing.utils as utils import cugraph.dask.structure.replication as replication from cugraph.dask.common.mg_utils import is_single_gpu -import cugraph.testing.utils as utils +from cudf.testing import assert_series_equal, assert_frame_equal + DATASETS_OPTIONS = utils.DATASETS_SMALL DIRECTED_GRAPH_OPTIONS = [False, True] diff --git a/python/cugraph/cugraph/tests/utils/test_utils.py b/python/cugraph/cugraph/tests/utils/test_utils.py index 607b27be099..9d35b326f6d 100644 --- a/python/cugraph/cugraph/tests/utils/test_utils.py +++ b/python/cugraph/cugraph/tests/utils/test_utils.py @@ -14,12 +14,12 @@ import gc import pytest +import numpy as np -import cugraph import cudf +import cugraph from cugraph.testing import utils from cugraph.datasets import karate -import numpy as np @pytest.mark.sg diff --git a/python/cugraph/cugraph/tests/utils/test_utils_mg.py b/python/cugraph/cugraph/tests/utils/test_utils_mg.py index 68e76302616..23ff17aa00b 100644 --- a/python/cugraph/cugraph/tests/utils/test_utils_mg.py +++ b/python/cugraph/cugraph/tests/utils/test_utils_mg.py @@ -11,21 +11,22 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cugraph.dask as dcg -from dask.distributed import default_client, futures_of, wait import gc -import cugraph -import dask_cudf -import pytest -from cugraph.dask.common.part_utils import concat_within_workers -from cugraph.dask.common.read_utils import get_n_workers -from cugraph.dask.common.mg_utils import is_single_gpu -from cugraph.testing.utils import RAPIDS_DATASET_ROOT_DIR_PATH - import os import time + +import pytest import numpy as np + +import cugraph +import dask_cudf +import cugraph.dask as dcg from cugraph.testing import utils +from cugraph.dask.common.mg_utils import is_single_gpu +from cugraph.dask.common.read_utils import get_n_workers +from dask.distributed import default_client, futures_of, wait +from cugraph.testing.utils import RAPIDS_DATASET_ROOT_DIR_PATH +from cugraph.dask.common.part_utils import concat_within_workers # =============================================================================