From c65f906b4609160e7c2791ff51915b0ccae8b558 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Thu, 29 Jun 2023 07:32:27 -0700 Subject: [PATCH 01/57] Create stable datasets api from experimental --- python/cugraph/cugraph/__init__.py | 2 + python/cugraph/cugraph/datasets/__init__.py | 71 ++++ python/cugraph/cugraph/datasets/dataset.py | 312 ++++++++++++++++++ .../cugraph/datasets/datasets_config.yaml | 5 + .../cugraph/datasets/metadata/__init__.py | 0 .../cugraph/datasets/metadata/cyber.yaml | 22 ++ .../cugraph/datasets/metadata/dolphins.yaml | 25 ++ .../datasets/metadata/email-Eu-core.yaml | 22 ++ .../datasets/metadata/karate-disjoint.yaml | 22 ++ .../cugraph/datasets/metadata/karate.yaml | 24 ++ .../datasets/metadata/karate_asymmetric.yaml | 24 ++ .../datasets/metadata/karate_data.yaml | 22 ++ .../datasets/metadata/karate_undirected.yaml | 22 ++ .../datasets/metadata/ktruss_polbooks.yaml | 23 ++ .../cugraph/datasets/metadata/netscience.yaml | 22 ++ .../cugraph/datasets/metadata/polbooks.yaml | 22 ++ .../cugraph/datasets/metadata/small_line.yaml | 22 ++ .../cugraph/datasets/metadata/small_tree.yaml | 22 ++ .../cugraph/datasets/metadata/toy_graph.yaml | 22 ++ .../metadata/toy_graph_undirected.yaml | 22 ++ 20 files changed, 728 insertions(+) create mode 100644 python/cugraph/cugraph/datasets/__init__.py create mode 100644 python/cugraph/cugraph/datasets/dataset.py create mode 100644 python/cugraph/cugraph/datasets/datasets_config.yaml create mode 100644 python/cugraph/cugraph/datasets/metadata/__init__.py create mode 100644 python/cugraph/cugraph/datasets/metadata/cyber.yaml create mode 100644 python/cugraph/cugraph/datasets/metadata/dolphins.yaml create mode 100644 python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml create mode 100644 python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml create mode 100644 python/cugraph/cugraph/datasets/metadata/karate.yaml create mode 100644 python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml create mode 100644 python/cugraph/cugraph/datasets/metadata/karate_data.yaml create mode 100644 python/cugraph/cugraph/datasets/metadata/karate_undirected.yaml create mode 100644 python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml create mode 100644 python/cugraph/cugraph/datasets/metadata/netscience.yaml create mode 100644 python/cugraph/cugraph/datasets/metadata/polbooks.yaml create mode 100644 python/cugraph/cugraph/datasets/metadata/small_line.yaml create mode 100644 python/cugraph/cugraph/datasets/metadata/small_tree.yaml create mode 100644 python/cugraph/cugraph/datasets/metadata/toy_graph.yaml create mode 100644 python/cugraph/cugraph/datasets/metadata/toy_graph_undirected.yaml diff --git a/python/cugraph/cugraph/__init__.py b/python/cugraph/cugraph/__init__.py index 3b9c4e007e2..4be27991823 100644 --- a/python/cugraph/cugraph/__init__.py +++ b/python/cugraph/cugraph/__init__.py @@ -120,4 +120,6 @@ from cugraph import exceptions +from cugraph import datasets + __version__ = "23.08.00" diff --git a/python/cugraph/cugraph/datasets/__init__.py b/python/cugraph/cugraph/datasets/__init__.py new file mode 100644 index 00000000000..d83c859c419 --- /dev/null +++ b/python/cugraph/cugraph/datasets/__init__.py @@ -0,0 +1,71 @@ +# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +from pathlib import Path + +# datasets module +from cugraph.datasets.dataset import ( + Dataset, + load_all, + set_download_dir, + get_download_dir, + default_download_dir +) +from cugraph.datasets import metadata + +# metadata path for .yaml files +meta_path = Path(__file__).parent / "metadata" + +# invidual datasets +karate = Dataset(meta_path / "karate.yaml") +karate_data = Dataset(meta_path / "karate_data.yaml") +karate_undirected = Dataset(meta_path / "karate_undirected.yaml") +karate_asymmetric = Dataset(meta_path / "karate_asymmetric.yaml") +karate_disjoint = Dataset(meta_path / "karate-disjoint.yaml") +dolphins = Dataset(meta_path / "dolphins.yaml") +polbooks = Dataset(meta_path / "polbooks.yaml") +netscience = Dataset(meta_path / "netscience.yaml") +cyber = Dataset(meta_path / "cyber.yaml") +small_line = Dataset(meta_path / "small_line.yaml") +small_tree = Dataset(meta_path / "small_tree.yaml") +toy_graph = Dataset(meta_path / "toy_graph.yaml") +toy_graph_undirected = Dataset(meta_path / "toy_graph_undirected.yaml") +email_Eu_core = Dataset(meta_path / "email-Eu-core.yaml") +ktruss_polbooks = Dataset(meta_path / "ktruss_polbooks.yaml") + +# batches +DATASETS_UNDIRECTED = [karate, dolphins] + +DATASETS_UNDIRECTED_WEIGHTS = [netscience] + +DATASETS_UNRENUMBERED = [karate_disjoint] + +DATASETS = [dolphins, netscience, karate_disjoint] + +DATASETS_SMALL = [karate, dolphins, polbooks] + +STRONGDATASETS = [dolphins, netscience, email_Eu_core] + +DATASETS_KTRUSS = [(polbooks, ktruss_polbooks)] + +MEDIUM_DATASETS = [polbooks] + +SMALL_DATASETS = [karate, dolphins, netscience] + +RLY_SMALL_DATASETS = [small_line, small_tree] + +ALL_DATASETS = [karate, dolphins, netscience, polbooks, small_line, small_tree] + +ALL_DATASETS_WGT = [karate, dolphins, netscience, polbooks, small_line, small_tree] + +TEST_GROUP = [dolphins, netscience] diff --git a/python/cugraph/cugraph/datasets/dataset.py b/python/cugraph/cugraph/datasets/dataset.py new file mode 100644 index 00000000000..6b395d50fef --- /dev/null +++ b/python/cugraph/cugraph/datasets/dataset.py @@ -0,0 +1,312 @@ +# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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 cudf +import yaml +import os +from pathlib import Path +from cugraph.structure.graph_classes import Graph + + +class DefaultDownloadDir: + """ + Maintains the path to the download directory used by Dataset instances. + Instances of this class are typically shared by several Dataset instances + in order to allow for the download directory to be defined and updated by + a single object. + """ + + def __init__(self): + self._path = Path( + os.environ.get("RAPIDS_DATASET_ROOT_DIR", Path.home() / ".cugraph/datasets") + ) + + @property + def path(self): + """ + If `path` is not set, set it to the environment variable + RAPIDS_DATASET_ROOT_DIR. If the variable is not set, default to the + user's home directory. + """ + if self._path is None: + self._path = Path( + os.environ.get( + "RAPIDS_DATASET_ROOT_DIR", Path.home() / ".cugraph/datasets" + ) + ) + return self._path + + @path.setter + def path(self, new): + self._path = Path(new) + + def clear(self): + self._path = None + + +default_download_dir = DefaultDownloadDir() + + +class Dataset: + """ + A Dataset Object, used to easily import edgelist data and cuGraph.Graph + instances. + + Parameters + ---------- + meta_data_file_name : yaml file + The metadata file for the specific graph dataset, which includes + information on the name, type, url link, data loading format, graph + properties + """ + + def __init__( + self, + metadata_yaml_file=None, + csv_file=None, + csv_header=None, + csv_delim=" ", + csv_col_names=None, + csv_col_dtypes=None, + ): + self._metadata_file = None + self._dl_path = default_download_dir + self._edgelist = None + self._path = None + + if metadata_yaml_file is not None and csv_file is not None: + raise ValueError("cannot specify both metadata_yaml_file and csv_file") + + elif metadata_yaml_file is not None: + with open(metadata_yaml_file, "r") as file: + self.metadata = yaml.safe_load(file) + self._metadata_file = Path(metadata_yaml_file) + + elif csv_file is not None: + if csv_col_names is None or csv_col_dtypes is None: + raise ValueError( + "csv_col_names and csv_col_dtypes must both be " + "not None when csv_file is specified." + ) + self._path = Path(csv_file) + if self._path.exists() is False: + raise FileNotFoundError(csv_file) + self.metadata = { + "name": self._path.with_suffix("").name, + "file_type": ".csv", + "url": None, + "header": csv_header, + "delim": csv_delim, + "col_names": csv_col_names, + "col_types": csv_col_dtypes, + } + + else: + raise ValueError("must specify either metadata_yaml_file or csv_file") + + def __str__(self): + """ + Use the basename of the meta_data_file the instance was constructed with, + without any extension, as the string repr. + """ + # The metadata file is likely to have a more descriptive file name, so + # use that one first if present. + # FIXME: this may need to provide a more unique or descriptive string repr + if self._metadata_file is not None: + return self._metadata_file.with_suffix("").name + else: + return self.get_path().with_suffix("").name + + def __download_csv(self, url): + """ + Downloads the .csv file from url to the current download path + (self._dl_path), updates self._path with the full path to the + downloaded file, and returns the latest value of self._path. + """ + self._dl_path.path.mkdir(parents=True, exist_ok=True) + + filename = self.metadata["name"] + self.metadata["file_type"] + if self._dl_path.path.is_dir(): + df = cudf.read_csv(url) + self._path = self._dl_path.path / filename + df.to_csv(self._path, index=False) + + else: + raise RuntimeError( + f"The directory {self._dl_path.path.absolute()}" "does not exist" + ) + return self._path + + def unload(self): + + """ + Remove all saved internal objects, forcing them to be re-created when + accessed. + + NOTE: This will cause calls to get_*() to re-read the dataset file from + disk. The caller should ensure the file on disk has not moved/been + deleted/changed. + """ + self._edgelist = None + + def get_edgelist(self, fetch=False): + """ + Return an Edgelist + + Parameters + ---------- + fetch : Boolean (default=False) + Automatically fetch for the dataset from the 'url' location within + the YAML file. + """ + if self._edgelist is None: + full_path = self.get_path() + if not full_path.is_file(): + if fetch: + full_path = self.__download_csv(self.metadata["url"]) + else: + raise RuntimeError( + f"The datafile {full_path} does not" + " exist. Try get_edgelist(fetch=True)" + " to download the datafile" + ) + header = None + if isinstance(self.metadata["header"], int): + header = self.metadata["header"] + self._edgelist = cudf.read_csv( + full_path, + delimiter=self.metadata["delim"], + names=self.metadata["col_names"], + dtype=self.metadata["col_types"], + header=header, + ) + + return self._edgelist + + def get_graph( + self, + fetch=False, + create_using=Graph, + ignore_weights=False, + store_transposed=False, + ): + """ + Return a Graph object. + + Parameters + ---------- + fetch : Boolean (default=False) + Downloads the dataset from the web. + + create_using: cugraph.Graph (instance or class), optional + (default=Graph) + Specify the type of Graph to create. Can pass in an instance to + create a Graph instance with specified 'directed' attribute. + + ignore_weights : Boolean (default=False) + Ignores weights in the dataset if True, resulting in an + unweighted Graph. If False (the default), weights from the + dataset -if present- will be applied to the Graph. If the + dataset does not contain weights, the Graph returned will + be unweighted regardless of ignore_weights. + """ + if self._edgelist is None: + self.get_edgelist(fetch) + + if create_using is None: + G = Graph() + elif isinstance(create_using, Graph): + # what about BFS if trnaposed is True + attrs = {"directed": create_using.is_directed()} + G = type(create_using)(**attrs) + elif type(create_using) is type: + G = create_using() + else: + raise TypeError( + "create_using must be a cugraph.Graph " + "(or subclass) type or instance, got: " + f"{type(create_using)}" + ) + + if len(self.metadata["col_names"]) > 2 and not (ignore_weights): + G.from_cudf_edgelist( + self._edgelist, + source="src", + destination="dst", + edge_attr="wgt", + store_transposed=store_transposed, + ) + else: + G.from_cudf_edgelist( + self._edgelist, + source="src", + destination="dst", + store_transposed=store_transposed, + ) + return G + + def get_path(self): + """ + Returns the location of the stored dataset file + """ + if self._path is None: + self._path = self._dl_path.path / ( + self.metadata["name"] + self.metadata["file_type"] + ) + + return self._path.absolute() + + +def load_all(force=False): + """ + Looks in `metadata` directory and fetches all datafiles from the the URLs + provided in each YAML file. + + Parameters + force : Boolean (default=False) + Overwrite any existing copies of datafiles. + """ + default_download_dir.path.mkdir(parents=True, exist_ok=True) + + meta_path = Path(__file__).parent.absolute() / "metadata" + for file in meta_path.iterdir(): + meta = None + if file.suffix == ".yaml": + with open(meta_path / file, "r") as metafile: + meta = yaml.safe_load(metafile) + + if "url" in meta: + filename = meta["name"] + meta["file_type"] + save_to = default_download_dir.path / filename + if not save_to.is_file() or force: + df = cudf.read_csv(meta["url"]) + df.to_csv(save_to, index=False) + + +def set_download_dir(path): + """ + Set the download directory for fetching datasets + + Parameters + ---------- + path : String + Location used to store datafiles + """ + if path is None: + default_download_dir.clear() + else: + default_download_dir.path = path + + +def get_download_dir(): + return default_download_dir.path.absolute() diff --git a/python/cugraph/cugraph/datasets/datasets_config.yaml b/python/cugraph/cugraph/datasets/datasets_config.yaml new file mode 100644 index 00000000000..69a79db9cd9 --- /dev/null +++ b/python/cugraph/cugraph/datasets/datasets_config.yaml @@ -0,0 +1,5 @@ +--- +fetch: "False" +force: "False" +# path where datasets will be downloaded to and stored +download_dir: "datasets" diff --git a/python/cugraph/cugraph/datasets/metadata/__init__.py b/python/cugraph/cugraph/datasets/metadata/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/python/cugraph/cugraph/datasets/metadata/cyber.yaml b/python/cugraph/cugraph/datasets/metadata/cyber.yaml new file mode 100644 index 00000000000..93ab5345442 --- /dev/null +++ b/python/cugraph/cugraph/datasets/metadata/cyber.yaml @@ -0,0 +1,22 @@ +name: cyber +file_type: .csv +author: N/A +url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/cyber.csv +refs: N/A +col_names: + - idx + - srcip + - dstip +col_types: + - int32 + - str + - str +delim: "," +header: 0 +has_loop: true +is_directed: true +is_multigraph: false +is_symmetric: false +number_of_edges: 2546575 +number_of_nodes: 706529 +number_of_lines: 2546576 diff --git a/python/cugraph/cugraph/datasets/metadata/dolphins.yaml b/python/cugraph/cugraph/datasets/metadata/dolphins.yaml new file mode 100644 index 00000000000..e4951375321 --- /dev/null +++ b/python/cugraph/cugraph/datasets/metadata/dolphins.yaml @@ -0,0 +1,25 @@ +name: dolphins +file_type: .csv +author: D. Lusseau +url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/dolphins.csv +refs: + D. Lusseau, K. Schneider, O. J. Boisseau, P. Haase, E. Slooten, and S. M. Dawson, + The bottlenose dolphin community of Doubtful Sound features a large proportion of + long-lasting associations, Behavioral Ecology and Sociobiology 54, 396-405 (2003). +col_names: + - src + - dst + - wgt +col_types: + - int32 + - int32 + - float32 +delim: " " +header: None +has_loop: false +is_directed: true +is_multigraph: false +is_symmetric: false +number_of_edges: 318 +number_of_nodes: 62 +number_of_lines: 318 diff --git a/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml b/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml new file mode 100644 index 00000000000..97d0dc82ee3 --- /dev/null +++ b/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml @@ -0,0 +1,22 @@ +name: email-Eu-core +file_type: .csv +author: null +url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/email-Eu-core.csv +refs: null +delim: " " +header: None +col_names: + - src + - dst + - wgt +col_types: + - int32 + - int32 + - float32 +has_loop: false +is_directed: false +is_multigraph: false +is_symmetric: true +number_of_edges: 25571 +number_of_nodes: 1005 +number_of_lines: 25571 diff --git a/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml b/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml new file mode 100644 index 00000000000..0c0eaf78b63 --- /dev/null +++ b/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml @@ -0,0 +1,22 @@ +name: karate-disjoint +file_type: .csv +author: null +url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/karate-disjoint.csv +refs: null +delim: " " +header: None +col_names: + - src + - dst + - wgt +col_types: + - int32 + - int32 + - float32 +has_loop: false +is_directed: True +is_multigraph: false +is_symmetric: true +number_of_edges: 312 +number_of_nodes: 68 +number_of_lines: 312 diff --git a/python/cugraph/cugraph/datasets/metadata/karate.yaml b/python/cugraph/cugraph/datasets/metadata/karate.yaml new file mode 100644 index 00000000000..273381ed368 --- /dev/null +++ b/python/cugraph/cugraph/datasets/metadata/karate.yaml @@ -0,0 +1,24 @@ +name: karate +file_type: .csv +author: Zachary W. +url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/karate.csv +refs: + W. W. Zachary, An information flow model for conflict and fission in small groups, + Journal of Anthropological Research 33, 452-473 (1977). +delim: " " +header: None +col_names: + - src + - dst + - wgt +col_types: + - int32 + - int32 + - float32 +has_loop: true +is_directed: true +is_multigraph: false +is_symmetric: true +number_of_edges: 156 +number_of_nodes: 34 +number_of_lines: 156 diff --git a/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml new file mode 100644 index 00000000000..3616b8fb3a5 --- /dev/null +++ b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml @@ -0,0 +1,24 @@ +name: karate-asymmetric +file_type: .csv +author: Zachary W. +url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/karate-asymmetric.csv +delim: " " +header: None +refs: + W. W. Zachary, An information flow model for conflict and fission in small groups, + Journal of Anthropological Research 33, 452-473 (1977). +col_names: + - src + - dst + - wgt +col_types: + - int32 + - int32 + - float32 +has_loop: true +is_directed: false +is_multigraph: false +is_symmetric: false +number_of_edges: 78 +number_of_nodes: 34 +number_of_lines: 78 diff --git a/python/cugraph/cugraph/datasets/metadata/karate_data.yaml b/python/cugraph/cugraph/datasets/metadata/karate_data.yaml new file mode 100644 index 00000000000..9a8b27f21ae --- /dev/null +++ b/python/cugraph/cugraph/datasets/metadata/karate_data.yaml @@ -0,0 +1,22 @@ +name: karate-data +file_type: .csv +author: Zachary W. +url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/karate-data.csv +refs: + W. W. Zachary, An information flow model for conflict and fission in small groups, + Journal of Anthropological Research 33, 452-473 (1977). +delim: "\t" +header: None +col_names: + - src + - dst +col_types: + - int32 + - int32 +has_loop: true +is_directed: true +is_multigraph: false +is_symmetric: true +number_of_edges: 156 +number_of_nodes: 34 +number_of_lines: 156 diff --git a/python/cugraph/cugraph/datasets/metadata/karate_undirected.yaml b/python/cugraph/cugraph/datasets/metadata/karate_undirected.yaml new file mode 100644 index 00000000000..1b45f86caee --- /dev/null +++ b/python/cugraph/cugraph/datasets/metadata/karate_undirected.yaml @@ -0,0 +1,22 @@ +name: karate_undirected +file_type: .csv +author: Zachary W. +url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/karate_undirected.csv +refs: + W. W. Zachary, An information flow model for conflict and fission in small groups, + Journal of Anthropological Research 33, 452-473 (1977). +delim: "\t" +header: None +col_names: + - src + - dst +col_types: + - int32 + - int32 +has_loop: true +is_directed: false +is_multigraph: false +is_symmetric: true +number_of_edges: 78 +number_of_nodes: 34 +number_of_lines: 78 diff --git a/python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml b/python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml new file mode 100644 index 00000000000..1ef29b3917e --- /dev/null +++ b/python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml @@ -0,0 +1,23 @@ +name: ktruss_polbooks +file_type: .csv +author: null +url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/ref/ktruss/polbooks.csv +refs: null +delim: " " +header: None +col_names: + - src + - dst + - wgt +col_types: + - int32 + - int32 + - float32 +has_loop: false +is_directed: true +is_multigraph: false +is_symmetric: false +number_of_edges: 233 +number_of_nodes: 58 +number_of_lines: 233 + diff --git a/python/cugraph/cugraph/datasets/metadata/netscience.yaml b/python/cugraph/cugraph/datasets/metadata/netscience.yaml new file mode 100644 index 00000000000..2dca702df3d --- /dev/null +++ b/python/cugraph/cugraph/datasets/metadata/netscience.yaml @@ -0,0 +1,22 @@ +name: netscience +file_type: .csv +author: Newman, Mark EJ +url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/netscience.csv +refs: Finding community structure in networks using the eigenvectors of matrices. +delim: " " +header: None +col_names: + - src + - dst + - wgt +col_types: + - int32 + - int32 + - float32 +has_loop: false +is_directed: true +is_multigraph: false +is_symmetric: true +number_of_edges: 2742 +number_of_nodes: 1461 +number_of_lines: 5484 diff --git a/python/cugraph/cugraph/datasets/metadata/polbooks.yaml b/python/cugraph/cugraph/datasets/metadata/polbooks.yaml new file mode 100644 index 00000000000..5816e5672fd --- /dev/null +++ b/python/cugraph/cugraph/datasets/metadata/polbooks.yaml @@ -0,0 +1,22 @@ +name: polbooks +file_type: .csv +author: V. Krebs +url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/polbooks.csv +refs: null +delim: " " +header: None +col_names: + - src + - dst + - wgt +col_types: + - int32 + - int32 + - float32 +is_directed: true +has_loop: null +is_multigraph: null +is_symmetric: true +number_of_edges: 882 +number_of_nodes: 105 +number_of_lines: 882 diff --git a/python/cugraph/cugraph/datasets/metadata/small_line.yaml b/python/cugraph/cugraph/datasets/metadata/small_line.yaml new file mode 100644 index 00000000000..5b724ac99fd --- /dev/null +++ b/python/cugraph/cugraph/datasets/metadata/small_line.yaml @@ -0,0 +1,22 @@ +name: small_line +file_type: .csv +author: null +url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/small_line.csv +refs: null +delim: " " +header: None +col_names: + - src + - dst + - wgt +col_types: + - int32 + - int32 + - float32 +has_loop: false +is_directed: false +is_multigraph: false +is_symmetric: true +number_of_edges: 9 +number_of_nodes: 10 +number_of_lines: 8 diff --git a/python/cugraph/cugraph/datasets/metadata/small_tree.yaml b/python/cugraph/cugraph/datasets/metadata/small_tree.yaml new file mode 100644 index 00000000000..8eeac346d2a --- /dev/null +++ b/python/cugraph/cugraph/datasets/metadata/small_tree.yaml @@ -0,0 +1,22 @@ +name: small_tree +file_type: .csv +author: null +url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/small_tree.csv +refs: null +delim: " " +header: None +col_names: + - src + - dst + - wgt +col_types: + - int32 + - int32 + - float32 +has_loop: false +is_directed: true +is_multigraph: false +is_symmetric: true +number_of_edges: 11 +number_of_nodes: 9 +number_of_lines: 11 diff --git a/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml b/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml new file mode 100644 index 00000000000..819aad06f6a --- /dev/null +++ b/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml @@ -0,0 +1,22 @@ +name: toy_graph +file_type: .csv +author: null +url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/toy_graph.csv +refs: null +delim: " " +header: None +col_names: + - src + - dst + - wgt +col_types: + - int32 + - int32 + - float32 +has_loop: false +is_directed: false +is_multigraph: false +is_symmetric: true +number_of_edges: 16 +number_of_nodes: 6 +number_of_lines: 16 diff --git a/python/cugraph/cugraph/datasets/metadata/toy_graph_undirected.yaml b/python/cugraph/cugraph/datasets/metadata/toy_graph_undirected.yaml new file mode 100644 index 00000000000..c6e86bdf334 --- /dev/null +++ b/python/cugraph/cugraph/datasets/metadata/toy_graph_undirected.yaml @@ -0,0 +1,22 @@ +name: toy_graph_undirected +file_type: .csv +author: null +url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/toy_graph_undirected.csv +refs: null +delim: " " +header: None +col_names: + - src + - dst + - wgt +col_types: + - int32 + - int32 + - float32 +has_loop: false +is_directed: false +is_multigraph: false +is_symmetric: true +number_of_edges: 8 +number_of_nodes: 6 +number_of_lines: 8 From 5dbca1422ac0a688f90f3ad1b10ec27179ea0c98 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Thu, 29 Jun 2023 07:43:17 -0700 Subject: [PATCH 02/57] add promoted_experimental_warning_wrapper to dataset --- python/cugraph/cugraph/experimental/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/cugraph/cugraph/experimental/__init__.py b/python/cugraph/cugraph/experimental/__init__.py index 2adfb84868e..61093f46058 100644 --- a/python/cugraph/cugraph/experimental/__init__.py +++ b/python/cugraph/cugraph/experimental/__init__.py @@ -50,6 +50,8 @@ from cugraph.experimental.datasets.dataset import Dataset +Dataset = promoted_experimental_warning_wrapper(Dataset) + from cugraph.experimental.link_prediction.jaccard import ( EXPERIMENTAL__jaccard, EXPERIMENTAL__jaccard_coefficient, From 4182d2e5c5b0a28b08d6e29df8c92528d1cc8c0b Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Thu, 29 Jun 2023 08:41:20 -0700 Subject: [PATCH 03/57] pre-commit style fix --- python/cugraph/cugraph/datasets/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/cugraph/cugraph/datasets/__init__.py b/python/cugraph/cugraph/datasets/__init__.py index d83c859c419..d95a7683e1b 100644 --- a/python/cugraph/cugraph/datasets/__init__.py +++ b/python/cugraph/cugraph/datasets/__init__.py @@ -19,7 +19,7 @@ load_all, set_download_dir, get_download_dir, - default_download_dir + default_download_dir, ) from cugraph.datasets import metadata From a5348a127078daba5e7740b0808fdc0fdf919bb6 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Thu, 29 Jun 2023 13:03:04 -0700 Subject: [PATCH 04/57] Update notebooks to use stable datasets api --- .../algorithms/centrality/Betweenness.ipynb | 23 ++++++-- .../algorithms/centrality/Centrality.ipynb | 23 +++++++- notebooks/algorithms/centrality/Degree.ipynb | 58 +++++++++---------- .../algorithms/centrality/Eigenvector.ipynb | 51 ++++++++-------- notebooks/algorithms/centrality/Katz.ipynb | 22 +++++-- notebooks/algorithms/community/ECG.ipynb | 13 ++++- notebooks/algorithms/community/Louvain.ipynb | 13 ++++- .../community/Spectral-Clustering.ipynb | 26 +++++++-- .../community/Subgraph-Extraction.ipynb | 20 +++++-- .../community/Triangle-Counting.ipynb | 28 +++++---- notebooks/algorithms/community/ktruss.ipynb | 17 +++++- .../components/ConnectedComponents.ipynb | 22 ++++++- notebooks/algorithms/cores/core-number.ipynb | 14 ++++- notebooks/algorithms/cores/kcore.ipynb | 56 +++++++----------- .../algorithms/layout/Force-Atlas2.ipynb | 20 +++++-- notebooks/algorithms/link_analysis/HITS.ipynb | 19 +++++- .../algorithms/link_analysis/Pagerank.ipynb | 22 ++++++- .../link_prediction/Jaccard-Similarity.ipynb | 31 ++++++++-- .../link_prediction/Overlap-Similarity.ipynb | 30 ++++++++-- .../algorithms/sampling/RandomWalk.ipynb | 11 +++- .../algorithms/structure/Renumber-2.ipynb | 16 ++++- notebooks/algorithms/structure/Renumber.ipynb | 17 +++++- .../algorithms/structure/Symmetrize.ipynb | 10 +++- notebooks/algorithms/traversal/BFS.ipynb | 12 +++- notebooks/algorithms/traversal/SSSP.ipynb | 11 +++- 25 files changed, 416 insertions(+), 169 deletions(-) diff --git a/notebooks/algorithms/centrality/Betweenness.ipynb b/notebooks/algorithms/centrality/Betweenness.ipynb index 82b7b4bc29e..a0ca0b70c31 100644 --- a/notebooks/algorithms/centrality/Betweenness.ipynb +++ b/notebooks/algorithms/centrality/Betweenness.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -13,10 +14,12 @@ "| Brad Rees | 04/24/2019 | created | 0.15 | GV100, CUDA 11.0\n", "| Brad Rees | 08/16/2020 | tested / updated | 21.10 nightly | RTX 3090 CUDA 11.4\n", "| Don Acosta | 07/05/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5\n", - "| Ralph Liu | 07/26/2022 | updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5" + "| Ralph Liu | 07/26/2022 | updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5\n", + "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -28,6 +31,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -37,6 +41,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -71,6 +76,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -82,6 +88,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -98,6 +105,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -115,7 +123,7 @@ "import cudf\n", "\n", "# Import a built-in dataset\n", - "from cugraph.experimental.datasets import karate" + "from cugraph.datasets import karate" ] }, { @@ -129,6 +137,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -146,6 +155,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -173,6 +183,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -203,6 +214,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -210,6 +222,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -267,6 +280,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -274,11 +288,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "___\n", - "Copyright (c) 2019-2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2019-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", @@ -303,7 +318,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.7" + "version": "3.10.12" }, "vscode": { "interpreter": { diff --git a/notebooks/algorithms/centrality/Centrality.ipynb b/notebooks/algorithms/centrality/Centrality.ipynb index 8406ef96da6..2b8e14f4ca7 100644 --- a/notebooks/algorithms/centrality/Centrality.ipynb +++ b/notebooks/algorithms/centrality/Centrality.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -8,6 +9,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -18,10 +20,12 @@ "| Brad Rees | 04/16/2021 | created | 0.19 | GV100, CUDA 11.0\n", "| Brad Rees | 08/05/2021 | tested / updated | 21.10 nightly | RTX 3090 CUDA 11.4\n", "| Don Acosta | 07/29/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5\n", + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", " " ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -90,6 +94,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -97,6 +102,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -120,7 +126,7 @@ "# Import the cugraph modules\n", "import cugraph\n", "import cudf\n", - "from cugraph.experimental.datasets import karate" + "from cugraph.datasets import karate" ] }, { @@ -136,6 +142,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -198,6 +205,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -207,6 +215,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -224,6 +233,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -240,6 +250,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -258,6 +269,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -316,6 +328,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -324,6 +337,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -373,6 +387,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -389,6 +404,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -396,11 +412,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "----\n", - "Copyright (c) 2019-2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2019-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", @@ -424,7 +441,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.10.12" }, "vscode": { "interpreter": { diff --git a/notebooks/algorithms/centrality/Degree.ipynb b/notebooks/algorithms/centrality/Degree.ipynb index bb3779d9980..e3682e6fd36 100644 --- a/notebooks/algorithms/centrality/Degree.ipynb +++ b/notebooks/algorithms/centrality/Degree.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -10,10 +11,12 @@ "\n", "| Author Credit | Date | Update | cuGraph Version | Test Hardware |\n", "| --------------|------------|------------------|-----------------|----------------|\n", - "| Don Acosta | 07/05/2022 | created | 22.08 nightly | DGX Tesla V100 CUDA 11.5" + "| Don Acosta | 07/05/2022 | created | 22.08 nightly | DGX Tesla V100 CUDA 11.5\n", + "| Ralph Liu | 06/29/2023 | updated w/ `datasets` api | 23.08 nightly | DGX Tesla V100 CUDA 11.5" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -25,6 +28,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -34,6 +38,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -54,6 +59,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -64,6 +70,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -80,6 +87,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -87,6 +95,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [] @@ -113,10 +122,11 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ - "### Some Prep" + "### Get Dataset" ] }, { @@ -125,30 +135,11 @@ "metadata": {}, "outputs": [], "source": [ - "# Define the path to the test data \n", - "datafile='../../data/karate-data.csv'" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Read in the data - GPU\n", - "cuGraph depends on cuDF for data loading and the initial Dataframe creation\n", - "\n", - "The data file contains an edge list, which represents the connection of a vertex to another. The `source` to `destination` pairs is in what is known as Coordinate Format (COO). In this test case, the data is just two columns. However a third, `weight`, column is also possible" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "gdf = cudf.read_csv(datafile, delimiter='\\t', names=['src', 'dst'], dtype=['int32', 'int32'] )" + "from cugraph.datasets import karate" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -161,12 +152,11 @@ "metadata": {}, "outputs": [], "source": [ - "# create a Graph using the source (src) and destination (dst) vertex pairs from the Dataframe \n", - "G = cugraph.Graph()\n", - "G.from_cudf_edgelist(gdf, source='src', destination='dst')" + "G = karate.get_graph()" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -184,6 +174,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -230,6 +221,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -237,6 +229,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -249,6 +242,9 @@ "metadata": {}, "outputs": [], "source": [ + "# Define the path to the test data \n", + "datafile='../../data/karate-data.csv'\n", + "\n", "# Read the data, this also created a NetworkX Graph \n", "file = open(datafile, 'rb')\n", "Gnx = nx.read_edgelist(file)" @@ -274,18 +270,22 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ - "As mentioned, the scores are different but the ranking is the same." + "As mentioned, the scores are different but the ranking is the same.\n", + "\n", + "*note: the 0th node from cuGraph is equivalent to the 1st node in NetworkX*" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "___\n", - "Copyright (c) 2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2022-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", @@ -310,7 +310,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.13" + "version": "3.10.12" }, "vscode": { "interpreter": { diff --git a/notebooks/algorithms/centrality/Eigenvector.ipynb b/notebooks/algorithms/centrality/Eigenvector.ipynb index c7fc3506c89..0f23da1396c 100644 --- a/notebooks/algorithms/centrality/Eigenvector.ipynb +++ b/notebooks/algorithms/centrality/Eigenvector.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -14,6 +15,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -27,6 +29,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -42,6 +45,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -78,6 +82,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -88,6 +93,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -104,6 +110,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -133,6 +140,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -145,11 +153,11 @@ "metadata": {}, "outputs": [], "source": [ - "# Define the path to the test data \n", - "datafile='../../data/karate-data.csv'" + "from cugraph.datasets import karate_data" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -169,25 +177,7 @@ ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Read in the data - GPU\n", - "cuGraph depends on cuDF for data loading and the initial Dataframe creation\n", - "\n", - "The data file contains an edge list, which represents the connection of a vertex to another. The `source` to `destination` pairs is in what is known as Coordinate Format (COO). In this test case, the data is just two columns. However a third, `weight`, column is also possible" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "gdf = cudf.read_csv(datafile, delimiter='\\t', names=['src', 'dst'], dtype=['int32', 'int32'] )" - ] - }, - { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -200,12 +190,11 @@ "metadata": {}, "outputs": [], "source": [ - "# create a Graph using the source (src) and destination (dst) vertex pairs from the Dataframe \n", - "G = cugraph.Graph(directed=True)\n", - "G.from_cudf_edgelist(gdf, source='src', destination='dst')" + "G = karate_data.get_graph(fetch=True)" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -223,6 +212,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -230,6 +220,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -237,6 +228,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -249,12 +241,16 @@ "metadata": {}, "outputs": [], "source": [ + "# Define the path to the test data \n", + "datafile='../../data/karate-data.csv'\n", + "\n", "# Read the data, this also created a NetworkX Graph \n", "file = open(datafile, 'rb')\n", "Gnx = nx.read_edgelist(file)" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -273,6 +269,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -291,6 +288,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -298,11 +296,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "___\n", - "Copyright (c) 2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2022-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", @@ -327,7 +326,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.13" + "version": "3.10.12" }, "vscode": { "interpreter": { diff --git a/notebooks/algorithms/centrality/Katz.ipynb b/notebooks/algorithms/centrality/Katz.ipynb index b62cea2df82..5e39f7ce9c2 100755 --- a/notebooks/algorithms/centrality/Katz.ipynb +++ b/notebooks/algorithms/centrality/Katz.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -13,10 +14,12 @@ "| Brad Rees | 10/15/2019 | created | 0.14 | GV100, CUDA 10.2\n", "| Brad Rees | 08/16/2020 | tested / updated | 0.15.1 nightly | RTX 3090 CUDA 11.4\n", "| Don Acosta | 07/05/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5\n", - "| Ralph Liu | 07/26/2022 | updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5" + "| Ralph Liu | 07/26/2022 | updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5\n", + "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -67,6 +70,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -77,6 +81,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -93,6 +98,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -110,7 +116,7 @@ "import cudf\n", "\n", "# Import a built-in dataset\n", - "from cugraph.experimental.datasets import karate" + "from cugraph.datasets import karate" ] }, { @@ -124,6 +130,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -145,6 +152,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -182,6 +190,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -208,6 +217,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -229,6 +239,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -236,6 +247,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -282,6 +294,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -308,11 +321,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "___\n", - "Copyright (c) 2019-2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2019-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", @@ -337,7 +351,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.7" + "version": "3.10.12" }, "vscode": { "interpreter": { diff --git a/notebooks/algorithms/community/ECG.ipynb b/notebooks/algorithms/community/ECG.ipynb index 829be21035c..9550cb61b5f 100644 --- a/notebooks/algorithms/community/ECG.ipynb +++ b/notebooks/algorithms/community/ECG.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -14,6 +15,7 @@ "| | 08/05/2021 | tested/updated | 21.10 nightly | RTX 3090 CUDA 11.4 |\n", "| Don Acosta | 07/20/2022 | tested/updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", "| Ralph Liu | 07/26/2022 | updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", + "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", "\n", "## Introduction\n", "\n", @@ -62,6 +64,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -73,6 +76,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -88,6 +92,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -105,10 +110,11 @@ "import cudf\n", "\n", "# Import a built-in dataset\n", - "from cugraph.experimental.datasets import karate" + "from cugraph.datasets import karate" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -204,11 +210,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "___\n", - "Copyright (c) 2019-2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2019-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", @@ -233,7 +240,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.7" + "version": "3.10.12" }, "vscode": { "interpreter": { diff --git a/notebooks/algorithms/community/Louvain.ipynb b/notebooks/algorithms/community/Louvain.ipynb index a8529483534..4c1ddc61b1d 100755 --- a/notebooks/algorithms/community/Louvain.ipynb +++ b/notebooks/algorithms/community/Louvain.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -16,6 +17,7 @@ "| | 08/05/2021 | tested / updated | 21.10 nightly | RTX 3090 CUDA 11.4 |\n", "| Don Acosta | 07/11/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", "| Ralph Liu | 07/26/2022 | updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", + "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", "\n", "\n", "\n", @@ -101,6 +103,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -112,6 +115,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -127,6 +131,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -144,10 +149,11 @@ "import cudf\n", "\n", "# Import a built-in dataset\n", - "from cugraph.experimental.datasets import karate" + "from cugraph.datasets import karate" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -295,11 +301,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "___\n", - "Copyright (c) 2019-2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2019-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", @@ -324,7 +331,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.7" + "version": "3.10.12" }, "vscode": { "interpreter": { diff --git a/notebooks/algorithms/community/Spectral-Clustering.ipynb b/notebooks/algorithms/community/Spectral-Clustering.ipynb index 2ac1b9e8c16..295e7ba8da8 100755 --- a/notebooks/algorithms/community/Spectral-Clustering.ipynb +++ b/notebooks/algorithms/community/Spectral-Clustering.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -14,10 +15,12 @@ "| Brad Rees and James Wyles | 08/01/2019 | created | 0.14 | GV100 32G, CUDA 10.2 |\n", "| | 08/16/2020 | updated | 0.15 | GV100 32G, CUDA 10.2 |\n", "| Don Acosta | 07/11/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", - "| Ralph Liu | 07/26/2022 | updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |" + "| Ralph Liu | 07/26/2022 | updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", + "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -36,6 +39,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -76,6 +80,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -111,6 +116,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -122,6 +128,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -141,7 +148,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -151,10 +158,11 @@ "import numpy as np\n", "\n", "# Import a built-in dataset\n", - "from cugraph.experimental.datasets import karate" + "from cugraph.datasets import karate" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -163,7 +171,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -194,6 +202,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -212,6 +221,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -236,6 +246,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -296,6 +307,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -355,6 +367,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -362,11 +375,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "___\n", - "Copyright (c) 2019-2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2019-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", @@ -391,7 +405,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.9" + "version": "3.10.12" }, "vscode": { "interpreter": { diff --git a/notebooks/algorithms/community/Subgraph-Extraction.ipynb b/notebooks/algorithms/community/Subgraph-Extraction.ipynb index fb7708d1462..14a97e900cd 100755 --- a/notebooks/algorithms/community/Subgraph-Extraction.ipynb +++ b/notebooks/algorithms/community/Subgraph-Extraction.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -14,10 +15,12 @@ "| Brad Rees | 10/16/2019 | created | 0.13 | GV100 32G, CUDA 10.2 |\n", "| | 08/16/2020 | updated | 0.15 | GV100 32G, CUDA 10.2 |\n", "| Don Acosta | 07/11/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", - "| Ralph Liu | 07/26/2022 | updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |" + "| Ralph Liu | 07/26/2022 | updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", + "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -43,6 +46,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -54,6 +58,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -66,6 +71,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -83,10 +89,11 @@ "import cudf\n", "\n", "# Import a built-in dataset\n", - "from cugraph.experimental.datasets import karate" + "from cugraph.datasets import karate" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -94,6 +101,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -162,6 +170,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -239,11 +248,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "___\n", - "Copyright (c) 2019-2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2019-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", @@ -268,7 +278,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.7" + "version": "3.10.12" }, "vscode": { "interpreter": { @@ -278,4 +288,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -} \ No newline at end of file +} diff --git a/notebooks/algorithms/community/Triangle-Counting.ipynb b/notebooks/algorithms/community/Triangle-Counting.ipynb index b55c835cf4f..4e3f0a5aad7 100755 --- a/notebooks/algorithms/community/Triangle-Counting.ipynb +++ b/notebooks/algorithms/community/Triangle-Counting.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -15,6 +16,7 @@ "| | 08/16/2020 | updated | 0.15 | GV100 32G, CUDA 10.2 |\n", "| Don Acosta | 07/11/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", "| Ralph Liu | 07/27/2022 | updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", + "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", "\n", "## Introduction\n", "Triangle Counting, as the name implies, finds the number of triangles in a graph. Triangles are important in computing the clustering Coefficient and can be used for clustering. \n", @@ -52,6 +54,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -63,6 +66,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -76,6 +80,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -94,7 +99,7 @@ "from collections import OrderedDict\n", "\n", "# Import a built-in dataset\n", - "from cugraph.experimental.datasets import karate" + "from cugraph.datasets import karate" ] }, { @@ -110,6 +115,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -183,6 +189,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -192,6 +199,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -199,6 +207,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -216,6 +225,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -233,13 +243,7 @@ ] }, { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -258,6 +262,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -267,11 +272,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "___\n", - "Copyright (c) 2019-2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2019-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", @@ -296,7 +302,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13-final" + "version": "3.10.12" }, "vscode": { "interpreter": { @@ -306,4 +312,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -} \ No newline at end of file +} diff --git a/notebooks/algorithms/community/ktruss.ipynb b/notebooks/algorithms/community/ktruss.ipynb index 3c96f7ff5a7..7d926dfc88f 100644 --- a/notebooks/algorithms/community/ktruss.ipynb +++ b/notebooks/algorithms/community/ktruss.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -15,6 +16,7 @@ "| | 08/05/2021 | tested/updated | 21.10 nightly | RTX 3090 CUDA 11.4 |\n", "| Don Acosta | 07/08/2022 | tested/updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", "| Ralph Liu | 07/26/2022 | updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", + "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", "## Introduction\n", "\n", "Compute the k-truss of the graph G. A K-Truss is a relaxed cliques where every vertex is supported by at least k-2 triangle.\n", @@ -37,6 +39,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -59,6 +62,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -70,6 +74,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -83,6 +88,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -100,10 +106,11 @@ "import cudf\n", "\n", "# Import a built-in dataset\n", - "from cugraph.experimental.datasets import karate" + "from cugraph.datasets import karate" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -133,6 +140,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -161,6 +169,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -200,6 +209,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -229,11 +239,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "___\n", - "Copyright (c) 2019-2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2019-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", @@ -258,7 +269,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.7" + "version": "3.10.12" }, "vscode": { "interpreter": { diff --git a/notebooks/algorithms/components/ConnectedComponents.ipynb b/notebooks/algorithms/components/ConnectedComponents.ipynb index 5f18352647f..5b030e4b093 100755 --- a/notebooks/algorithms/components/ConnectedComponents.ipynb +++ b/notebooks/algorithms/components/ConnectedComponents.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -22,6 +23,7 @@ "| Brad Rees | 10/18/2021 | updated | 21.12 nightly | GV100, CUDA 11.4 |\n", "| Ralph Liu | 06/22/2022 | updated/tested | 22.08 | TV100, CUDA 11.5 |\n", "| Don Acosta | 07/22/2021 | updated | 22.08 nightly | DGX Tesla V100, CUDA 11.5 |\n", + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", "\n", "\n", "\n", @@ -90,6 +92,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -100,6 +103,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -129,6 +133,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -141,10 +146,11 @@ "metadata": {}, "outputs": [], "source": [ - "from cugraph.experimental.datasets import netscience" + "from cugraph.datasets import netscience" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -161,6 +167,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -179,6 +186,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -199,6 +207,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -220,6 +229,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -243,6 +253,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -261,6 +272,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -280,6 +292,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -300,6 +313,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -323,6 +337,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -333,11 +348,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "___\n", - "Copyright (c) 2019-2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2019-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", @@ -362,7 +378,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.7" + "version": "3.10.12" }, "vscode": { "interpreter": { diff --git a/notebooks/algorithms/cores/core-number.ipynb b/notebooks/algorithms/cores/core-number.ipynb index 06fe570d390..4d71189a8e8 100755 --- a/notebooks/algorithms/cores/core-number.ipynb +++ b/notebooks/algorithms/cores/core-number.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -17,6 +18,7 @@ "| Brad Rees | 10/28/2019 | created | 0.13 | GV100, CUDA 10.2 |\n", "| Don Acosta | 07/21/2022 | updated/tested | 22.08 nightly | DGX Tesla V100, CUDA 11.5 |\n", "| Ralph Liu | 07/26/2022 | updated/tested | 22.08 nightly | DGX Tesla V100, CUDA 11.5 |\n", + "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", "\n", "## Introduction\n", "\n", @@ -41,6 +43,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -51,6 +54,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -64,6 +68,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -81,10 +86,11 @@ "import cudf\n", "\n", "# import a built-in dataset\n", - "from cugraph.experimental.datasets import karate" + "from cugraph.datasets import karate" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -102,6 +108,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -128,11 +135,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "___\n", - "Copyright (c) 2019-2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2019-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", @@ -157,7 +165,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.7" + "version": "3.10.12" }, "vscode": { "interpreter": { diff --git a/notebooks/algorithms/cores/kcore.ipynb b/notebooks/algorithms/cores/kcore.ipynb index 065f02ffd98..1e83311cf19 100755 --- a/notebooks/algorithms/cores/kcore.ipynb +++ b/notebooks/algorithms/cores/kcore.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -18,6 +19,7 @@ "| Brad Rees | 08/16/2020 | created | 0.15 | GV100, CUDA 10.2 |\n", "| Don Acosta | 07/21/2022 | updated/tested | 22.08 nightly | DGX Tesla V100, CUDA 11.5 |\n", "| Ralph Liu | 07/26/2022 | updated/tested | 22.08 nightly | DGX Tesla V100, CUDA 11.5 |\n", + "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", "\n", "## Introduction\n", "\n", @@ -41,6 +43,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -51,6 +54,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -64,6 +68,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -72,7 +77,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -81,10 +86,11 @@ "import cudf\n", "\n", "# Import a built-in dataset\n", - "from cugraph.experimental.datasets import karate" + "from cugraph.datasets import karate" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -93,7 +99,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -103,19 +109,9 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Main Graph\n", - "\tNumber of Vertices: 34\n", - "\tNumber of Edges: 156\n" - ] - } - ], + "outputs": [], "source": [ "print(\"Main Graph\")\n", "print(\"\\tNumber of Vertices: \" + str(G.number_of_vertices()))\n", @@ -123,6 +119,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -131,25 +128,9 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "ename": "RuntimeError", - "evalue": "non-success value returned from cugraph_core_number: CUGRAPH_UNKNOWN_ERROR", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mRuntimeError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m/home/nfs/ralphl/datasets-api/notebooks/algorithms/cores/kcore.ipynb Cell 10\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[39m# Call k-cores on the graph\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m kcg \u001b[39m=\u001b[39m cugraph\u001b[39m.\u001b[39;49mk_core(G)\n", - "File \u001b[0;32m~/miniconda3/envs/cugraph_dev/lib/python3.9/site-packages/cugraph-22.2.0a0+366.gabd2f0ef-py3.9-linux-x86_64.egg/cugraph/cores/k_core.py:103\u001b[0m, in \u001b[0;36mk_core\u001b[0;34m(G, k, core_number)\u001b[0m\n\u001b[1;32m 99\u001b[0m core_number \u001b[39m=\u001b[39m G\u001b[39m.\u001b[39madd_internal_vertex_id(core_number, \u001b[39m'\u001b[39m\u001b[39mvertex\u001b[39m\u001b[39m'\u001b[39m,\n\u001b[1;32m 100\u001b[0m cols)\n\u001b[1;32m 102\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[0;32m--> 103\u001b[0m core_number \u001b[39m=\u001b[39m _call_plc_core_number(G)\n\u001b[1;32m 104\u001b[0m core_number \u001b[39m=\u001b[39m core_number\u001b[39m.\u001b[39mrename(\n\u001b[1;32m 105\u001b[0m columns\u001b[39m=\u001b[39m{\u001b[39m\"\u001b[39m\u001b[39mcore_number\u001b[39m\u001b[39m\"\u001b[39m: \u001b[39m\"\u001b[39m\u001b[39mvalues\u001b[39m\u001b[39m\"\u001b[39m}, copy\u001b[39m=\u001b[39m\u001b[39mFalse\u001b[39;00m\n\u001b[1;32m 106\u001b[0m )\n\u001b[1;32m 108\u001b[0m \u001b[39mif\u001b[39;00m k \u001b[39mis\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n", - "File \u001b[0;32m~/miniconda3/envs/cugraph_dev/lib/python3.9/site-packages/cugraph-22.2.0a0+366.gabd2f0ef-py3.9-linux-x86_64.egg/cugraph/cores/k_core.py:27\u001b[0m, in \u001b[0;36m_call_plc_core_number\u001b[0;34m(G)\u001b[0m\n\u001b[1;32m 25\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m_call_plc_core_number\u001b[39m(G):\n\u001b[1;32m 26\u001b[0m vertex, core_number \u001b[39m=\u001b[39m \\\n\u001b[0;32m---> 27\u001b[0m pylibcugraph_core_number(\n\u001b[1;32m 28\u001b[0m resource_handle\u001b[39m=\u001b[39;49mResourceHandle(),\n\u001b[1;32m 29\u001b[0m graph\u001b[39m=\u001b[39;49mG\u001b[39m.\u001b[39;49m_plc_graph,\n\u001b[1;32m 30\u001b[0m degree_type\u001b[39m=\u001b[39;49m\u001b[39mNone\u001b[39;49;00m,\n\u001b[1;32m 31\u001b[0m do_expensive_check\u001b[39m=\u001b[39;49m\u001b[39mFalse\u001b[39;49;00m\n\u001b[1;32m 32\u001b[0m )\n\u001b[1;32m 34\u001b[0m df \u001b[39m=\u001b[39m cudf\u001b[39m.\u001b[39mDataFrame()\n\u001b[1;32m 35\u001b[0m df[\u001b[39m\"\u001b[39m\u001b[39mvertex\u001b[39m\u001b[39m\"\u001b[39m] \u001b[39m=\u001b[39m vertex\n", - "File \u001b[0;32mcore_number.pyx:124\u001b[0m, in \u001b[0;36mpylibcugraph.core_number.core_number\u001b[0;34m()\u001b[0m\n", - "File \u001b[0;32mutils.pyx:51\u001b[0m, in \u001b[0;36mpylibcugraph.utils.assert_success\u001b[0;34m()\u001b[0m\n", - "\u001b[0;31mRuntimeError\u001b[0m: non-success value returned from cugraph_core_number: CUGRAPH_UNKNOWN_ERROR" - ] - } - ], + "outputs": [], "source": [ "# Call k-cores on the graph\n", "kcg = cugraph.k_core(G) " @@ -167,6 +148,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -186,6 +168,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -194,6 +177,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -221,6 +205,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -261,11 +246,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "___\n", - "Copyright (c) 2019-2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2019-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", @@ -290,7 +276,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.10.12" }, "vscode": { "interpreter": { diff --git a/notebooks/algorithms/layout/Force-Atlas2.ipynb b/notebooks/algorithms/layout/Force-Atlas2.ipynb index a0dafbef511..8fa28a9904a 100644 --- a/notebooks/algorithms/layout/Force-Atlas2.ipynb +++ b/notebooks/algorithms/layout/Force-Atlas2.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -9,6 +10,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -21,10 +23,12 @@ "| Hugo Linsenmaier | 11/16/2020 | created | 0.17 | GV100, CUDA 11.0\n", "| Brad Rees | 01/11/2022 | tested / updated | 22.02 nightly | RTX A6000 CUDA 11.5\n", "| Ralph Liu | 06/22/2022 | updated/tested | 22.08 | TV100, CUDA 11.5\n", - "| Don Acosta | 08/01/2022 | tested / updated | 22.08 nightly | DGX Tesla A100 CUDA 11.5 " + "| Don Acosta | 08/01/2022 | tested / updated | 22.08 nightly | DGX Tesla A100 CUDA 11.5 \n", + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -32,6 +36,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -52,7 +57,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -102,7 +107,7 @@ "outputs": [], "source": [ "# Import a built-in dataset\n", - "from cugraph.experimental.datasets import netscience" + "from cugraph.datasets import netscience" ] }, { @@ -122,6 +127,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -139,6 +145,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -171,6 +178,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -200,6 +208,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -219,10 +228,11 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ - "Copyright (c) 2020 - 2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2020 - 2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", @@ -246,7 +256,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.10.12" }, "vscode": { "interpreter": { diff --git a/notebooks/algorithms/link_analysis/HITS.ipynb b/notebooks/algorithms/link_analysis/HITS.ipynb index 9578377b747..5004bea889c 100755 --- a/notebooks/algorithms/link_analysis/HITS.ipynb +++ b/notebooks/algorithms/link_analysis/HITS.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -15,6 +16,7 @@ "| | 08/16/2020 | tested / updated | 0.15.1 nightly | RTX 3090 CUDA 11.4\n", "| Ralph Liu | 06/22/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5\n", "| Don Acosta | 07/27/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5\n", + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", "\n", "## Introduction\n", "HITS, also known as hubs and authorities, computes the relative importance of vertices. \n", @@ -36,6 +38,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -71,6 +74,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -84,6 +88,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -124,6 +129,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -137,10 +143,11 @@ "outputs": [], "source": [ "# Import a built-in dataset\n", - "from cugraph.experimental.datasets import karate" + "from cugraph.datasets import karate" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -179,6 +186,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -189,6 +197,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -196,6 +205,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -212,6 +222,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -229,6 +240,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -288,6 +300,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -315,6 +328,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -340,11 +354,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "___\n", - "Copyright (c) 2019-2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2019-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", diff --git a/notebooks/algorithms/link_analysis/Pagerank.ipynb b/notebooks/algorithms/link_analysis/Pagerank.ipynb index 6b78f5866d9..08c99317131 100755 --- a/notebooks/algorithms/link_analysis/Pagerank.ipynb +++ b/notebooks/algorithms/link_analysis/Pagerank.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": { "tags": [] @@ -16,6 +17,7 @@ "| | 04/06/2022 | tested / updated | 22.04 nightly | GV100 32G, CUDA 11.5\n", "| Ralph Liu | 06/22/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5\n", "| Don Acosta | 07/27/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5\n", + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", "\n", "## Introduction\n", "Pagerank is measure of the relative importance, also called centrality, of a vertex based on the relative importance of it's neighbors. PageRank was developed by Google and is (was) used to rank it's search results. PageRank uses the connectivity information of a graph to rank the importance of each vertex. \n", @@ -43,6 +45,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -56,6 +59,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -99,6 +103,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -124,10 +129,11 @@ "outputs": [], "source": [ "# Import a built-in dataset\n", - "from cugraph.experimental.datasets import karate" + "from cugraph.datasets import karate" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -166,6 +172,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -176,6 +183,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -183,6 +191,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -199,6 +208,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -216,6 +226,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -248,6 +259,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -288,6 +300,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -317,6 +330,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -343,6 +357,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -350,6 +365,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -358,6 +374,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -406,11 +423,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "___\n", - "Copyright (c) 2019-2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2019-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", diff --git a/notebooks/algorithms/link_prediction/Jaccard-Similarity.ipynb b/notebooks/algorithms/link_prediction/Jaccard-Similarity.ipynb index 146a17af58f..2cdec51112c 100755 --- a/notebooks/algorithms/link_prediction/Jaccard-Similarity.ipynb +++ b/notebooks/algorithms/link_prediction/Jaccard-Similarity.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -18,10 +19,12 @@ "| Author Credit | Date | Update | cuGraph Version | Test Hardware |\n", "| --------------|------------|------------------|-----------------|-----------------------|\n", "| Brad Rees | 10/14/2019 | created | 0.14 | GV100 32 GB, CUDA 10.2 |\n", - "| Don Acosta | 07/20/2022 | tested/updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |" + "| Don Acosta | 07/20/2022 | tested/updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -34,6 +37,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -41,6 +45,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -69,6 +74,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -77,6 +83,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -111,6 +118,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -119,6 +127,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -129,6 +138,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -143,6 +153,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -165,6 +176,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -212,6 +224,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -226,7 +239,7 @@ "outputs": [], "source": [ "# Test file \n", - "from cugraph.experimental.datasets import karate\n", + "from cugraph.datasets import karate\n", "gdf = karate.get_edgelist(fetch=True)" ] }, @@ -251,6 +264,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -279,6 +293,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -290,6 +305,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -319,6 +335,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -354,6 +371,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -391,6 +409,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -398,6 +417,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -405,6 +425,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -432,6 +453,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -459,13 +481,14 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "---\n", "### It's that easy with cuGraph\n", "\n", - "Copyright (c) 2019-2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2019-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", @@ -500,4 +523,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -} \ No newline at end of file +} diff --git a/notebooks/algorithms/link_prediction/Overlap-Similarity.ipynb b/notebooks/algorithms/link_prediction/Overlap-Similarity.ipynb index 8ed7aca1f24..344feaf7e4f 100755 --- a/notebooks/algorithms/link_prediction/Overlap-Similarity.ipynb +++ b/notebooks/algorithms/link_prediction/Overlap-Similarity.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -18,10 +19,12 @@ "| | 08/16/2020 | upadated | 0.12 | GV100, CUDA 10.0 |\n", "| | 08/05/2021 | tested / updated | 21.10 nightly | RTX 3090 CUDA 11.4 |\n", "| Ralph Liu | 06/22/2022 | updated/tested | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", - "| Don Acosta | 08/03/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |" + "| Don Acosta | 08/03/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -34,6 +37,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -42,6 +46,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -68,6 +73,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -96,6 +102,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -105,6 +112,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -116,6 +124,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -131,6 +140,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -152,6 +162,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -238,6 +249,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -250,7 +262,7 @@ "metadata": {}, "outputs": [], "source": [ - "from cugraph.experimental.datasets import karate\n", + "from cugraph.datasets import karate\n", "gdf = karate.get_edgelist(fetch=True)" ] }, @@ -275,6 +287,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -303,6 +316,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -332,6 +346,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -367,6 +382,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -375,6 +391,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -417,6 +434,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -424,6 +442,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -473,6 +492,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -480,6 +500,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -566,11 +587,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "___\n", - "Copyright (c) 2019-2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2019-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", @@ -605,4 +627,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -} \ No newline at end of file +} diff --git a/notebooks/algorithms/sampling/RandomWalk.ipynb b/notebooks/algorithms/sampling/RandomWalk.ipynb index 687e55c0b16..58a92733a88 100644 --- a/notebooks/algorithms/sampling/RandomWalk.ipynb +++ b/notebooks/algorithms/sampling/RandomWalk.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -14,11 +15,13 @@ "| Brad Rees | 04/20/2021 | created | 0.19 | GV100, CUDA 11.0\n", "| Ralph Liu | 06/22/2022 | updated/tested | 22.08 | TV100, CUDA 11.5\n", "| Don Acosta | 08/28/2022 | updated/tested | 22.10 | TV100, CUDA 11.5\n", + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", "\n", "Currently NetworkX does not have a random walk function. There is code on StackOverflow that generates a random walk by getting a vertex and then randomly selecting a neighbor and then repeating the process. " ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -45,7 +48,7 @@ "import cudf\n", "\n", "# Import a built-in dataset\n", - "from cugraph.experimental.datasets import karate" + "from cugraph.datasets import karate" ] }, { @@ -117,6 +120,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -153,11 +157,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "-----\n", - "Copyright (c) 2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2022-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", @@ -191,4 +196,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -} \ No newline at end of file +} diff --git a/notebooks/algorithms/structure/Renumber-2.ipynb b/notebooks/algorithms/structure/Renumber-2.ipynb index 6a52632b38a..8b6d275c281 100755 --- a/notebooks/algorithms/structure/Renumber-2.ipynb +++ b/notebooks/algorithms/structure/Renumber-2.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -20,6 +21,7 @@ "| Brad Rees | 07/08/2020 | updated | 0.15 | GV100, CUDA 11.0\n", "| Ralph Liu | 06/22/2022 | docs & code change | 22.08 | TV100, CUDA 11.5\n", "| Don Acosta | 08/28/2022 | updated/tested | 22.10 | TV100, CUDA 11.5\n", + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", "\n", "\n", "## Introduction\n", @@ -42,6 +44,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -50,6 +53,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -77,11 +81,12 @@ "outputs": [], "source": [ "# Import a built-in dataset\n", - "from cugraph.experimental.datasets import cyber\n", + "from cugraph.datasets import cyber\n", "gdf = cyber.get_edgelist(fetch=True)" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -128,6 +133,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -137,6 +143,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -170,6 +177,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -192,6 +200,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -214,11 +223,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "___\n", - "Copyright (c) 2019-2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2019-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", @@ -253,4 +263,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -} \ No newline at end of file +} diff --git a/notebooks/algorithms/structure/Renumber.ipynb b/notebooks/algorithms/structure/Renumber.ipynb index 13b1eeba074..b6cca6591d7 100755 --- a/notebooks/algorithms/structure/Renumber.ipynb +++ b/notebooks/algorithms/structure/Renumber.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -36,6 +37,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -59,6 +61,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -88,6 +91,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -113,6 +117,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -139,6 +144,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -159,6 +165,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -177,6 +184,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -206,6 +214,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -235,6 +244,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -257,6 +267,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -288,6 +299,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -319,11 +331,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "___\n", - "Copyright (c) 2019-2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2019-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", @@ -358,4 +371,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -} \ No newline at end of file +} diff --git a/notebooks/algorithms/structure/Symmetrize.ipynb b/notebooks/algorithms/structure/Symmetrize.ipynb index 0357a2737b1..3884636244c 100755 --- a/notebooks/algorithms/structure/Symmetrize.ipynb +++ b/notebooks/algorithms/structure/Symmetrize.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -14,6 +15,7 @@ "| Brad Rees and James Wyles | 08/13/2019 | created | 0.10 | GV100, CUDA 11.0\n", "| Brad Rees | 06/22/2020 | updated | 0.15 | GV100, CUDA 11.0\n", "| Don Acosta | 08/28/2022 | updated/tested | 22.10 | TV100, CUDA 11.5\n", + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", "\n", "\n", "## Introduction\n", @@ -35,6 +37,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -77,7 +80,7 @@ "outputs": [], "source": [ "# Import a built-in dataset\n", - "from cugraph.experimental.datasets import karate\n", + "from cugraph.datasets import karate\n", "\n", "# This is the symmetrized dataset\n", "test_gdf = karate.get_edgelist(fetch=True)" @@ -96,6 +99,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -126,6 +130,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -156,11 +161,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "---\n", - "Copyright (c) 2019-2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2019-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", diff --git a/notebooks/algorithms/traversal/BFS.ipynb b/notebooks/algorithms/traversal/BFS.ipynb index 7c4b87f30c3..f9dd3d2e53d 100755 --- a/notebooks/algorithms/traversal/BFS.ipynb +++ b/notebooks/algorithms/traversal/BFS.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -14,6 +15,7 @@ "| Brad Rees and James Wyles | 08/13/2019 | created | 0.10 | GV100, CUDA 11.0\n", "| Ralph Liu | 06/22/2020 | updated | 22.08 | GV100, CUDA 11.0\n", "| Don Acosta | 08/28/2022 | updated/tested | 22.10 | TV100, CUDA 11.5\n", + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", "\n", "## Introduction\n", "\n", @@ -44,6 +46,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -86,6 +89,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -99,7 +103,7 @@ "outputs": [], "source": [ "# Import a built-in dataset\n", - "from cugraph.experimental.datasets import karate\n", + "from cugraph.datasets import karate\n", "\n", "gdf = karate.get_edgelist(fetch=True)" ] @@ -115,6 +119,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -172,6 +177,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -200,6 +206,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -248,11 +255,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "___\n", - "Copyright (c) 2019-2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2019-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", diff --git a/notebooks/algorithms/traversal/SSSP.ipynb b/notebooks/algorithms/traversal/SSSP.ipynb index 0b5ff3d0932..06ff4381dbb 100755 --- a/notebooks/algorithms/traversal/SSSP.ipynb +++ b/notebooks/algorithms/traversal/SSSP.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -14,6 +15,7 @@ "| Brad Rees and James Wyles | 08/13/2019 | created | 0.10 | GV100, CUDA 11.0\n", "| Ralph Liu | 06/22/2022 | updated | 22.08 | GV100, CUDA 11.0\n", "| Don Acosta | 08/28/2022 | updated/tested | 22.10 | TV100, CUDA 11.5\n", + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", "\n", "## Introduction\n", "\n", @@ -41,6 +43,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -68,6 +71,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -81,7 +85,7 @@ "outputs": [], "source": [ "# Import a built-in dataset\n", - "from cugraph.experimental.datasets import karate\n", + "from cugraph.datasets import karate\n", "\n", "gdf = karate.get_edgelist(fetch=True)" ] @@ -106,6 +110,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -147,6 +152,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -154,11 +160,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "___\n", - "Copyright (c) 2019-2022, NVIDIA CORPORATION.\n", + "Copyright (c) 2019-2023, NVIDIA CORPORATION.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n", "\n", From 01d4e7bd4572b39ffd0d6ce8323a225675cfd6a9 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Fri, 30 Jun 2023 05:52:22 -0700 Subject: [PATCH 05/57] Update docstrings to use stable datasets api --- .../cugraph/centrality/betweenness_centrality.py | 4 ++-- python/cugraph/cugraph/centrality/degree_centrality.py | 2 +- .../cugraph/centrality/eigenvector_centrality.py | 2 +- python/cugraph/cugraph/centrality/katz_centrality.py | 2 +- python/cugraph/cugraph/community/ecg.py | 2 +- python/cugraph/cugraph/community/egonet.py | 4 ++-- python/cugraph/cugraph/community/induced_subgraph.py | 2 +- python/cugraph/cugraph/community/ktruss_subgraph.py | 6 +++--- python/cugraph/cugraph/community/leiden.py | 2 +- python/cugraph/cugraph/community/louvain.py | 4 ++-- .../cugraph/cugraph/community/spectral_clustering.py | 10 +++++----- .../cugraph/cugraph/community/subgraph_extraction.py | 2 +- python/cugraph/cugraph/components/connectivity.py | 6 +++--- python/cugraph/cugraph/cores/core_number.py | 4 ++-- python/cugraph/cugraph/cores/k_core.py | 4 ++-- .../cugraph/experimental/link_prediction/jaccard.py | 6 +++--- .../cugraph/experimental/link_prediction/overlap.py | 4 ++-- .../cugraph/experimental/link_prediction/sorensen.py | 4 ++-- .../cugraph/cugraph/gnn/data_loading/bulk_sampler.py | 2 +- python/cugraph/cugraph/layout/force_atlas2.py | 4 ++-- python/cugraph/cugraph/link_analysis/hits.py | 4 ++-- python/cugraph/cugraph/link_analysis/pagerank.py | 2 +- python/cugraph/cugraph/link_prediction/jaccard.py | 8 ++++---- python/cugraph/cugraph/link_prediction/overlap.py | 4 ++-- python/cugraph/cugraph/link_prediction/sorensen.py | 4 ++-- python/cugraph/cugraph/link_prediction/wjaccard.py | 4 ++-- python/cugraph/cugraph/link_prediction/woverlap.py | 2 +- python/cugraph/cugraph/link_prediction/wsorensen.py | 2 +- python/cugraph/cugraph/sampling/node2vec.py | 2 +- python/cugraph/cugraph/sampling/random_walks.py | 2 +- python/cugraph/cugraph/traversal/bfs.py | 4 ++-- python/cugraph/cugraph/traversal/sssp.py | 2 +- python/cugraph/cugraph/tree/minimum_spanning_tree.py | 6 +++--- 33 files changed, 61 insertions(+), 61 deletions(-) diff --git a/python/cugraph/cugraph/centrality/betweenness_centrality.py b/python/cugraph/cugraph/centrality/betweenness_centrality.py index 56fa7fea9a7..222ff4c6465 100644 --- a/python/cugraph/cugraph/centrality/betweenness_centrality.py +++ b/python/cugraph/cugraph/centrality/betweenness_centrality.py @@ -122,7 +122,7 @@ def betweenness_centrality( Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> bc = cugraph.betweenness_centrality(G) @@ -289,7 +289,7 @@ def edge_betweenness_centrality( Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> bc = cugraph.edge_betweenness_centrality(G) diff --git a/python/cugraph/cugraph/centrality/degree_centrality.py b/python/cugraph/cugraph/centrality/degree_centrality.py index 66946afded2..b368673067b 100644 --- a/python/cugraph/cugraph/centrality/degree_centrality.py +++ b/python/cugraph/cugraph/centrality/degree_centrality.py @@ -45,7 +45,7 @@ def degree_centrality(G, normalized=True): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> dc = cugraph.degree_centrality(G) diff --git a/python/cugraph/cugraph/centrality/eigenvector_centrality.py b/python/cugraph/cugraph/centrality/eigenvector_centrality.py index 07cbfefaaf1..860422871e0 100644 --- a/python/cugraph/cugraph/centrality/eigenvector_centrality.py +++ b/python/cugraph/cugraph/centrality/eigenvector_centrality.py @@ -68,7 +68,7 @@ def eigenvector_centrality(G, max_iter=100, tol=1.0e-6): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> ec = cugraph.eigenvector_centrality(G) diff --git a/python/cugraph/cugraph/centrality/katz_centrality.py b/python/cugraph/cugraph/centrality/katz_centrality.py index ffede18b5d2..153810f1a82 100644 --- a/python/cugraph/cugraph/centrality/katz_centrality.py +++ b/python/cugraph/cugraph/centrality/katz_centrality.py @@ -105,7 +105,7 @@ def katz_centrality( Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> kc = cugraph.katz_centrality(G) diff --git a/python/cugraph/cugraph/community/ecg.py b/python/cugraph/cugraph/community/ecg.py index e59f3dcb1b7..c3f7de9f9a4 100644 --- a/python/cugraph/cugraph/community/ecg.py +++ b/python/cugraph/cugraph/community/ecg.py @@ -65,7 +65,7 @@ def ecg(input_graph, min_weight=0.05, ensemble_size=16, weight=None): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> parts = cugraph.ecg(G) diff --git a/python/cugraph/cugraph/community/egonet.py b/python/cugraph/cugraph/community/egonet.py index 684ae92febd..ccdf174615c 100644 --- a/python/cugraph/cugraph/community/egonet.py +++ b/python/cugraph/cugraph/community/egonet.py @@ -86,7 +86,7 @@ def ego_graph(G, n, radius=1, center=True, undirected=None, distance=None): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> ego_graph = cugraph.ego_graph(G, 1, radius=2) @@ -190,7 +190,7 @@ def batched_ego_graphs(G, seeds, radius=1, center=True, undirected=None, distanc Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> b_ego_graph, offsets = cugraph.batched_ego_graphs(G, seeds=[1,5], ... radius=2) diff --git a/python/cugraph/cugraph/community/induced_subgraph.py b/python/cugraph/cugraph/community/induced_subgraph.py index d82e9d466a8..e9fb95f4c02 100644 --- a/python/cugraph/cugraph/community/induced_subgraph.py +++ b/python/cugraph/cugraph/community/induced_subgraph.py @@ -91,7 +91,7 @@ def induced_subgraph( Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> verts = np.zeros(3, dtype=np.int32) >>> verts[0] = 0 diff --git a/python/cugraph/cugraph/community/ktruss_subgraph.py b/python/cugraph/cugraph/community/ktruss_subgraph.py index 134df98f496..a0af11f2535 100644 --- a/python/cugraph/cugraph/community/ktruss_subgraph.py +++ b/python/cugraph/cugraph/community/ktruss_subgraph.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2022, NVIDIA CORPORATION. +# Copyright (c) 2019-2023, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -69,7 +69,7 @@ def k_truss(G, k): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> k_subgraph = cugraph.k_truss(G, 3) @@ -150,7 +150,7 @@ def ktruss_subgraph(G, k, use_weights=True): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> k_subgraph = cugraph.ktruss_subgraph(G, 3) diff --git a/python/cugraph/cugraph/community/leiden.py b/python/cugraph/cugraph/community/leiden.py index 1caa5476623..f7359324d4a 100644 --- a/python/cugraph/cugraph/community/leiden.py +++ b/python/cugraph/cugraph/community/leiden.py @@ -94,7 +94,7 @@ def leiden( Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> parts, modularity_score = cugraph.leiden(G) diff --git a/python/cugraph/cugraph/community/louvain.py b/python/cugraph/cugraph/community/louvain.py index a313aa44048..462c842b17f 100644 --- a/python/cugraph/cugraph/community/louvain.py +++ b/python/cugraph/cugraph/community/louvain.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2022, NVIDIA CORPORATION. +# Copyright (c) 2019-2023, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -69,7 +69,7 @@ def louvain(G, max_iter=100, resolution=1.0): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> parts = cugraph.louvain(G) diff --git a/python/cugraph/cugraph/community/spectral_clustering.py b/python/cugraph/cugraph/community/spectral_clustering.py index 5116d4c8fdf..0f10d672a70 100644 --- a/python/cugraph/cugraph/community/spectral_clustering.py +++ b/python/cugraph/cugraph/community/spectral_clustering.py @@ -81,7 +81,7 @@ def spectralBalancedCutClustering( Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> df = cugraph.spectralBalancedCutClustering(G, 5) @@ -178,7 +178,7 @@ def spectralModularityMaximizationClustering( Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> df = cugraph.spectralModularityMaximizationClustering(G, 5) @@ -254,7 +254,7 @@ def analyzeClustering_modularity( Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> df = cugraph.spectralBalancedCutClustering(G, 5) >>> score = cugraph.analyzeClustering_modularity(G, 5, df) @@ -336,7 +336,7 @@ def analyzeClustering_edge_cut( Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> df = cugraph.spectralBalancedCutClustering(G, 5) >>> score = cugraph.analyzeClustering_edge_cut(G, 5, df) @@ -416,7 +416,7 @@ def analyzeClustering_ratio_cut( Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> df = cugraph.spectralBalancedCutClustering(G, 5) >>> score = cugraph.analyzeClustering_ratio_cut(G, 5, df, 'vertex', diff --git a/python/cugraph/cugraph/community/subgraph_extraction.py b/python/cugraph/cugraph/community/subgraph_extraction.py index 601b6365e5d..2a76c8d00ba 100644 --- a/python/cugraph/cugraph/community/subgraph_extraction.py +++ b/python/cugraph/cugraph/community/subgraph_extraction.py @@ -57,7 +57,7 @@ def subgraph( Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> verts = np.zeros(3, dtype=np.int32) >>> verts[0] = 0 diff --git a/python/cugraph/cugraph/components/connectivity.py b/python/cugraph/cugraph/components/connectivity.py index e235c6c92d4..4d5d362b1d0 100644 --- a/python/cugraph/cugraph/components/connectivity.py +++ b/python/cugraph/cugraph/components/connectivity.py @@ -169,7 +169,7 @@ def weakly_connected_components(G, directed=None, connection=None, return_labels Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> df = cugraph.weakly_connected_components(G) @@ -278,7 +278,7 @@ def strongly_connected_components( Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> df = cugraph.strongly_connected_components(G) @@ -387,7 +387,7 @@ def connected_components(G, directed=None, connection="weak", return_labels=None Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> df = cugraph.connected_components(G, connection="weak") diff --git a/python/cugraph/cugraph/cores/core_number.py b/python/cugraph/cugraph/cores/core_number.py index 84153632f58..31414e77839 100644 --- a/python/cugraph/cugraph/cores/core_number.py +++ b/python/cugraph/cugraph/cores/core_number.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2022, NVIDIA CORPORATION. +# Copyright (c) 2019-2023, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -55,7 +55,7 @@ def core_number(G, degree_type="bidirectional"): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> df = cugraph.core_number(G) diff --git a/python/cugraph/cugraph/cores/k_core.py b/python/cugraph/cugraph/cores/k_core.py index b1cc796a7dd..c651ce155ff 100644 --- a/python/cugraph/cugraph/cores/k_core.py +++ b/python/cugraph/cugraph/cores/k_core.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2022, NVIDIA CORPORATION. +# Copyright (c) 2019-2023, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -82,7 +82,7 @@ def k_core(G, k=None, core_number=None, degree_type="bidirectional"): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> KCoreGraph = cugraph.k_core(G) diff --git a/python/cugraph/cugraph/experimental/link_prediction/jaccard.py b/python/cugraph/cugraph/experimental/link_prediction/jaccard.py index 29f2f3ffe16..81aa871c59d 100644 --- a/python/cugraph/cugraph/experimental/link_prediction/jaccard.py +++ b/python/cugraph/cugraph/experimental/link_prediction/jaccard.py @@ -80,7 +80,7 @@ def EXPERIMENTAL__jaccard(G, vertex_pair=None, use_weight=False): you can get the interesting (non-zero) values that are part of the networkx solution by doing the following: - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True, ignore_weights=True) >>> pairs = G.get_two_hop_neighbors() >>> df = cugraph.jaccard(G, pairs) @@ -130,7 +130,7 @@ def EXPERIMENTAL__jaccard(G, vertex_pair=None, use_weight=False): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> from cugraph.experimental import jaccard as exp_jaccard >>> G = karate.get_graph(fetch=True, ignore_weights=True) >>> df = exp_jaccard(G) @@ -230,7 +230,7 @@ def EXPERIMENTAL__jaccard_coefficient(G, ebunch=None, use_weight=False): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> from cugraph.experimental import jaccard_coefficient as exp_jaccard_coefficient >>> G = karate.get_graph(fetch=True, ignore_weights=True) >>> df = exp_jaccard_coefficient(G) diff --git a/python/cugraph/cugraph/experimental/link_prediction/overlap.py b/python/cugraph/cugraph/experimental/link_prediction/overlap.py index f0c320be26b..61f6e488a56 100644 --- a/python/cugraph/cugraph/experimental/link_prediction/overlap.py +++ b/python/cugraph/cugraph/experimental/link_prediction/overlap.py @@ -86,7 +86,7 @@ def EXPERIMENTAL__overlap_coefficient(G, ebunch=None, use_weight=False): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> from cugraph.experimental import overlap_coefficient as exp_overlap_coefficient >>> G = karate.get_graph(fetch=True, ignore_weights=True) >>> df = exp_overlap_coefficient(G) @@ -164,7 +164,7 @@ def EXPERIMENTAL__overlap(G, vertex_pair=None, use_weight=False): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> from cugraph.experimental import overlap as exp_overlap >>> G = karate.get_graph(fetch=True, ignore_weights=True) >>> df = exp_overlap(G) diff --git a/python/cugraph/cugraph/experimental/link_prediction/sorensen.py b/python/cugraph/cugraph/experimental/link_prediction/sorensen.py index c6fdc1ee422..5f72962c4d9 100644 --- a/python/cugraph/cugraph/experimental/link_prediction/sorensen.py +++ b/python/cugraph/cugraph/experimental/link_prediction/sorensen.py @@ -98,7 +98,7 @@ def EXPERIMENTAL__sorensen(G, vertex_pair=None, use_weight=False): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> from cugraph.experimental import sorensen as exp_sorensen >>> G = karate.get_graph(fetch=True, ignore_weights=True) >>> df = exp_sorensen(G) @@ -196,7 +196,7 @@ def EXPERIMENTAL__sorensen_coefficient(G, ebunch=None, use_weight=False): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> from cugraph.experimental import sorensen_coefficient as exp_sorensen_coef >>> G = karate.get_graph(fetch=True, ignore_weights=True) >>> df = exp_sorensen_coef(G) diff --git a/python/cugraph/cugraph/gnn/data_loading/bulk_sampler.py b/python/cugraph/cugraph/gnn/data_loading/bulk_sampler.py index 33de5fdc185..727e5f879bc 100644 --- a/python/cugraph/cugraph/gnn/data_loading/bulk_sampler.py +++ b/python/cugraph/cugraph/gnn/data_loading/bulk_sampler.py @@ -124,7 +124,7 @@ def add_batches( -------- >>> import cudf >>> from cugraph.experimental.gnn import BulkSampler - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> import tempfile >>> df = cudf.DataFrame({ ... "start_vid": [0, 4, 2, 3, 9, 11], diff --git a/python/cugraph/cugraph/layout/force_atlas2.py b/python/cugraph/cugraph/layout/force_atlas2.py index fb000feea89..b45e166b4e0 100644 --- a/python/cugraph/cugraph/layout/force_atlas2.py +++ b/python/cugraph/cugraph/layout/force_atlas2.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2023, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -123,7 +123,7 @@ def on_train_end(self, positions): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> pos = cugraph.force_atlas2(G) diff --git a/python/cugraph/cugraph/link_analysis/hits.py b/python/cugraph/cugraph/link_analysis/hits.py index fd3313ef86c..2280eaaed74 100644 --- a/python/cugraph/cugraph/link_analysis/hits.py +++ b/python/cugraph/cugraph/link_analysis/hits.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022, NVIDIA CORPORATION. +# Copyright (c) 2022-2023, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -75,7 +75,7 @@ def hits(G, max_iter=100, tol=1.0e-5, nstart=None, normalized=True): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> hits = cugraph.hits(G, max_iter = 50) diff --git a/python/cugraph/cugraph/link_analysis/pagerank.py b/python/cugraph/cugraph/link_analysis/pagerank.py index d2b827fa7c8..8664b34825c 100644 --- a/python/cugraph/cugraph/link_analysis/pagerank.py +++ b/python/cugraph/cugraph/link_analysis/pagerank.py @@ -207,7 +207,7 @@ def pagerank( Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> pr = cugraph.pagerank(G, alpha = 0.85, max_iter = 500, tol = 1.0e-05) """ diff --git a/python/cugraph/cugraph/link_prediction/jaccard.py b/python/cugraph/cugraph/link_prediction/jaccard.py index 1c4fed7a8f9..e6427015d88 100644 --- a/python/cugraph/cugraph/link_prediction/jaccard.py +++ b/python/cugraph/cugraph/link_prediction/jaccard.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2022, NVIDIA CORPORATION. +# Copyright (c) 2019-2023, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -54,7 +54,7 @@ def jaccard(input_graph, vertex_pair=None): you can get the interesting (non-zero) values that are part of the networkx solution by doing the following: - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> pairs = G.get_two_hop_neighbors() >>> df = cugraph.jaccard(G, pairs) @@ -99,7 +99,7 @@ def jaccard(input_graph, vertex_pair=None): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> df = cugraph.jaccard(G) @@ -159,7 +159,7 @@ def jaccard_coefficient(G, ebunch=None): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> df = cugraph.jaccard_coefficient(G) diff --git a/python/cugraph/cugraph/link_prediction/overlap.py b/python/cugraph/cugraph/link_prediction/overlap.py index ba9f225062e..803476c42c3 100644 --- a/python/cugraph/cugraph/link_prediction/overlap.py +++ b/python/cugraph/cugraph/link_prediction/overlap.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2022, NVIDIA CORPORATION. +# Copyright (c) 2019-2023, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -85,7 +85,7 @@ def overlap(input_graph, vertex_pair=None): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> df = cugraph.overlap(G) diff --git a/python/cugraph/cugraph/link_prediction/sorensen.py b/python/cugraph/cugraph/link_prediction/sorensen.py index 20238e10464..226cc63c4bd 100644 --- a/python/cugraph/cugraph/link_prediction/sorensen.py +++ b/python/cugraph/cugraph/link_prediction/sorensen.py @@ -71,7 +71,7 @@ def sorensen(input_graph, vertex_pair=None): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> df = cugraph.sorensen(G) @@ -132,7 +132,7 @@ def sorensen_coefficient(G, ebunch=None): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> df = cugraph.sorensen_coefficient(G) diff --git a/python/cugraph/cugraph/link_prediction/wjaccard.py b/python/cugraph/cugraph/link_prediction/wjaccard.py index b8ef33d926f..1fca1027fb0 100644 --- a/python/cugraph/cugraph/link_prediction/wjaccard.py +++ b/python/cugraph/cugraph/link_prediction/wjaccard.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2022, NVIDIA CORPORATION. +# Copyright (c) 2019-2023, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -70,7 +70,7 @@ def jaccard_w(input_graph, weights, vertex_pair=None): Examples -------- >>> import random - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> # Create a dataframe containing the vertices with their >>> # corresponding weight diff --git a/python/cugraph/cugraph/link_prediction/woverlap.py b/python/cugraph/cugraph/link_prediction/woverlap.py index c7d4f56a428..1d50132303d 100644 --- a/python/cugraph/cugraph/link_prediction/woverlap.py +++ b/python/cugraph/cugraph/link_prediction/woverlap.py @@ -72,7 +72,7 @@ def overlap_w(input_graph, weights, vertex_pair=None): Examples -------- >>> import random - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> # Create a dataframe containing the vertices with their >>> # corresponding weight diff --git a/python/cugraph/cugraph/link_prediction/wsorensen.py b/python/cugraph/cugraph/link_prediction/wsorensen.py index c017463a294..9a1d11ee544 100644 --- a/python/cugraph/cugraph/link_prediction/wsorensen.py +++ b/python/cugraph/cugraph/link_prediction/wsorensen.py @@ -68,7 +68,7 @@ def sorensen_w(input_graph, weights, vertex_pair=None): Examples -------- >>> import random - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> # Create a dataframe containing the vertices with their >>> # corresponding weight diff --git a/python/cugraph/cugraph/sampling/node2vec.py b/python/cugraph/cugraph/sampling/node2vec.py index 247989648f3..c9fadeca7a8 100644 --- a/python/cugraph/cugraph/sampling/node2vec.py +++ b/python/cugraph/cugraph/sampling/node2vec.py @@ -78,7 +78,7 @@ def node2vec(G, start_vertices, max_depth=1, compress_result=True, p=1.0, q=1.0) Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> start_vertices = cudf.Series([0, 2], dtype=np.int32) >>> paths, weights, path_sizes = cugraph.node2vec(G, start_vertices, 3, diff --git a/python/cugraph/cugraph/sampling/random_walks.py b/python/cugraph/cugraph/sampling/random_walks.py index a5e2a0371b3..fa7ebbd5b2c 100644 --- a/python/cugraph/cugraph/sampling/random_walks.py +++ b/python/cugraph/cugraph/sampling/random_walks.py @@ -114,7 +114,7 @@ def random_walks( Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> M = karate.get_edgelist(fetch=True) >>> G = karate.get_graph() >>> start_vertices = G.nodes()[:4] diff --git a/python/cugraph/cugraph/traversal/bfs.py b/python/cugraph/cugraph/traversal/bfs.py index f2c1f5c5662..46090f36001 100644 --- a/python/cugraph/cugraph/traversal/bfs.py +++ b/python/cugraph/cugraph/traversal/bfs.py @@ -197,7 +197,7 @@ def bfs( Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> df = cugraph.bfs(G, 0) @@ -315,7 +315,7 @@ def bfs_edges(G, source, reverse=False, depth_limit=None, sort_neighbors=None): Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> df = cugraph.bfs_edges(G, 0) diff --git a/python/cugraph/cugraph/traversal/sssp.py b/python/cugraph/cugraph/traversal/sssp.py index c2705b70383..afb0ac912eb 100644 --- a/python/cugraph/cugraph/traversal/sssp.py +++ b/python/cugraph/cugraph/traversal/sssp.py @@ -198,7 +198,7 @@ def sssp( Examples -------- - >>> from cugraph.experimental.datasets import karate + >>> from cugraph.datasets import karate >>> G = karate.get_graph(fetch=True) >>> distances = cugraph.sssp(G, 0) >>> distances diff --git a/python/cugraph/cugraph/tree/minimum_spanning_tree.py b/python/cugraph/cugraph/tree/minimum_spanning_tree.py index 821e5b38fec..062ad5d8d4b 100644 --- a/python/cugraph/cugraph/tree/minimum_spanning_tree.py +++ b/python/cugraph/cugraph/tree/minimum_spanning_tree.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2022, NVIDIA CORPORATION. +# Copyright (c) 2019-2023, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -91,7 +91,7 @@ def minimum_spanning_tree(G, weight=None, algorithm="boruvka", ignore_nan=False) Examples -------- - >>> from cugraph.experimental.datasets import netscience + >>> from cugraph.datasets import netscience >>> G = netscience.get_graph(fetch=True) >>> G_mst = cugraph.minimum_spanning_tree(G) @@ -134,7 +134,7 @@ def maximum_spanning_tree(G, weight=None, algorithm="boruvka", ignore_nan=False) Examples -------- - >>> from cugraph.experimental.datasets import netscience + >>> from cugraph.datasets import netscience >>> G = netscience.get_graph(fetch=True) >>> G_mst = cugraph.maximum_spanning_tree(G) From 7157cb7300e10fbe18fe695cb174e534328645b4 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Fri, 30 Jun 2023 06:12:19 -0700 Subject: [PATCH 06/57] Update unit tests to use stable datasets API --- .../tests/centrality/test_batch_betweenness_centrality_mg.py | 2 +- .../centrality/test_batch_edge_betweenness_centrality_mg.py | 2 +- .../cugraph/tests/centrality/test_betweenness_centrality.py | 2 +- .../cugraph/tests/centrality/test_degree_centrality.py | 2 +- .../tests/centrality/test_edge_betweenness_centrality.py | 2 +- .../cugraph/tests/centrality/test_eigenvector_centrality.py | 2 +- .../cugraph/cugraph/tests/centrality/test_katz_centrality.py | 4 ++-- python/cugraph/cugraph/tests/community/test_balanced_cut.py | 2 +- python/cugraph/cugraph/tests/community/test_ecg.py | 2 +- .../cugraph/cugraph/tests/community/test_k_truss_subgraph.py | 2 +- python/cugraph/cugraph/tests/community/test_leiden.py | 2 +- python/cugraph/cugraph/tests/community/test_louvain.py | 2 +- python/cugraph/cugraph/tests/community/test_modularity.py | 2 +- python/cugraph/cugraph/tests/community/test_triangle_count.py | 2 +- python/cugraph/cugraph/tests/components/test_connectivity.py | 2 +- python/cugraph/cugraph/tests/core/test_core_number.py | 2 +- python/cugraph/cugraph/tests/core/test_k_core.py | 2 +- .../cugraph/cugraph/tests/data_store/test_property_graph.py | 2 +- .../cugraph/tests/data_store/test_property_graph_mg.py | 4 ++-- python/cugraph/cugraph/tests/internals/test_renumber.py | 2 +- python/cugraph/cugraph/tests/internals/test_symmetrize.py | 2 +- python/cugraph/cugraph/tests/layout/test_force_atlas2.py | 2 +- python/cugraph/cugraph/tests/link_analysis/test_hits.py | 2 +- python/cugraph/cugraph/tests/link_analysis/test_pagerank.py | 2 +- python/cugraph/cugraph/tests/link_prediction/test_jaccard.py | 2 +- python/cugraph/cugraph/tests/link_prediction/test_overlap.py | 2 +- python/cugraph/cugraph/tests/link_prediction/test_sorensen.py | 2 +- python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py | 2 +- python/cugraph/cugraph/tests/link_prediction/test_woverlap.py | 2 +- .../cugraph/cugraph/tests/link_prediction/test_wsorensen.py | 2 +- python/cugraph/cugraph/tests/nx/test_compat_pr.py | 2 +- python/cugraph/cugraph/tests/nx/test_nx_convert.py | 2 +- python/cugraph/cugraph/tests/sampling/test_bulk_sampler.py | 2 +- python/cugraph/cugraph/tests/sampling/test_bulk_sampler_mg.py | 2 +- python/cugraph/cugraph/tests/sampling/test_egonet.py | 2 +- python/cugraph/cugraph/tests/sampling/test_node2vec.py | 2 +- python/cugraph/cugraph/tests/sampling/test_random_walks.py | 2 +- python/cugraph/cugraph/tests/sampling/test_random_walks_mg.py | 2 +- .../cugraph/tests/sampling/test_uniform_neighbor_sample.py | 2 +- .../cugraph/tests/sampling/test_uniform_neighbor_sample_mg.py | 2 +- python/cugraph/cugraph/tests/structure/test_multigraph.py | 2 +- .../cugraph/tests/traversal/test_filter_unreachable.py | 2 +- python/cugraph/cugraph/tests/traversal/test_sssp.py | 2 +- .../cugraph/cugraph/tests/tree/test_maximum_spanning_tree.py | 2 +- .../cugraph/cugraph/tests/tree/test_minimum_spanning_tree.py | 2 +- python/cugraph/cugraph/tests/utils/test_dataset.py | 4 ++-- python/cugraph/cugraph/tests/utils/test_utils.py | 2 +- 47 files changed, 50 insertions(+), 50 deletions(-) diff --git a/python/cugraph/cugraph/tests/centrality/test_batch_betweenness_centrality_mg.py b/python/cugraph/cugraph/tests/centrality/test_batch_betweenness_centrality_mg.py index 3d1bbc5d67d..8ccbbfc9ec5 100644 --- a/python/cugraph/cugraph/tests/centrality/test_batch_betweenness_centrality_mg.py +++ b/python/cugraph/cugraph/tests/centrality/test_batch_betweenness_centrality_mg.py @@ -17,7 +17,7 @@ import numpy as np from cugraph.dask.common.mg_utils import is_single_gpu -from cugraph.experimental.datasets import karate +from cugraph.datasets import karate from test_betweenness_centrality import ( calc_betweenness_centrality, diff --git a/python/cugraph/cugraph/tests/centrality/test_batch_edge_betweenness_centrality_mg.py b/python/cugraph/cugraph/tests/centrality/test_batch_edge_betweenness_centrality_mg.py index 6b30d9fcb2b..c6e51ef4c6a 100644 --- a/python/cugraph/cugraph/tests/centrality/test_batch_edge_betweenness_centrality_mg.py +++ b/python/cugraph/cugraph/tests/centrality/test_batch_edge_betweenness_centrality_mg.py @@ -18,7 +18,7 @@ from cugraph.dask.common.mg_utils import is_single_gpu -from cugraph.experimental.datasets import karate +from cugraph.datasets import karate # Get parameters from standard betwenness_centrality_test # As tests directory is not a module, we need to add it to the path diff --git a/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py b/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py index 759ed01a7eb..7c682978d27 100644 --- a/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py @@ -23,7 +23,7 @@ import cupy import networkx as nx -from cugraph.experimental.datasets import DATASETS_SMALL, DATASETS_UNRENUMBERED +from cugraph.datasets import DATASETS_SMALL, DATASETS_UNRENUMBERED # ============================================================================= diff --git a/python/cugraph/cugraph/tests/centrality/test_degree_centrality.py b/python/cugraph/cugraph/tests/centrality/test_degree_centrality.py index b1bf033aff4..54b30964576 100644 --- a/python/cugraph/cugraph/tests/centrality/test_degree_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_degree_centrality.py @@ -18,7 +18,7 @@ import cudf import cugraph from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED +from cugraph.datasets import DATASETS_UNDIRECTED import networkx as nx 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 0717925216a..2b8c6b33232 100644 --- a/python/cugraph/cugraph/tests/centrality/test_edge_betweenness_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_edge_betweenness_centrality.py @@ -17,7 +17,7 @@ import cugraph from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_SMALL, DATASETS_UNRENUMBERED +from cugraph.datasets import DATASETS_SMALL, DATASETS_UNRENUMBERED import random import numpy as np import cupy diff --git a/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py b/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py index 2b348314c20..b2cb08c0922 100644 --- a/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py @@ -17,7 +17,7 @@ import cugraph from cugraph.testing import utils -from cugraph.experimental.datasets import ( +from cugraph.datasets import ( toy_graph, karate, DATASETS_UNDIRECTED, diff --git a/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py b/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py index 5c34866e0d0..0046c72ba57 100644 --- a/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py @@ -18,7 +18,7 @@ import cudf import cugraph from cugraph.testing import utils -from cugraph.experimental.datasets import ( +from cugraph.datasets import ( toy_graph_undirected, karate, DATASETS, @@ -161,7 +161,7 @@ def test_katz_centrality_multi_column(graph_file): @pytest.mark.parametrize("graph_file", [TOY]) def test_katz_centrality_toy(graph_file): # This test is based off of libcugraph_c and pylibcugraph tests - G = graph_file.get_graph(create_using=cugraph.Graph(directed=True)) + G = graph_file.get_graph(create_using=cugraph.Graph(directed=True), fetch=True) alpha = 0.01 beta = 1.0 tol = 0.000001 diff --git a/python/cugraph/cugraph/tests/community/test_balanced_cut.py b/python/cugraph/cugraph/tests/community/test_balanced_cut.py index 5beca07dfb7..0e15ce923ea 100644 --- a/python/cugraph/cugraph/tests/community/test_balanced_cut.py +++ b/python/cugraph/cugraph/tests/community/test_balanced_cut.py @@ -19,7 +19,7 @@ import pandas as pd import cudf import cugraph -from cugraph.experimental.datasets import DATASETS +from cugraph.datasets import DATASETS def cugraph_call(G, partitions): diff --git a/python/cugraph/cugraph/tests/community/test_ecg.py b/python/cugraph/cugraph/tests/community/test_ecg.py index 5536d562402..95c7cd763b8 100644 --- a/python/cugraph/cugraph/tests/community/test_ecg.py +++ b/python/cugraph/cugraph/tests/community/test_ecg.py @@ -18,7 +18,7 @@ import cugraph from cugraph.testing import utils -from cugraph.experimental.datasets import karate, dolphins, netscience +from cugraph.datasets import karate, dolphins, netscience from pathlib import PurePath 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 56c719ce7da..0ede9fed4bd 100644 --- a/python/cugraph/cugraph/tests/community/test_k_truss_subgraph.py +++ b/python/cugraph/cugraph/tests/community/test_k_truss_subgraph.py @@ -20,7 +20,7 @@ import numpy as np from numba import cuda -from cugraph.experimental.datasets import DATASETS_KTRUSS, karate_asymmetric +from cugraph.datasets import DATASETS_KTRUSS, karate_asymmetric # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from diff --git a/python/cugraph/cugraph/tests/community/test_leiden.py b/python/cugraph/cugraph/tests/community/test_leiden.py index 9cbe0df2532..30eb1f81a97 100644 --- a/python/cugraph/cugraph/tests/community/test_leiden.py +++ b/python/cugraph/cugraph/tests/community/test_leiden.py @@ -20,7 +20,7 @@ import cugraph import cudf from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED, karate_asymmetric +from cugraph.datasets import DATASETS_UNDIRECTED, karate_asymmetric from cudf.testing.testing import assert_series_equal diff --git a/python/cugraph/cugraph/tests/community/test_louvain.py b/python/cugraph/cugraph/tests/community/test_louvain.py index 6c0dcef8c4a..3b342a511ea 100644 --- a/python/cugraph/cugraph/tests/community/test_louvain.py +++ b/python/cugraph/cugraph/tests/community/test_louvain.py @@ -20,7 +20,7 @@ import cupyx import cudf from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED, karate_asymmetric +from cugraph.datasets import DATASETS_UNDIRECTED, karate_asymmetric # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from diff --git a/python/cugraph/cugraph/tests/community/test_modularity.py b/python/cugraph/cugraph/tests/community/test_modularity.py index 07fa2718ee1..55721193853 100644 --- a/python/cugraph/cugraph/tests/community/test_modularity.py +++ b/python/cugraph/cugraph/tests/community/test_modularity.py @@ -20,7 +20,7 @@ import cugraph from cugraph.testing import utils from cugraph.utilities import ensure_cugraph_obj_for_nx -from cugraph.experimental.datasets import DATASETS +from cugraph.datasets import DATASETS import networkx as nx diff --git a/python/cugraph/cugraph/tests/community/test_triangle_count.py b/python/cugraph/cugraph/tests/community/test_triangle_count.py index 3705ffbf8ed..ad9240177e4 100644 --- a/python/cugraph/cugraph/tests/community/test_triangle_count.py +++ b/python/cugraph/cugraph/tests/community/test_triangle_count.py @@ -20,7 +20,7 @@ import cugraph from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED, karate_asymmetric +from cugraph.datasets import DATASETS_UNDIRECTED, karate_asymmetric # Temporarily suppress warnings till networkX fixes deprecation warnings diff --git a/python/cugraph/cugraph/tests/components/test_connectivity.py b/python/cugraph/cugraph/tests/components/test_connectivity.py index 71bec2e15c1..a12311d0f19 100644 --- a/python/cugraph/cugraph/tests/components/test_connectivity.py +++ b/python/cugraph/cugraph/tests/components/test_connectivity.py @@ -24,7 +24,7 @@ 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 -from cugraph.experimental.datasets import DATASETS, STRONGDATASETS +from cugraph.datasets import DATASETS, STRONGDATASETS from cugraph.utilities import is_nx_graph_type import cudf diff --git a/python/cugraph/cugraph/tests/core/test_core_number.py b/python/cugraph/cugraph/tests/core/test_core_number.py index 6a8fedfe11c..e7f6d055221 100644 --- a/python/cugraph/cugraph/tests/core/test_core_number.py +++ b/python/cugraph/cugraph/tests/core/test_core_number.py @@ -20,7 +20,7 @@ import cugraph from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED +from cugraph.datasets import DATASETS_UNDIRECTED # ============================================================================= diff --git a/python/cugraph/cugraph/tests/core/test_k_core.py b/python/cugraph/cugraph/tests/core/test_k_core.py index 1ea3bdd8a0a..8912a536a61 100644 --- a/python/cugraph/cugraph/tests/core/test_k_core.py +++ b/python/cugraph/cugraph/tests/core/test_k_core.py @@ -17,7 +17,7 @@ import cugraph from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED +from cugraph.datasets import DATASETS_UNDIRECTED # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from 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 c5c382df2eb..8459b296307 100644 --- a/python/cugraph/cugraph/tests/data_store/test_property_graph.py +++ b/python/cugraph/cugraph/tests/data_store/test_property_graph.py @@ -46,7 +46,7 @@ import cugraph from cugraph.generators import rmat -from cugraph.experimental.datasets import cyber +from cugraph.datasets import cyber def type_is_categorical(pG): 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 8bc2da37e89..517b2a8950f 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 @@ -24,8 +24,8 @@ from cugraph.dask.common.mg_utils import is_single_gpu import cugraph.dask as dcg -from cugraph.experimental.datasets import cyber -from cugraph.experimental.datasets import netscience +from cugraph.datasets import cyber +from cugraph.datasets import netscience # 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/internals/test_renumber.py b/python/cugraph/cugraph/tests/internals/test_renumber.py index 4526770ec2a..cce7228a14f 100644 --- a/python/cugraph/cugraph/tests/internals/test_renumber.py +++ b/python/cugraph/cugraph/tests/internals/test_renumber.py @@ -22,7 +22,7 @@ from cugraph.structure.number_map import NumberMap from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS +from cugraph.datasets import DATASETS @pytest.mark.sg diff --git a/python/cugraph/cugraph/tests/internals/test_symmetrize.py b/python/cugraph/cugraph/tests/internals/test_symmetrize.py index 8d772abe822..d295b7feac3 100644 --- a/python/cugraph/cugraph/tests/internals/test_symmetrize.py +++ b/python/cugraph/cugraph/tests/internals/test_symmetrize.py @@ -18,7 +18,7 @@ import pandas as pd import cudf import cugraph -from cugraph.experimental.datasets import DATASETS +from cugraph.datasets import DATASETS @pytest.mark.sg diff --git a/python/cugraph/cugraph/tests/layout/test_force_atlas2.py b/python/cugraph/cugraph/tests/layout/test_force_atlas2.py index 12d0a4e3aa6..a99ca73cab8 100644 --- a/python/cugraph/cugraph/tests/layout/test_force_atlas2.py +++ b/python/cugraph/cugraph/tests/layout/test_force_atlas2.py @@ -19,7 +19,7 @@ from cugraph.internals import GraphBasedDimRedCallback from sklearn.manifold import trustworthiness import scipy.io -from cugraph.experimental.datasets import karate, polbooks, dolphins, netscience +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 diff --git a/python/cugraph/cugraph/tests/link_analysis/test_hits.py b/python/cugraph/cugraph/tests/link_analysis/test_hits.py index 16d89f20e80..0af923bf562 100644 --- a/python/cugraph/cugraph/tests/link_analysis/test_hits.py +++ b/python/cugraph/cugraph/tests/link_analysis/test_hits.py @@ -21,7 +21,7 @@ import cugraph from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED, email_Eu_core, karate +from cugraph.datasets import DATASETS_UNDIRECTED, email_Eu_core, karate # ============================================================================= diff --git a/python/cugraph/cugraph/tests/link_analysis/test_pagerank.py b/python/cugraph/cugraph/tests/link_analysis/test_pagerank.py index b7487ae329c..6fed269088d 100644 --- a/python/cugraph/cugraph/tests/link_analysis/test_pagerank.py +++ b/python/cugraph/cugraph/tests/link_analysis/test_pagerank.py @@ -20,7 +20,7 @@ import cudf import cugraph from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS, karate +from cugraph.datasets import DATASETS, karate # Temporarily suppress warnings till networkX fixes deprecation warnings diff --git a/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py b/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py index b04c4c741b1..cb1e95a2354 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py @@ -21,7 +21,7 @@ from cugraph.testing import utils from cugraph.experimental import jaccard_coefficient as exp_jaccard_coefficient from cugraph.experimental import jaccard as exp_jaccard -from cugraph.experimental.datasets import DATASETS_UNDIRECTED, netscience +from cugraph.datasets import DATASETS_UNDIRECTED, netscience # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from diff --git a/python/cugraph/cugraph/tests/link_prediction/test_overlap.py b/python/cugraph/cugraph/tests/link_prediction/test_overlap.py index 68f879dacdb..97f21c7b69e 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_overlap.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_overlap.py @@ -23,7 +23,7 @@ import cugraph from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED +from cugraph.datasets import DATASETS_UNDIRECTED # ============================================================================= diff --git a/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py b/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py index 3457627ed7d..de28797aca0 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py @@ -20,7 +20,7 @@ import cugraph from cugraph.testing import utils from cugraph.experimental import sorensen as exp_sorensen -from cugraph.experimental.datasets import DATASETS_UNDIRECTED, netscience +from cugraph.datasets import DATASETS_UNDIRECTED, netscience # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from diff --git a/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py b/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py index 22ace93c0e4..4bc78879681 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py @@ -21,7 +21,7 @@ import cugraph from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED +from cugraph.datasets import DATASETS_UNDIRECTED # Temporarily suppress warnings till networkX fixes deprecation warnings diff --git a/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py b/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py index f4fab9d0faa..f0632528742 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py @@ -18,7 +18,7 @@ import numpy as np import cudf from cudf.testing import assert_series_equal -from cugraph.experimental.datasets import DATASETS_UNDIRECTED +from cugraph.datasets import DATASETS_UNDIRECTED import cugraph from cugraph.testing import utils diff --git a/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py b/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py index 0cf775d666c..7c6f1565e2d 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py @@ -21,7 +21,7 @@ import cugraph from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED +from cugraph.datasets import DATASETS_UNDIRECTED # Temporarily suppress warnings till networkX fixes deprecation warnings diff --git a/python/cugraph/cugraph/tests/nx/test_compat_pr.py b/python/cugraph/cugraph/tests/nx/test_compat_pr.py index a8dc6f7bb22..14e216bce32 100644 --- a/python/cugraph/cugraph/tests/nx/test_compat_pr.py +++ b/python/cugraph/cugraph/tests/nx/test_compat_pr.py @@ -25,7 +25,7 @@ from pylibcugraph.testing.utils import gen_fixture_params_product from cugraph.testing import utils -from cugraph.experimental.datasets import karate +from cugraph.datasets import karate 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 ee14bfe361c..88e453c614c 100644 --- a/python/cugraph/cugraph/tests/nx/test_nx_convert.py +++ b/python/cugraph/cugraph/tests/nx/test_nx_convert.py @@ -17,7 +17,7 @@ import cugraph from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS +from cugraph.datasets import DATASETS # Temporarily suppress warnings till networkX fixes deprecation warnings diff --git a/python/cugraph/cugraph/tests/sampling/test_bulk_sampler.py b/python/cugraph/cugraph/tests/sampling/test_bulk_sampler.py index c25b5297e18..eba59d5c3d7 100644 --- a/python/cugraph/cugraph/tests/sampling/test_bulk_sampler.py +++ b/python/cugraph/cugraph/tests/sampling/test_bulk_sampler.py @@ -15,7 +15,7 @@ import cudf import cupy import cugraph -from cugraph.experimental.datasets import karate +from cugraph.datasets import karate from cugraph.experimental.gnn import BulkSampler import tempfile 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 f717d452403..856940829fe 100644 --- a/python/cugraph/cugraph/tests/sampling/test_bulk_sampler_mg.py +++ b/python/cugraph/cugraph/tests/sampling/test_bulk_sampler_mg.py @@ -16,7 +16,7 @@ import dask_cudf import cupy import cugraph -from cugraph.experimental.datasets import karate +from cugraph.datasets import karate from cugraph.experimental import BulkSampler import tempfile diff --git a/python/cugraph/cugraph/tests/sampling/test_egonet.py b/python/cugraph/cugraph/tests/sampling/test_egonet.py index 2af31438a13..5b0bc5d5aad 100644 --- a/python/cugraph/cugraph/tests/sampling/test_egonet.py +++ b/python/cugraph/cugraph/tests/sampling/test_egonet.py @@ -17,7 +17,7 @@ import cudf import cugraph from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS +from cugraph.datasets import DATASETS # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from diff --git a/python/cugraph/cugraph/tests/sampling/test_node2vec.py b/python/cugraph/cugraph/tests/sampling/test_node2vec.py index 60b937cc1b2..3d9a1c60aec 100644 --- a/python/cugraph/cugraph/tests/sampling/test_node2vec.py +++ b/python/cugraph/cugraph/tests/sampling/test_node2vec.py @@ -18,7 +18,7 @@ from cugraph.testing import utils import cugraph import cudf -from cugraph.experimental.datasets import small_line, karate, DATASETS_SMALL +from cugraph.datasets import small_line, karate, DATASETS_SMALL # ============================================================================= diff --git a/python/cugraph/cugraph/tests/sampling/test_random_walks.py b/python/cugraph/cugraph/tests/sampling/test_random_walks.py index 508f927c296..3bae0ad5464 100644 --- a/python/cugraph/cugraph/tests/sampling/test_random_walks.py +++ b/python/cugraph/cugraph/tests/sampling/test_random_walks.py @@ -21,7 +21,7 @@ import cudf import networkx as nx from cugraph.utilities import ensure_cugraph_obj_for_nx -from cugraph.experimental.datasets import DATASETS, DATASETS_SMALL +from cugraph.datasets import DATASETS, DATASETS_SMALL # ============================================================================= # 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 df1db0a95a9..c9566016f64 100644 --- a/python/cugraph/cugraph/tests/sampling/test_random_walks_mg.py +++ b/python/cugraph/cugraph/tests/sampling/test_random_walks_mg.py @@ -22,7 +22,7 @@ # from cugraph.dask.common.mg_utils import is_single_gpu import cugraph.dask as dcg -from cugraph.experimental.datasets import DATASETS_SMALL, karate_asymmetric +from cugraph.datasets import DATASETS_SMALL, karate_asymmetric # ============================================================================= 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 5d2f050bce9..e09a65c5eab 100644 --- a/python/cugraph/cugraph/tests/sampling/test_uniform_neighbor_sample.py +++ b/python/cugraph/cugraph/tests/sampling/test_uniform_neighbor_sample.py @@ -19,7 +19,7 @@ import cugraph from cugraph import uniform_neighbor_sample -from cugraph.experimental.datasets import DATASETS_UNDIRECTED, email_Eu_core, small_tree +from cugraph.datasets import DATASETS_UNDIRECTED, email_Eu_core, small_tree # ============================================================================= 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 033b96487c4..1a6fa5d047f 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 @@ -25,7 +25,7 @@ import cugraph from cugraph.dask import uniform_neighbor_sample -from cugraph.experimental.datasets import DATASETS_UNDIRECTED, email_Eu_core, small_tree +from cugraph.datasets import DATASETS_UNDIRECTED, email_Eu_core, small_tree # 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_multigraph.py b/python/cugraph/cugraph/tests/structure/test_multigraph.py index e317a935cfc..717e19ec19b 100644 --- a/python/cugraph/cugraph/tests/structure/test_multigraph.py +++ b/python/cugraph/cugraph/tests/structure/test_multigraph.py @@ -19,7 +19,7 @@ import cugraph from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS +from cugraph.datasets import DATASETS # ============================================================================= diff --git a/python/cugraph/cugraph/tests/traversal/test_filter_unreachable.py b/python/cugraph/cugraph/tests/traversal/test_filter_unreachable.py index 495e1a4ec11..dcda8166790 100644 --- a/python/cugraph/cugraph/tests/traversal/test_filter_unreachable.py +++ b/python/cugraph/cugraph/tests/traversal/test_filter_unreachable.py @@ -17,7 +17,7 @@ import numpy as np import cugraph -from cugraph.experimental.datasets import DATASETS +from cugraph.datasets import DATASETS # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from diff --git a/python/cugraph/cugraph/tests/traversal/test_sssp.py b/python/cugraph/cugraph/tests/traversal/test_sssp.py index 1c99123f866..a637e523d23 100644 --- a/python/cugraph/cugraph/tests/traversal/test_sssp.py +++ b/python/cugraph/cugraph/tests/traversal/test_sssp.py @@ -27,7 +27,7 @@ from scipy.sparse import csc_matrix as sp_csc_matrix import cudf from pylibcugraph.testing.utils import gen_fixture_params_product -from cugraph.experimental.datasets import DATASETS_UNDIRECTED +from cugraph.datasets import DATASETS_UNDIRECTED import cugraph from cugraph.testing import utils 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 8a3852595fc..1d8800291f7 100644 --- a/python/cugraph/cugraph/tests/tree/test_maximum_spanning_tree.py +++ b/python/cugraph/cugraph/tests/tree/test_maximum_spanning_tree.py @@ -21,7 +21,7 @@ import cugraph from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED_WEIGHTS +from cugraph.datasets import DATASETS_UNDIRECTED_WEIGHTS # Temporarily suppress warnings till networkX fixes deprecation warnings 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 6f36864f552..6e19937557b 100644 --- a/python/cugraph/cugraph/tests/tree/test_minimum_spanning_tree.py +++ b/python/cugraph/cugraph/tests/tree/test_minimum_spanning_tree.py @@ -21,7 +21,7 @@ import cugraph from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED_WEIGHTS +from cugraph.datasets import DATASETS_UNDIRECTED_WEIGHTS # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from diff --git a/python/cugraph/cugraph/tests/utils/test_dataset.py b/python/cugraph/cugraph/tests/utils/test_dataset.py index e72de2ecf8a..08c671909ee 100644 --- a/python/cugraph/cugraph/tests/utils/test_dataset.py +++ b/python/cugraph/cugraph/tests/utils/test_dataset.py @@ -21,7 +21,7 @@ from cugraph.structure import Graph from cugraph.testing import RAPIDS_DATASET_ROOT_DIR_PATH -from cugraph.experimental.datasets import ( +from cugraph.datasets import ( ALL_DATASETS, ALL_DATASETS_WGT, SMALL_DATASETS, @@ -158,7 +158,7 @@ def test_create_using(dataset): def test_ctor_with_datafile(): - from cugraph.experimental.datasets import karate + from cugraph.datasets import karate karate_csv = RAPIDS_DATASET_ROOT_DIR_PATH / "karate.csv" diff --git a/python/cugraph/cugraph/tests/utils/test_utils.py b/python/cugraph/cugraph/tests/utils/test_utils.py index c6956cfbfcf..607b27be099 100644 --- a/python/cugraph/cugraph/tests/utils/test_utils.py +++ b/python/cugraph/cugraph/tests/utils/test_utils.py @@ -18,7 +18,7 @@ import cugraph import cudf from cugraph.testing import utils -from cugraph.experimental.datasets import karate +from cugraph.datasets import karate import numpy as np From 1ec0ef8ab279118fafbb72f3120ec52a643f11fc Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Fri, 30 Jun 2023 12:25:23 -0700 Subject: [PATCH 07/57] Removed variants of the Karate dataset --- python/cugraph/cugraph/datasets/__init__.py | 22 ++++------------- .../datasets/metadata/karate-disjoint.yaml | 22 ----------------- .../datasets/metadata/karate_asymmetric.yaml | 24 ------------------- .../datasets/metadata/karate_data.yaml | 22 ----------------- .../datasets/metadata/karate_undirected.yaml | 22 ----------------- 5 files changed, 4 insertions(+), 108 deletions(-) delete mode 100644 python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml delete mode 100644 python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml delete mode 100644 python/cugraph/cugraph/datasets/metadata/karate_data.yaml delete mode 100644 python/cugraph/cugraph/datasets/metadata/karate_undirected.yaml diff --git a/python/cugraph/cugraph/datasets/__init__.py b/python/cugraph/cugraph/datasets/__init__.py index d95a7683e1b..7f4b4bfc7f3 100644 --- a/python/cugraph/cugraph/datasets/__init__.py +++ b/python/cugraph/cugraph/datasets/__init__.py @@ -28,10 +28,6 @@ # invidual datasets karate = Dataset(meta_path / "karate.yaml") -karate_data = Dataset(meta_path / "karate_data.yaml") -karate_undirected = Dataset(meta_path / "karate_undirected.yaml") -karate_asymmetric = Dataset(meta_path / "karate_asymmetric.yaml") -karate_disjoint = Dataset(meta_path / "karate-disjoint.yaml") dolphins = Dataset(meta_path / "dolphins.yaml") polbooks = Dataset(meta_path / "polbooks.yaml") netscience = Dataset(meta_path / "netscience.yaml") @@ -45,27 +41,17 @@ # batches DATASETS_UNDIRECTED = [karate, dolphins] - DATASETS_UNDIRECTED_WEIGHTS = [netscience] - -DATASETS_UNRENUMBERED = [karate_disjoint] - -DATASETS = [dolphins, netscience, karate_disjoint] - DATASETS_SMALL = [karate, dolphins, polbooks] - STRONGDATASETS = [dolphins, netscience, email_Eu_core] - DATASETS_KTRUSS = [(polbooks, ktruss_polbooks)] - MEDIUM_DATASETS = [polbooks] - SMALL_DATASETS = [karate, dolphins, netscience] - RLY_SMALL_DATASETS = [small_line, small_tree] - ALL_DATASETS = [karate, dolphins, netscience, polbooks, small_line, small_tree] - ALL_DATASETS_WGT = [karate, dolphins, netscience, polbooks, small_line, small_tree] - TEST_GROUP = [dolphins, netscience] + +# FIXME: removed karate variant. check if unit tests are breaking +DATASETS_UNRENUMBERED = [] +DATASETS = [dolphins, netscience] diff --git a/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml b/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml deleted file mode 100644 index 0c0eaf78b63..00000000000 --- a/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: karate-disjoint -file_type: .csv -author: null -url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/karate-disjoint.csv -refs: null -delim: " " -header: None -col_names: - - src - - dst - - wgt -col_types: - - int32 - - int32 - - float32 -has_loop: false -is_directed: True -is_multigraph: false -is_symmetric: true -number_of_edges: 312 -number_of_nodes: 68 -number_of_lines: 312 diff --git a/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml deleted file mode 100644 index 3616b8fb3a5..00000000000 --- a/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: karate-asymmetric -file_type: .csv -author: Zachary W. -url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/karate-asymmetric.csv -delim: " " -header: None -refs: - W. W. Zachary, An information flow model for conflict and fission in small groups, - Journal of Anthropological Research 33, 452-473 (1977). -col_names: - - src - - dst - - wgt -col_types: - - int32 - - int32 - - float32 -has_loop: true -is_directed: false -is_multigraph: false -is_symmetric: false -number_of_edges: 78 -number_of_nodes: 34 -number_of_lines: 78 diff --git a/python/cugraph/cugraph/datasets/metadata/karate_data.yaml b/python/cugraph/cugraph/datasets/metadata/karate_data.yaml deleted file mode 100644 index 9a8b27f21ae..00000000000 --- a/python/cugraph/cugraph/datasets/metadata/karate_data.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: karate-data -file_type: .csv -author: Zachary W. -url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/karate-data.csv -refs: - W. W. Zachary, An information flow model for conflict and fission in small groups, - Journal of Anthropological Research 33, 452-473 (1977). -delim: "\t" -header: None -col_names: - - src - - dst -col_types: - - int32 - - int32 -has_loop: true -is_directed: true -is_multigraph: false -is_symmetric: true -number_of_edges: 156 -number_of_nodes: 34 -number_of_lines: 156 diff --git a/python/cugraph/cugraph/datasets/metadata/karate_undirected.yaml b/python/cugraph/cugraph/datasets/metadata/karate_undirected.yaml deleted file mode 100644 index 1b45f86caee..00000000000 --- a/python/cugraph/cugraph/datasets/metadata/karate_undirected.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: karate_undirected -file_type: .csv -author: Zachary W. -url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/karate_undirected.csv -refs: - W. W. Zachary, An information flow model for conflict and fission in small groups, - Journal of Anthropological Research 33, 452-473 (1977). -delim: "\t" -header: None -col_names: - - src - - dst -col_types: - - int32 - - int32 -has_loop: true -is_directed: false -is_multigraph: false -is_symmetric: true -number_of_edges: 78 -number_of_nodes: 34 -number_of_lines: 78 From 0f9aa093fbc39e8556b7f22aa396fc56227011e8 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Mon, 3 Jul 2023 07:35:54 -0700 Subject: [PATCH 08/57] Moving dataset batches into testing/utils.py --- python/cugraph/cugraph/datasets/__init__.py | 17 --------- python/cugraph/cugraph/testing/__init__.py | 36 +++++++++++++++++-- .../cugraph/tests/utils/test_dataset.py | 4 +-- 3 files changed, 36 insertions(+), 21 deletions(-) diff --git a/python/cugraph/cugraph/datasets/__init__.py b/python/cugraph/cugraph/datasets/__init__.py index 7f4b4bfc7f3..8d58d4c78aa 100644 --- a/python/cugraph/cugraph/datasets/__init__.py +++ b/python/cugraph/cugraph/datasets/__init__.py @@ -38,20 +38,3 @@ toy_graph_undirected = Dataset(meta_path / "toy_graph_undirected.yaml") email_Eu_core = Dataset(meta_path / "email-Eu-core.yaml") ktruss_polbooks = Dataset(meta_path / "ktruss_polbooks.yaml") - -# batches -DATASETS_UNDIRECTED = [karate, dolphins] -DATASETS_UNDIRECTED_WEIGHTS = [netscience] -DATASETS_SMALL = [karate, dolphins, polbooks] -STRONGDATASETS = [dolphins, netscience, email_Eu_core] -DATASETS_KTRUSS = [(polbooks, ktruss_polbooks)] -MEDIUM_DATASETS = [polbooks] -SMALL_DATASETS = [karate, dolphins, netscience] -RLY_SMALL_DATASETS = [small_line, small_tree] -ALL_DATASETS = [karate, dolphins, netscience, polbooks, small_line, small_tree] -ALL_DATASETS_WGT = [karate, dolphins, netscience, polbooks, small_line, small_tree] -TEST_GROUP = [dolphins, netscience] - -# FIXME: removed karate variant. check if unit tests are breaking -DATASETS_UNRENUMBERED = [] -DATASETS = [dolphins, netscience] diff --git a/python/cugraph/cugraph/testing/__init__.py b/python/cugraph/cugraph/testing/__init__.py index db1c574de21..c62d559f03b 100644 --- a/python/cugraph/cugraph/testing/__init__.py +++ b/python/cugraph/cugraph/testing/__init__.py @@ -11,6 +11,38 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cugraph.testing.utils import ( - RAPIDS_DATASET_ROOT_DIR_PATH, +from cugraph.testing.utils import RAPIDS_DATASET_ROOT_DIR_PATH, RAPIDS_DATASET_ROOT_DIR + +# +# Moved Dataset Batches +# + +# FIXME: it is hard to keep track of which datasets are included in certain batches and which are not. maybe convert this to a single fixture that let's you import datasets by name and yields a list? eg. get_batch("A", "B", C") => [A, B, C] +# batches + +from cugraph.datasets import ( + karate, + dolphins, + polbooks, + netscience, + small_line, + small_tree, + email_Eu_core, + ktruss_polbooks, ) + +DATASETS_UNDIRECTED = [karate, dolphins] +DATASETS_UNDIRECTED_WEIGHTS = [netscience] +DATASETS_SMALL = [karate, dolphins, polbooks] +STRONGDATASETS = [dolphins, netscience, email_Eu_core] +DATASETS_KTRUSS = [(polbooks, ktruss_polbooks)] +MEDIUM_DATASETS = [polbooks] +SMALL_DATASETS = [karate, dolphins, netscience] +RLY_SMALL_DATASETS = [small_line, small_tree] +ALL_DATASETS = [karate, dolphins, netscience, polbooks, small_line, small_tree] +ALL_DATASETS_WGT = [karate, dolphins, netscience, polbooks, small_line, small_tree] +TEST_GROUP = [dolphins, netscience] + +# FIXME: removed karate variant. check if unit tests are breaking +DATASETS_UNRENUMBERED = [] +DATASETS = [dolphins, netscience] diff --git a/python/cugraph/cugraph/tests/utils/test_dataset.py b/python/cugraph/cugraph/tests/utils/test_dataset.py index e72de2ecf8a..89da8afce0b 100644 --- a/python/cugraph/cugraph/tests/utils/test_dataset.py +++ b/python/cugraph/cugraph/tests/utils/test_dataset.py @@ -21,12 +21,12 @@ from cugraph.structure import Graph from cugraph.testing import RAPIDS_DATASET_ROOT_DIR_PATH -from cugraph.experimental.datasets import ( +from cugraph.testing import ( ALL_DATASETS, ALL_DATASETS_WGT, SMALL_DATASETS, ) -from cugraph.experimental import datasets +from cugraph import datasets # Add the sg marker to all tests in this module. pytestmark = pytest.mark.sg From 965ec220b32612dbf85423a83c82bbccd0a34330 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Mon, 3 Jul 2023 11:55:50 -0700 Subject: [PATCH 09/57] Expand test_dataset.py unit test coverage --- python/cugraph/cugraph/datasets/__init__.py | 10 +++---- python/cugraph/cugraph/testing/__init__.py | 20 +++++++++++--- .../cugraph/tests/utils/test_dataset.py | 26 +++++++++++++++++++ 3 files changed, 48 insertions(+), 8 deletions(-) diff --git a/python/cugraph/cugraph/datasets/__init__.py b/python/cugraph/cugraph/datasets/__init__.py index 8d58d4c78aa..b5324264a9b 100644 --- a/python/cugraph/cugraph/datasets/__init__.py +++ b/python/cugraph/cugraph/datasets/__init__.py @@ -27,14 +27,14 @@ meta_path = Path(__file__).parent / "metadata" # invidual datasets -karate = Dataset(meta_path / "karate.yaml") +cyber = Dataset(meta_path / "cyber.yaml") dolphins = Dataset(meta_path / "dolphins.yaml") -polbooks = Dataset(meta_path / "polbooks.yaml") +email_Eu_core = Dataset(meta_path / "email-Eu-core.yaml") +karate = Dataset(meta_path / "karate.yaml") +ktruss_polbooks = Dataset(meta_path / "ktruss_polbooks.yaml") netscience = Dataset(meta_path / "netscience.yaml") -cyber = Dataset(meta_path / "cyber.yaml") +polbooks = Dataset(meta_path / "polbooks.yaml") small_line = Dataset(meta_path / "small_line.yaml") small_tree = Dataset(meta_path / "small_tree.yaml") toy_graph = Dataset(meta_path / "toy_graph.yaml") toy_graph_undirected = Dataset(meta_path / "toy_graph_undirected.yaml") -email_Eu_core = Dataset(meta_path / "email-Eu-core.yaml") -ktruss_polbooks = Dataset(meta_path / "ktruss_polbooks.yaml") diff --git a/python/cugraph/cugraph/testing/__init__.py b/python/cugraph/cugraph/testing/__init__.py index c62d559f03b..5cc0291faf3 100644 --- a/python/cugraph/cugraph/testing/__init__.py +++ b/python/cugraph/cugraph/testing/__init__.py @@ -21,14 +21,17 @@ # batches from cugraph.datasets import ( - karate, + cyber, dolphins, + karate, + ktruss_polbooks, polbooks, netscience, small_line, small_tree, email_Eu_core, - ktruss_polbooks, + toy_graph, + toy_graph_undirected, ) DATASETS_UNDIRECTED = [karate, dolphins] @@ -39,7 +42,18 @@ MEDIUM_DATASETS = [polbooks] SMALL_DATASETS = [karate, dolphins, netscience] RLY_SMALL_DATASETS = [small_line, small_tree] -ALL_DATASETS = [karate, dolphins, netscience, polbooks, small_line, small_tree] +ALL_DATASETS = [ + dolphins, + karate, + ktruss_polbooks, + polbooks, + netscience, + small_line, + small_tree, + email_Eu_core, + toy_graph, + toy_graph_undirected, +] ALL_DATASETS_WGT = [karate, dolphins, netscience, polbooks, small_line, small_tree] TEST_GROUP = [dolphins, netscience] diff --git a/python/cugraph/cugraph/tests/utils/test_dataset.py b/python/cugraph/cugraph/tests/utils/test_dataset.py index 89da8afce0b..9cd94834f53 100644 --- a/python/cugraph/cugraph/tests/utils/test_dataset.py +++ b/python/cugraph/cugraph/tests/utils/test_dataset.py @@ -239,3 +239,29 @@ def test_unload(): assert ds._edgelist is not None ds.unload() assert ds._edgelist is None + + +# TODO: check for all datasets +@pytest.mark.parametrize("dataset", ALL_DATASETS) +def test_node_and_edge_count(dataset): + dataset_is_directed = dataset.metadata["is_directed"] + G = dataset.get_graph(fetch=True, create_using=Graph(directed=dataset_is_directed)) + + # these are the values read directly from .yaml file + meta_node_count = dataset.metadata["number_of_nodes"] + meta_edge_count = dataset.metadata["number_of_edges"] + + # value from the cugraph.Graph object + obj_node_count = G.number_of_nodes() + obj_edge_count = G.number_of_edges() + + assert obj_node_count == meta_node_count + assert obj_edge_count == meta_edge_count + + +@pytest.mark.parametrize("dataset", ALL_DATASETS) +def test_is_directed(dataset): + dataset_is_directed = dataset.metadata["is_directed"] + G = dataset.get_graph(fetch=True, create_using=Graph(directed=dataset_is_directed)) + + assert G.is_directed() == dataset.metadata["is_directed"] From c1281aaf33ed0dc7ab75f9ae865fcfb2e6ef7e2a Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Mon, 3 Jul 2023 12:01:38 -0700 Subject: [PATCH 10/57] Correcting YAML file inconsistencies --- python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml | 2 +- python/cugraph/cugraph/datasets/metadata/netscience.yaml | 2 +- python/cugraph/cugraph/datasets/metadata/toy_graph.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml b/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml index 97d0dc82ee3..e42a42f132d 100644 --- a/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml +++ b/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml @@ -14,7 +14,7 @@ col_types: - int32 - float32 has_loop: false -is_directed: false +is_directed: true is_multigraph: false is_symmetric: true number_of_edges: 25571 diff --git a/python/cugraph/cugraph/datasets/metadata/netscience.yaml b/python/cugraph/cugraph/datasets/metadata/netscience.yaml index 2dca702df3d..3077c4a9002 100644 --- a/python/cugraph/cugraph/datasets/metadata/netscience.yaml +++ b/python/cugraph/cugraph/datasets/metadata/netscience.yaml @@ -17,6 +17,6 @@ has_loop: false is_directed: true is_multigraph: false is_symmetric: true -number_of_edges: 2742 +number_of_edges: 5484 number_of_nodes: 1461 number_of_lines: 5484 diff --git a/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml b/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml index 819aad06f6a..0d8ea46d9a7 100644 --- a/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml +++ b/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml @@ -14,7 +14,7 @@ col_types: - int32 - float32 has_loop: false -is_directed: false +is_directed: true is_multigraph: false is_symmetric: true number_of_edges: 16 From cc3973dfb36536bdbee95cf9756aa33d16aae290 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Wed, 5 Jul 2023 07:32:21 -0700 Subject: [PATCH 11/57] Update unit tests to use migrated dataset batches. Flag tests that are using soon-to-be deleted karate variants from datasets API --- python/cugraph/cugraph/testing/__init__.py | 2 +- .../tests/centrality/test_betweenness_centrality.py | 7 ++++--- .../tests/centrality/test_degree_centrality.py | 3 +-- .../centrality/test_edge_betweenness_centrality.py | 3 +-- .../tests/centrality/test_eigenvector_centrality.py | 11 +++++------ .../centrality/test_eigenvector_centrality_mg.py | 2 +- .../cugraph/tests/centrality/test_katz_centrality.py | 8 +++++--- .../cugraph/tests/community/test_k_truss_subgraph.py | 10 ++++++---- python/cugraph/cugraph/tests/community/test_leiden.py | 4 ++-- .../cugraph/cugraph/tests/community/test_louvain.py | 4 ++-- .../cugraph/tests/community/test_triangle_count.py | 4 ++-- .../cugraph/tests/components/test_connectivity.py | 3 +-- python/cugraph/cugraph/tests/core/test_core_number.py | 3 +-- python/cugraph/cugraph/tests/core/test_k_core.py | 3 +-- .../tests/data_store/test_property_graph_mg.py | 3 +-- .../cugraph/cugraph/tests/internals/test_renumber.py | 2 +- .../cugraph/tests/internals/test_symmetrize.py | 2 +- .../cugraph/cugraph/tests/link_analysis/test_hits.py | 4 ++-- .../cugraph/tests/link_analysis/test_pagerank.py | 2 +- .../cugraph/tests/link_prediction/test_jaccard.py | 4 ++-- .../cugraph/tests/link_prediction/test_overlap.py | 3 +-- .../cugraph/tests/link_prediction/test_sorensen.py | 4 ++-- .../cugraph/tests/link_prediction/test_wjaccard.py | 3 +-- .../cugraph/tests/link_prediction/test_woverlap.py | 3 +-- .../cugraph/tests/link_prediction/test_wsorensen.py | 3 +-- python/cugraph/cugraph/tests/nx/test_nx_convert.py | 2 +- python/cugraph/cugraph/tests/sampling/test_egonet.py | 2 +- .../cugraph/cugraph/tests/sampling/test_node2vec.py | 8 ++++---- .../cugraph/tests/sampling/test_random_walks.py | 3 ++- .../cugraph/tests/sampling/test_random_walks_mg.py | 3 ++- .../tests/sampling/test_uniform_neighbor_sample.py | 3 ++- .../tests/sampling/test_uniform_neighbor_sample_mg.py | 3 ++- .../cugraph/tests/structure/test_multigraph.py | 2 +- .../tests/traversal/test_filter_unreachable.py | 2 +- python/cugraph/cugraph/tests/traversal/test_sssp.py | 3 +-- .../cugraph/tests/tree/test_maximum_spanning_tree.py | 3 +-- .../cugraph/tests/tree/test_minimum_spanning_tree.py | 3 +-- python/cugraph/cugraph/tests/utils/test_dataset.py | 1 - 38 files changed, 66 insertions(+), 72 deletions(-) diff --git a/python/cugraph/cugraph/testing/__init__.py b/python/cugraph/cugraph/testing/__init__.py index 5cc0291faf3..ab364f64fc3 100644 --- a/python/cugraph/cugraph/testing/__init__.py +++ b/python/cugraph/cugraph/testing/__init__.py @@ -59,4 +59,4 @@ # FIXME: removed karate variant. check if unit tests are breaking DATASETS_UNRENUMBERED = [] -DATASETS = [dolphins, netscience] +DATASETS = [dolphins, netscience, karate] diff --git a/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py b/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py index 759ed01a7eb..e66b86f7fe1 100644 --- a/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py @@ -16,14 +16,13 @@ import pytest import cugraph -from cugraph.testing import utils +from cugraph.testing import utils, DATASETS_SMALL, DATASETS_UNRENUMBERED import random import numpy as np import cudf import cupy import networkx as nx -from cugraph.experimental.datasets import DATASETS_SMALL, DATASETS_UNRENUMBERED # ============================================================================= @@ -113,7 +112,9 @@ def calc_betweenness_centrality( edge_attr = None G = graph_file.get_graph( - create_using=cugraph.Graph(directed=directed), ignore_weights=not edgevals + fetch=True, + create_using=cugraph.Graph(directed=directed), + ignore_weights=not edgevals, ) M = G.to_pandas_edgelist().rename( diff --git a/python/cugraph/cugraph/tests/centrality/test_degree_centrality.py b/python/cugraph/cugraph/tests/centrality/test_degree_centrality.py index b1bf033aff4..cc39398270f 100644 --- a/python/cugraph/cugraph/tests/centrality/test_degree_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_degree_centrality.py @@ -17,8 +17,7 @@ import cudf import cugraph -from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED +from cugraph.testing import utils, DATASETS_UNDIRECTED import networkx as nx 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 0717925216a..8b4d118e3de 100644 --- a/python/cugraph/cugraph/tests/centrality/test_edge_betweenness_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_edge_betweenness_centrality.py @@ -16,8 +16,7 @@ import pytest import cugraph -from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_SMALL, DATASETS_UNRENUMBERED +from cugraph.testing import utils, DATASETS_SMALL, DATASETS_UNRENUMBERED import random import numpy as np import cupy diff --git a/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py b/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py index 2b348314c20..c0dba47582b 100644 --- a/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py @@ -16,13 +16,12 @@ import pytest import cugraph -from cugraph.testing import utils -from cugraph.experimental.datasets import ( - toy_graph, - karate, +from cugraph.testing import ( + utils, DATASETS_UNDIRECTED, DATASETS, ) +from cugraph.experimental.datasets import toy_graph, karate import networkx as nx @@ -46,7 +45,7 @@ def topKVertices(eigen, col, k): def calc_eigenvector(graph_file): dataset_path = graph_file.get_path() G = graph_file.get_graph( - create_using=cugraph.Graph(directed=True), ignore_weights=True + fetch=True, create_using=cugraph.Graph(directed=True), ignore_weights=True ) k_df = cugraph.eigenvector_centrality(G, max_iter=1000) @@ -141,7 +140,7 @@ def test_eigenvector_centrality_multi_column(graph_file): @pytest.mark.parametrize("graph_file", [TOY]) def test_eigenvector_centrality_toy(graph_file): # This test is based off of libcugraph_c and pylibcugraph tests - G = graph_file.get_graph(create_using=cugraph.Graph(directed=True)) + G = graph_file.get_graph(fetch=True, create_using=cugraph.Graph(directed=True)) tol = 1e-6 max_iter = 200 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 f91ac418ef0..beef5461739 100644 --- a/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality_mg.py +++ b/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality_mg.py @@ -19,7 +19,7 @@ import dask_cudf import cudf from cugraph.dask.common.mg_utils import is_single_gpu -from cugraph.testing.utils import DATASETS +from cugraph.experimental.datasets import DATASETS # depends on karate variant # ============================================================================= diff --git a/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py b/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py index 5c34866e0d0..b4b6ee5f22b 100644 --- a/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py @@ -17,12 +17,14 @@ import cudf import cugraph -from cugraph.testing import utils +from cugraph.testing import ( + utils, + DATASETS, + DATASETS_UNDIRECTED, +) from cugraph.experimental.datasets import ( toy_graph_undirected, karate, - DATASETS, - DATASETS_UNDIRECTED, ) # Temporarily suppress warnings till networkX fixes deprecation warnings 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 56c719ce7da..2c13de4fa34 100644 --- a/python/cugraph/cugraph/tests/community/test_k_truss_subgraph.py +++ b/python/cugraph/cugraph/tests/community/test_k_truss_subgraph.py @@ -16,11 +16,11 @@ import pytest import cugraph -from cugraph.testing import utils +from cugraph.testing import utils, DATASETS_KTRUSS import numpy as np from numba import cuda -from cugraph.experimental.datasets import DATASETS_KTRUSS, karate_asymmetric +from cugraph.experimental.datasets import karate_asymmetric # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from @@ -92,7 +92,7 @@ def test_unsupported_cuda_version(): k = 5 graph_file = DATASETS_KTRUSS[0][0] - G = graph_file.get_graph() + G = graph_file.get_graph(fetch=True) if __cuda_version == __unsupported_cuda_version: with pytest.raises(NotImplementedError): cugraph.k_truss(G, k) @@ -146,7 +146,9 @@ def test_ktruss_subgraph_directed_Graph(): k = 5 edgevals = True G = karate_asymmetric.get_graph( - create_using=cugraph.Graph(directed=True), ignore_weights=not edgevals + fetch=True, + create_using=cugraph.Graph(directed=True), + ignore_weights=not edgevals, ) with pytest.raises(ValueError): cugraph.k_truss(G, k) diff --git a/python/cugraph/cugraph/tests/community/test_leiden.py b/python/cugraph/cugraph/tests/community/test_leiden.py index 9cbe0df2532..988ce57e176 100644 --- a/python/cugraph/cugraph/tests/community/test_leiden.py +++ b/python/cugraph/cugraph/tests/community/test_leiden.py @@ -19,8 +19,8 @@ import networkx as nx import cugraph import cudf -from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED, karate_asymmetric +from cugraph.testing import utils, DATASETS_UNDIRECTED +from cugraph.experimental.datasets import karate_asymmetric from cudf.testing.testing import assert_series_equal diff --git a/python/cugraph/cugraph/tests/community/test_louvain.py b/python/cugraph/cugraph/tests/community/test_louvain.py index 6c0dcef8c4a..c339bddac77 100644 --- a/python/cugraph/cugraph/tests/community/test_louvain.py +++ b/python/cugraph/cugraph/tests/community/test_louvain.py @@ -19,8 +19,8 @@ import cugraph import cupyx import cudf -from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED, karate_asymmetric +from cugraph.testing import utils, DATASETS_UNDIRECTED +from cugraph.experimental.datasets import karate_asymmetric # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from diff --git a/python/cugraph/cugraph/tests/community/test_triangle_count.py b/python/cugraph/cugraph/tests/community/test_triangle_count.py index 3705ffbf8ed..7c4418d38ac 100644 --- a/python/cugraph/cugraph/tests/community/test_triangle_count.py +++ b/python/cugraph/cugraph/tests/community/test_triangle_count.py @@ -19,8 +19,8 @@ from pylibcugraph.testing.utils import gen_fixture_params_product import cugraph -from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED, karate_asymmetric +from cugraph.testing import utils, DATASETS_UNDIRECTED +from cugraph.experimental.datasets import karate_asymmetric # Temporarily suppress warnings till networkX fixes deprecation warnings diff --git a/python/cugraph/cugraph/tests/components/test_connectivity.py b/python/cugraph/cugraph/tests/components/test_connectivity.py index 71bec2e15c1..0529ab51a68 100644 --- a/python/cugraph/cugraph/tests/components/test_connectivity.py +++ b/python/cugraph/cugraph/tests/components/test_connectivity.py @@ -24,12 +24,11 @@ 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 -from cugraph.experimental.datasets import DATASETS, STRONGDATASETS from cugraph.utilities import is_nx_graph_type import cudf import cugraph -from cugraph.testing import utils +from cugraph.testing import utils, DATASETS, STRONGDATASETS # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from diff --git a/python/cugraph/cugraph/tests/core/test_core_number.py b/python/cugraph/cugraph/tests/core/test_core_number.py index 6a8fedfe11c..fce284ab196 100644 --- a/python/cugraph/cugraph/tests/core/test_core_number.py +++ b/python/cugraph/cugraph/tests/core/test_core_number.py @@ -19,8 +19,7 @@ import networkx as nx import cugraph -from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED +from cugraph.testing import utils, DATASETS_UNDIRECTED # ============================================================================= diff --git a/python/cugraph/cugraph/tests/core/test_k_core.py b/python/cugraph/cugraph/tests/core/test_k_core.py index 1ea3bdd8a0a..fa8067d8cc6 100644 --- a/python/cugraph/cugraph/tests/core/test_k_core.py +++ b/python/cugraph/cugraph/tests/core/test_k_core.py @@ -16,8 +16,7 @@ import pytest import cugraph -from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED +from cugraph.testing import utils, DATASETS_UNDIRECTED # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from 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 8bc2da37e89..fd650113113 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 @@ -24,8 +24,7 @@ from cugraph.dask.common.mg_utils import is_single_gpu import cugraph.dask as dcg -from cugraph.experimental.datasets import cyber -from cugraph.experimental.datasets import netscience +from cugraph.experimental.datasets import cyber, netscience # 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/internals/test_renumber.py b/python/cugraph/cugraph/tests/internals/test_renumber.py index 4526770ec2a..833769131e6 100644 --- a/python/cugraph/cugraph/tests/internals/test_renumber.py +++ b/python/cugraph/cugraph/tests/internals/test_renumber.py @@ -22,7 +22,7 @@ from cugraph.structure.number_map import NumberMap from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS +from cugraph.experimental.datasets import DATASETS # using old karate variants @pytest.mark.sg diff --git a/python/cugraph/cugraph/tests/internals/test_symmetrize.py b/python/cugraph/cugraph/tests/internals/test_symmetrize.py index 8d772abe822..8f68decf4b1 100644 --- a/python/cugraph/cugraph/tests/internals/test_symmetrize.py +++ b/python/cugraph/cugraph/tests/internals/test_symmetrize.py @@ -18,7 +18,7 @@ import pandas as pd import cudf import cugraph -from cugraph.experimental.datasets import DATASETS +from cugraph.experimental.datasets import DATASETS # using old karate variants @pytest.mark.sg diff --git a/python/cugraph/cugraph/tests/link_analysis/test_hits.py b/python/cugraph/cugraph/tests/link_analysis/test_hits.py index 16d89f20e80..30a9fb82bcc 100644 --- a/python/cugraph/cugraph/tests/link_analysis/test_hits.py +++ b/python/cugraph/cugraph/tests/link_analysis/test_hits.py @@ -20,8 +20,8 @@ from pylibcugraph.testing.utils import gen_fixture_params_product import cugraph -from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED, email_Eu_core, karate +from cugraph.testing import utils, DATASETS_UNDIRECTED +from cugraph.experimental.datasets import email_Eu_core, karate # ============================================================================= diff --git a/python/cugraph/cugraph/tests/link_analysis/test_pagerank.py b/python/cugraph/cugraph/tests/link_analysis/test_pagerank.py index b7487ae329c..9fa491e7dad 100644 --- a/python/cugraph/cugraph/tests/link_analysis/test_pagerank.py +++ b/python/cugraph/cugraph/tests/link_analysis/test_pagerank.py @@ -20,7 +20,7 @@ import cudf import cugraph from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS, karate +from cugraph.experimental.datasets import DATASETS, karate # using old karate variants # Temporarily suppress warnings till networkX fixes deprecation warnings diff --git a/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py b/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py index b04c4c741b1..ff0ecb087fe 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py @@ -18,10 +18,10 @@ from cudf.testing import assert_series_equal, assert_frame_equal import cugraph -from cugraph.testing import utils +from cugraph.testing import utils, DATASETS_UNDIRECTED from cugraph.experimental import jaccard_coefficient as exp_jaccard_coefficient from cugraph.experimental import jaccard as exp_jaccard -from cugraph.experimental.datasets import DATASETS_UNDIRECTED, netscience +from cugraph.experimental.datasets import netscience # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from diff --git a/python/cugraph/cugraph/tests/link_prediction/test_overlap.py b/python/cugraph/cugraph/tests/link_prediction/test_overlap.py index 68f879dacdb..9d5638a1bfb 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_overlap.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_overlap.py @@ -22,8 +22,7 @@ from cugraph.experimental import overlap as exp_overlap import cugraph -from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED +from cugraph.testing import utils, DATASETS_UNDIRECTED # ============================================================================= diff --git a/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py b/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py index 3457627ed7d..4f7fac85086 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py @@ -18,9 +18,9 @@ from cudf.testing import assert_series_equal, assert_frame_equal import cugraph -from cugraph.testing import utils +from cugraph.testing import utils, DATASETS_UNDIRECTED from cugraph.experimental import sorensen as exp_sorensen -from cugraph.experimental.datasets import DATASETS_UNDIRECTED, netscience +from cugraph.experimental.datasets import netscience # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from diff --git a/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py b/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py index 22ace93c0e4..8ed64e1c787 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py @@ -20,8 +20,7 @@ from cudf.testing import assert_series_equal import cugraph -from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED +from cugraph.testing import utils, DATASETS_UNDIRECTED # Temporarily suppress warnings till networkX fixes deprecation warnings diff --git a/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py b/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py index f4fab9d0faa..360ac9f9286 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py @@ -18,10 +18,9 @@ import numpy as np import cudf from cudf.testing import assert_series_equal -from cugraph.experimental.datasets import DATASETS_UNDIRECTED import cugraph -from cugraph.testing import utils +from cugraph.testing import utils, DATASETS_UNDIRECTED # ============================================================================= diff --git a/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py b/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py index 0cf775d666c..e2cae33d432 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py @@ -20,8 +20,7 @@ from cudf.testing import assert_series_equal import cugraph -from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED +from cugraph.testing import utils, DATASETS_UNDIRECTED # Temporarily suppress warnings till networkX fixes deprecation warnings diff --git a/python/cugraph/cugraph/tests/nx/test_nx_convert.py b/python/cugraph/cugraph/tests/nx/test_nx_convert.py index ee14bfe361c..038a9a890e5 100644 --- a/python/cugraph/cugraph/tests/nx/test_nx_convert.py +++ b/python/cugraph/cugraph/tests/nx/test_nx_convert.py @@ -17,7 +17,7 @@ import cugraph from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS +from cugraph.experimental.datasets import DATASETS # using old karate variant # Temporarily suppress warnings till networkX fixes deprecation warnings diff --git a/python/cugraph/cugraph/tests/sampling/test_egonet.py b/python/cugraph/cugraph/tests/sampling/test_egonet.py index 2af31438a13..3a983bd538b 100644 --- a/python/cugraph/cugraph/tests/sampling/test_egonet.py +++ b/python/cugraph/cugraph/tests/sampling/test_egonet.py @@ -17,7 +17,7 @@ import cudf import cugraph from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS +from cugraph.experimental.datasets import DATASETS # using old karate variants # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from diff --git a/python/cugraph/cugraph/tests/sampling/test_node2vec.py b/python/cugraph/cugraph/tests/sampling/test_node2vec.py index 60b937cc1b2..5ec54bdcefe 100644 --- a/python/cugraph/cugraph/tests/sampling/test_node2vec.py +++ b/python/cugraph/cugraph/tests/sampling/test_node2vec.py @@ -15,10 +15,10 @@ import random import pytest -from cugraph.testing import utils +from cugraph.testing import utils, DATASETS_SMALL import cugraph import cudf -from cugraph.experimental.datasets import small_line, karate, DATASETS_SMALL +from cugraph.experimental.datasets import small_line, karate # ============================================================================= @@ -75,7 +75,7 @@ def calc_node2vec(G, start_vertices, max_depth, compress_result, p=1.0, q=1.0): @pytest.mark.sg @pytest.mark.parametrize(*_get_param_args("graph_file", [KARATE])) def test_node2vec_invalid(graph_file): - G = graph_file.get_graph(create_using=cugraph.Graph(directed=True)) + G = graph_file.get_graph(fetch=True, create_using=cugraph.Graph(directed=True)) k = random.randint(1, 10) start_vertices = cudf.Series( random.sample(range(G.number_of_vertices()), k), dtype="int32" @@ -135,7 +135,7 @@ def test_node2vec_invalid(graph_file): @pytest.mark.parametrize(*_get_param_args("graph_file", [LINE])) @pytest.mark.parametrize(*_get_param_args("directed", DIRECTED_GRAPH_OPTIONS)) def test_node2vec_line(graph_file, directed): - G = graph_file.get_graph(create_using=cugraph.Graph(directed=directed)) + G = graph_file.get_graph(fetch=True, create_using=cugraph.Graph(directed=directed)) max_depth = 3 start_vertices = cudf.Series([0, 3, 6], dtype="int32") df, seeds = calc_node2vec( diff --git a/python/cugraph/cugraph/tests/sampling/test_random_walks.py b/python/cugraph/cugraph/tests/sampling/test_random_walks.py index 508f927c296..34fa4db6ae0 100644 --- a/python/cugraph/cugraph/tests/sampling/test_random_walks.py +++ b/python/cugraph/cugraph/tests/sampling/test_random_walks.py @@ -21,7 +21,8 @@ import cudf import networkx as nx from cugraph.utilities import ensure_cugraph_obj_for_nx -from cugraph.experimental.datasets import DATASETS, DATASETS_SMALL +from cugraph.experimental.datasets import DATASETS # using old karate variants +from cugraph.testing import DATASETS_SMALL # ============================================================================= # 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 df1db0a95a9..2e7db9254ac 100644 --- a/python/cugraph/cugraph/tests/sampling/test_random_walks_mg.py +++ b/python/cugraph/cugraph/tests/sampling/test_random_walks_mg.py @@ -22,7 +22,8 @@ # from cugraph.dask.common.mg_utils import is_single_gpu import cugraph.dask as dcg -from cugraph.experimental.datasets import DATASETS_SMALL, karate_asymmetric +from cugraph.experimental.datasets import karate_asymmetric +from cugraph.testing import DATASETS_SMALL # ============================================================================= 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 5d2f050bce9..b15f0152835 100644 --- a/python/cugraph/cugraph/tests/sampling/test_uniform_neighbor_sample.py +++ b/python/cugraph/cugraph/tests/sampling/test_uniform_neighbor_sample.py @@ -19,7 +19,8 @@ import cugraph from cugraph import uniform_neighbor_sample -from cugraph.experimental.datasets import DATASETS_UNDIRECTED, email_Eu_core, small_tree +from cugraph.experimental.datasets import email_Eu_core, small_tree +from cugraph.testing import DATASETS_UNDIRECTED # ============================================================================= 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 033b96487c4..5b3beea0583 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 @@ -25,7 +25,8 @@ import cugraph from cugraph.dask import uniform_neighbor_sample -from cugraph.experimental.datasets import DATASETS_UNDIRECTED, email_Eu_core, small_tree +from cugraph.experimental.datasets import email_Eu_core, small_tree +from cugraph.testing import DATASETS_UNDIRECTED # 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_multigraph.py b/python/cugraph/cugraph/tests/structure/test_multigraph.py index e317a935cfc..733c77a6039 100644 --- a/python/cugraph/cugraph/tests/structure/test_multigraph.py +++ b/python/cugraph/cugraph/tests/structure/test_multigraph.py @@ -19,7 +19,7 @@ import cugraph from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS +from cugraph.experimental.datasets import DATASETS # using deleted karate variants # ============================================================================= diff --git a/python/cugraph/cugraph/tests/traversal/test_filter_unreachable.py b/python/cugraph/cugraph/tests/traversal/test_filter_unreachable.py index 495e1a4ec11..16ecee540a0 100644 --- a/python/cugraph/cugraph/tests/traversal/test_filter_unreachable.py +++ b/python/cugraph/cugraph/tests/traversal/test_filter_unreachable.py @@ -17,7 +17,7 @@ import numpy as np import cugraph -from cugraph.experimental.datasets import DATASETS +from cugraph.experimental.datasets import DATASETS # using deleted karate variants # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from diff --git a/python/cugraph/cugraph/tests/traversal/test_sssp.py b/python/cugraph/cugraph/tests/traversal/test_sssp.py index 1c99123f866..5779d658a42 100644 --- a/python/cugraph/cugraph/tests/traversal/test_sssp.py +++ b/python/cugraph/cugraph/tests/traversal/test_sssp.py @@ -27,10 +27,9 @@ from scipy.sparse import csc_matrix as sp_csc_matrix import cudf from pylibcugraph.testing.utils import gen_fixture_params_product -from cugraph.experimental.datasets import DATASETS_UNDIRECTED import cugraph -from cugraph.testing import utils +from cugraph.testing import utils, DATASETS_UNDIRECTED from cugraph.experimental import datasets 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 8a3852595fc..eedcafc78bf 100644 --- a/python/cugraph/cugraph/tests/tree/test_maximum_spanning_tree.py +++ b/python/cugraph/cugraph/tests/tree/test_maximum_spanning_tree.py @@ -20,8 +20,7 @@ import cudf import cugraph -from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED_WEIGHTS +from cugraph.testing import utils, DATASETS_UNDIRECTED_WEIGHTS # Temporarily suppress warnings till networkX fixes deprecation warnings 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 6f36864f552..20d1c58d33f 100644 --- a/python/cugraph/cugraph/tests/tree/test_minimum_spanning_tree.py +++ b/python/cugraph/cugraph/tests/tree/test_minimum_spanning_tree.py @@ -20,8 +20,7 @@ import cudf import cugraph -from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS_UNDIRECTED_WEIGHTS +from cugraph.testing import utils, DATASETS_UNDIRECTED_WEIGHTS # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from diff --git a/python/cugraph/cugraph/tests/utils/test_dataset.py b/python/cugraph/cugraph/tests/utils/test_dataset.py index 9cd94834f53..02ae6e61ffc 100644 --- a/python/cugraph/cugraph/tests/utils/test_dataset.py +++ b/python/cugraph/cugraph/tests/utils/test_dataset.py @@ -241,7 +241,6 @@ def test_unload(): assert ds._edgelist is None -# TODO: check for all datasets @pytest.mark.parametrize("dataset", ALL_DATASETS) def test_node_and_edge_count(dataset): dataset_is_directed = dataset.metadata["is_directed"] From 15a00f9bf5d3cefece2310f1b7ea2ead340b1d45 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Fri, 7 Jul 2023 07:42:14 -0700 Subject: [PATCH 12/57] Removed outdated dataset batches from unit tests --- python/cugraph/cugraph/datasets/__init__.py | 2 ++ .../datasets/metadata/karate-disjoint.yaml | 22 ++++++++++++ .../datasets/metadata/karate_asymmetric.yaml | 24 +++++++++++++ python/cugraph/cugraph/testing/__init__.py | 36 +++++++++---------- .../centrality/test_betweenness_centrality.py | 5 +-- .../test_edge_betweenness_centrality.py | 5 +-- .../centrality/test_eigenvector_centrality.py | 8 ++--- .../test_eigenvector_centrality_mg.py | 2 +- .../tests/centrality/test_katz_centrality.py | 4 +-- .../tests/community/test_balanced_cut.py | 8 ++--- .../tests/community/test_k_truss_subgraph.py | 20 ++++++----- .../cugraph/tests/community/test_leiden.py | 4 ++- .../cugraph/tests/community/test_louvain.py | 2 +- .../tests/community/test_modularity.py | 9 +++-- .../community/test_subgraph_extraction.py | 12 +++---- .../tests/community/test_triangle_count.py | 4 ++- .../tests/components/test_connectivity.py | 14 +++++--- .../cugraph/tests/core/test_core_number.py | 3 +- .../cugraph/tests/internals/test_renumber.py | 7 ++-- .../tests/internals/test_symmetrize.py | 6 ++-- .../tests/link_analysis/test_pagerank.py | 10 +++--- .../cugraph/tests/nx/test_nx_convert.py | 13 ++++--- .../cugraph/tests/sampling/test_egonet.py | 9 +++-- .../cugraph/tests/sampling/test_node2vec.py | 2 +- .../tests/sampling/test_random_walks.py | 5 ++- .../tests/sampling/test_random_walks_mg.py | 2 +- .../tests/structure/test_multigraph.py | 9 +++-- .../traversal/test_filter_unreachable.py | 4 +-- .../cugraph/tests/traversal/test_sssp.py | 10 +++--- .../tests/tree/test_maximum_spanning_tree.py | 6 +++- .../tests/tree/test_minimum_spanning_tree.py | 6 +++- .../cugraph/tests/utils/test_dataset.py | 12 +++---- 32 files changed, 168 insertions(+), 117 deletions(-) create mode 100644 python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml create mode 100644 python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml diff --git a/python/cugraph/cugraph/datasets/__init__.py b/python/cugraph/cugraph/datasets/__init__.py index b5324264a9b..339af81d802 100644 --- a/python/cugraph/cugraph/datasets/__init__.py +++ b/python/cugraph/cugraph/datasets/__init__.py @@ -31,6 +31,8 @@ dolphins = Dataset(meta_path / "dolphins.yaml") email_Eu_core = Dataset(meta_path / "email-Eu-core.yaml") karate = Dataset(meta_path / "karate.yaml") +karate_asymmetric = Dataset(meta_path / "karate_asymmetric.yaml") +karate_disjoint = Dataset(meta_path / "karate-disjoint.yaml") ktruss_polbooks = Dataset(meta_path / "ktruss_polbooks.yaml") netscience = Dataset(meta_path / "netscience.yaml") polbooks = Dataset(meta_path / "polbooks.yaml") diff --git a/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml b/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml new file mode 100644 index 00000000000..0c0eaf78b63 --- /dev/null +++ b/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml @@ -0,0 +1,22 @@ +name: karate-disjoint +file_type: .csv +author: null +url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/karate-disjoint.csv +refs: null +delim: " " +header: None +col_names: + - src + - dst + - wgt +col_types: + - int32 + - int32 + - float32 +has_loop: false +is_directed: True +is_multigraph: false +is_symmetric: true +number_of_edges: 312 +number_of_nodes: 68 +number_of_lines: 312 diff --git a/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml new file mode 100644 index 00000000000..3616b8fb3a5 --- /dev/null +++ b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml @@ -0,0 +1,24 @@ +name: karate-asymmetric +file_type: .csv +author: Zachary W. +url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/karate-asymmetric.csv +delim: " " +header: None +refs: + W. W. Zachary, An information flow model for conflict and fission in small groups, + Journal of Anthropological Research 33, 452-473 (1977). +col_names: + - src + - dst + - wgt +col_types: + - int32 + - int32 + - float32 +has_loop: true +is_directed: false +is_multigraph: false +is_symmetric: false +number_of_edges: 78 +number_of_nodes: 34 +number_of_lines: 78 diff --git a/python/cugraph/cugraph/testing/__init__.py b/python/cugraph/cugraph/testing/__init__.py index ab364f64fc3..f72aeff31ba 100644 --- a/python/cugraph/cugraph/testing/__init__.py +++ b/python/cugraph/cugraph/testing/__init__.py @@ -12,18 +12,11 @@ # limitations under the License. from cugraph.testing.utils import RAPIDS_DATASET_ROOT_DIR_PATH, RAPIDS_DATASET_ROOT_DIR - -# -# Moved Dataset Batches -# - -# FIXME: it is hard to keep track of which datasets are included in certain batches and which are not. maybe convert this to a single fixture that let's you import datasets by name and yields a list? eg. get_batch("A", "B", C") => [A, B, C] -# batches - from cugraph.datasets import ( cyber, dolphins, karate, + karate_disjoint, ktruss_polbooks, polbooks, netscience, @@ -34,17 +27,25 @@ toy_graph_undirected, ) +# +# Moved Dataset Batches +# + DATASETS_UNDIRECTED = [karate, dolphins] -DATASETS_UNDIRECTED_WEIGHTS = [netscience] DATASETS_SMALL = [karate, dolphins, polbooks] -STRONGDATASETS = [dolphins, netscience, email_Eu_core] -DATASETS_KTRUSS = [(polbooks, ktruss_polbooks)] -MEDIUM_DATASETS = [polbooks] -SMALL_DATASETS = [karate, dolphins, netscience] -RLY_SMALL_DATASETS = [small_line, small_tree] +DATASETS_WEIGHTS = [ + dolphins, + karate, + karate_disjoint, + netscience, + polbooks, + small_line, + small_tree, +] ALL_DATASETS = [ dolphins, karate, + karate_disjoint, ktruss_polbooks, polbooks, netscience, @@ -54,9 +55,4 @@ toy_graph, toy_graph_undirected, ] -ALL_DATASETS_WGT = [karate, dolphins, netscience, polbooks, small_line, small_tree] -TEST_GROUP = [dolphins, netscience] - -# FIXME: removed karate variant. check if unit tests are breaking -DATASETS_UNRENUMBERED = [] -DATASETS = [dolphins, netscience, karate] +DATASETS_TESTING = [dolphins, netscience, karate_disjoint] diff --git a/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py b/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py index e66b86f7fe1..b3b36f24b3d 100644 --- a/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py @@ -16,7 +16,8 @@ import pytest import cugraph -from cugraph.testing import utils, DATASETS_SMALL, DATASETS_UNRENUMBERED +from cugraph.datasets import karate_disjoint +from cugraph.testing import utils, DATASETS_SMALL import random import numpy as np import cudf @@ -385,7 +386,7 @@ def test_betweenness_centrality_k_full( # to a random sampling over the number of vertices (thus direct offsets) # in the graph structure instead of actual vertices identifiers @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNRENUMBERED) +@pytest.mark.parametrize("graph_file", [karate_disjoint]) @pytest.mark.parametrize("directed", DIRECTED_GRAPH_OPTIONS) @pytest.mark.parametrize("subset_size", SUBSET_SIZE_OPTIONS) @pytest.mark.parametrize("normalized", NORMALIZED_OPTIONS) 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 8b4d118e3de..efba3089b55 100644 --- a/python/cugraph/cugraph/tests/centrality/test_edge_betweenness_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_edge_betweenness_centrality.py @@ -16,7 +16,8 @@ import pytest import cugraph -from cugraph.testing import utils, DATASETS_SMALL, DATASETS_UNRENUMBERED +from cugraph.datasets import karate_disjoint +from cugraph.testing import utils, DATASETS_SMALL import random import numpy as np import cupy @@ -384,7 +385,7 @@ def test_edge_betweenness_centrality_k_full( # to a random sampling over the number of vertices (thus direct offsets) # in the graph structure instead of actual vertices identifiers @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNRENUMBERED) +@pytest.mark.parametrize("graph_file", [karate_disjoint]) @pytest.mark.parametrize("directed", DIRECTED_GRAPH_OPTIONS) @pytest.mark.parametrize("subset_size", SUBSET_SIZE_OPTIONS) @pytest.mark.parametrize("normalized", NORMALIZED_OPTIONS) diff --git a/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py b/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py index c0dba47582b..e27bf3a0c08 100644 --- a/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py @@ -16,11 +16,7 @@ import pytest import cugraph -from cugraph.testing import ( - utils, - DATASETS_UNDIRECTED, - DATASETS, -) +from cugraph.testing import utils, DATASETS_UNDIRECTED, DATASETS_TESTING from cugraph.experimental.datasets import toy_graph, karate import networkx as nx @@ -61,7 +57,7 @@ def calc_eigenvector(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) def test_eigenvector_centrality(graph_file): eigen_scores = calc_eigenvector(graph_file) 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 beef5461739..f91ac418ef0 100644 --- a/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality_mg.py +++ b/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality_mg.py @@ -19,7 +19,7 @@ import dask_cudf import cudf from cugraph.dask.common.mg_utils import is_single_gpu -from cugraph.experimental.datasets import DATASETS # depends on karate variant +from cugraph.testing.utils import DATASETS # ============================================================================= diff --git a/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py b/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py index b4b6ee5f22b..47194105858 100644 --- a/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py @@ -19,7 +19,7 @@ import cugraph from cugraph.testing import ( utils, - DATASETS, + DATASETS_TESTING, DATASETS_UNDIRECTED, ) from cugraph.experimental.datasets import ( @@ -77,7 +77,7 @@ def calc_katz(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) def test_katz_centrality(graph_file): katz_scores = calc_katz(graph_file) diff --git a/python/cugraph/cugraph/tests/community/test_balanced_cut.py b/python/cugraph/cugraph/tests/community/test_balanced_cut.py index 5beca07dfb7..7d7d6bfe58c 100644 --- a/python/cugraph/cugraph/tests/community/test_balanced_cut.py +++ b/python/cugraph/cugraph/tests/community/test_balanced_cut.py @@ -19,7 +19,7 @@ import pandas as pd import cudf import cugraph -from cugraph.experimental.datasets import DATASETS +from cugraph.testing import DATASETS_TESTING def cugraph_call(G, partitions): @@ -57,7 +57,7 @@ def random_call(G, partitions): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) @pytest.mark.parametrize("partitions", PARTITIONS) def test_edge_cut_clustering(graph_file, partitions): gc.collect() @@ -78,7 +78,7 @@ def test_edge_cut_clustering(graph_file, partitions): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) @pytest.mark.parametrize("partitions", PARTITIONS) def test_edge_cut_clustering_with_edgevals(graph_file, partitions): gc.collect() @@ -101,7 +101,7 @@ def test_edge_cut_clustering_with_edgevals(graph_file, partitions): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", [DATASETS[2]]) +@pytest.mark.parametrize("graph_file", [DATASETS_TESTING[2]]) @pytest.mark.parametrize("partitions", PARTITIONS) def test_edge_cut_clustering_with_edgevals_nx(graph_file, partitions): gc.collect() 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 2c13de4fa34..72b504dc6b7 100644 --- a/python/cugraph/cugraph/tests/community/test_k_truss_subgraph.py +++ b/python/cugraph/cugraph/tests/community/test_k_truss_subgraph.py @@ -15,12 +15,12 @@ import pytest -import cugraph -from cugraph.testing import utils, DATASETS_KTRUSS - import numpy as np from numba import cuda -from cugraph.experimental.datasets import karate_asymmetric + +import cugraph +from cugraph.testing import utils +from cugraph.datasets import polbooks, ktruss_polbooks, karate_asymmetric # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from @@ -35,10 +35,13 @@ print("Networkx version : {} ".format(nx.__version__)) +DATASETS_KTRUSS = [(polbooks, ktruss_polbooks)] # ============================================================================= # Pytest Setup / Teardown - called for each test function # ============================================================================= + + def setup_function(): gc.collect() @@ -105,18 +108,17 @@ def test_unsupported_cuda_version(): (__cuda_version == __unsupported_cuda_version), reason="skipping on unsupported CUDA " f"{__unsupported_cuda_version} environment.", ) -@pytest.mark.parametrize("graph_file, nx_ground_truth", utils.DATASETS_KTRUSS) -def test_ktruss_subgraph_Graph(graph_file, nx_ground_truth): +@pytest.mark.parametrize("_, nx_ground_truth", utils.DATASETS_KTRUSS) +def test_ktruss_subgraph_Graph(_, nx_ground_truth): k = 5 - cu_M = utils.read_csv_file(graph_file) - G = cugraph.Graph() - G.from_cudf_edgelist(cu_M, source="0", destination="1", edge_attr="2") + G = polbooks.get_graph(fetch=True, create_using=cugraph.Graph(directed=False)) k_subgraph = cugraph.ktruss_subgraph(G, k) compare_k_truss(k_subgraph, k, nx_ground_truth) +# FIXME: currently failing due to a FileNotFound error from cugraph build @pytest.mark.sg @pytest.mark.skipif( (__cuda_version == __unsupported_cuda_version), diff --git a/python/cugraph/cugraph/tests/community/test_leiden.py b/python/cugraph/cugraph/tests/community/test_leiden.py index 988ce57e176..ada434c5ed4 100644 --- a/python/cugraph/cugraph/tests/community/test_leiden.py +++ b/python/cugraph/cugraph/tests/community/test_leiden.py @@ -20,7 +20,9 @@ import cugraph import cudf from cugraph.testing import utils, DATASETS_UNDIRECTED -from cugraph.experimental.datasets import karate_asymmetric +from cugraph.experimental.datasets import ( + karate_asymmetric, +) # using deleted karate variant from cudf.testing.testing import assert_series_equal diff --git a/python/cugraph/cugraph/tests/community/test_louvain.py b/python/cugraph/cugraph/tests/community/test_louvain.py index c339bddac77..0670c4a6b98 100644 --- a/python/cugraph/cugraph/tests/community/test_louvain.py +++ b/python/cugraph/cugraph/tests/community/test_louvain.py @@ -20,7 +20,7 @@ import cupyx import cudf from cugraph.testing import utils, DATASETS_UNDIRECTED -from cugraph.experimental.datasets import karate_asymmetric +from cugraph.datasets import karate_asymmetric # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from diff --git a/python/cugraph/cugraph/tests/community/test_modularity.py b/python/cugraph/cugraph/tests/community/test_modularity.py index 07fa2718ee1..294a574dfd9 100644 --- a/python/cugraph/cugraph/tests/community/test_modularity.py +++ b/python/cugraph/cugraph/tests/community/test_modularity.py @@ -18,9 +18,8 @@ import cudf import cugraph -from cugraph.testing import utils +from cugraph.testing import utils, DATASETS_TESTING from cugraph.utilities import ensure_cugraph_obj_for_nx -from cugraph.experimental.datasets import DATASETS import networkx as nx @@ -55,7 +54,7 @@ def random_call(G, partitions): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) @pytest.mark.parametrize("partitions", PARTITIONS) def test_modularity_clustering(graph_file, partitions): gc.collect() @@ -77,7 +76,7 @@ def test_modularity_clustering(graph_file, partitions): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) @pytest.mark.parametrize("partitions", PARTITIONS) def test_modularity_clustering_nx(graph_file, partitions): # Read in the graph and get a cugraph object @@ -108,7 +107,7 @@ def test_modularity_clustering_nx(graph_file, partitions): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) @pytest.mark.parametrize("partitions", PARTITIONS) def test_modularity_clustering_multi_column(graph_file, partitions): # Read in the graph and get a cugraph object diff --git a/python/cugraph/cugraph/tests/community/test_subgraph_extraction.py b/python/cugraph/cugraph/tests/community/test_subgraph_extraction.py index 5b115be81e0..5c20bb3d00e 100644 --- a/python/cugraph/cugraph/tests/community/test_subgraph_extraction.py +++ b/python/cugraph/cugraph/tests/community/test_subgraph_extraction.py @@ -19,8 +19,8 @@ import cudf import cugraph -from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS, karate +from cugraph.testing import utils, DATASETS_TESTING +from cugraph.experimental.datasets import karate ############################################################################### @@ -66,7 +66,7 @@ def nx_call(M, verts, directed=True): ############################################################################### @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) def test_subgraph_extraction_DiGraph(graph_file): dataset_path = graph_file.get_path() M = utils.read_csv_for_nx(dataset_path) @@ -80,7 +80,7 @@ def test_subgraph_extraction_DiGraph(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) def test_subgraph_extraction_Graph(graph_file): dataset_path = graph_file.get_path() M = utils.read_csv_for_nx(dataset_path) @@ -94,7 +94,7 @@ def test_subgraph_extraction_Graph(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", [DATASETS[2]]) +@pytest.mark.parametrize("graph_file", [DATASETS_TESTING[2]]) def test_subgraph_extraction_Graph_nx(graph_file): directed = False verts = np.zeros(3, dtype=np.int32) @@ -123,7 +123,7 @@ def test_subgraph_extraction_Graph_nx(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) def test_subgraph_extraction_multi_column(graph_file): dataset_path = graph_file.get_path() M = utils.read_csv_for_nx(dataset_path) diff --git a/python/cugraph/cugraph/tests/community/test_triangle_count.py b/python/cugraph/cugraph/tests/community/test_triangle_count.py index 7c4418d38ac..f2f0c2e0f37 100644 --- a/python/cugraph/cugraph/tests/community/test_triangle_count.py +++ b/python/cugraph/cugraph/tests/community/test_triangle_count.py @@ -20,7 +20,9 @@ import cugraph from cugraph.testing import utils, DATASETS_UNDIRECTED -from cugraph.experimental.datasets import karate_asymmetric +from cugraph.experimental.datasets import ( + karate_asymmetric, +) # using deleted karate variant # Temporarily suppress warnings till networkX fixes deprecation warnings diff --git a/python/cugraph/cugraph/tests/components/test_connectivity.py b/python/cugraph/cugraph/tests/components/test_connectivity.py index 0529ab51a68..1326165aa5f 100644 --- a/python/cugraph/cugraph/tests/components/test_connectivity.py +++ b/python/cugraph/cugraph/tests/components/test_connectivity.py @@ -14,6 +14,7 @@ import gc import time from collections import defaultdict +import warnings import pytest import cupy as cp @@ -28,14 +29,17 @@ import cudf import cugraph -from cugraph.testing import utils, DATASETS, STRONGDATASETS +from cugraph.testing import utils, DATASETS_TESTING +from cugraph.datasets import dolphins, netscience, email_Eu_core + + +STRONGDATASETS = [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. -import warnings with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=DeprecationWarning) @@ -269,12 +273,12 @@ def assert_scipy_api_compat(G, dataset_path, api_type): # ============================================================================= # Pytest fixtures # ============================================================================= -@pytest.fixture(scope="module", params=DATASETS) +@pytest.fixture(scope="module", params=DATASETS_TESTING) def dataset_nxresults_weak(request): return networkx_weak_call(request.param) -@pytest.fixture(scope="module", params=[DATASETS[0]]) +@pytest.fixture(scope="module", params=[DATASETS_TESTING[0]]) def single_dataset_nxresults_weak(request): return networkx_weak_call(request.param) @@ -441,7 +445,7 @@ def test_scipy_api_compat(connection_type): if connection_type == "strong": graph_file = STRONGDATASETS[0] else: - graph_file = DATASETS[0] + graph_file = DATASETS_TESTING[0] input_cugraph_graph = graph_file.get_graph() diff --git a/python/cugraph/cugraph/tests/core/test_core_number.py b/python/cugraph/cugraph/tests/core/test_core_number.py index fce284ab196..6f924415585 100644 --- a/python/cugraph/cugraph/tests/core/test_core_number.py +++ b/python/cugraph/cugraph/tests/core/test_core_number.py @@ -32,11 +32,10 @@ def setup_function(): # ============================================================================= # Pytest fixtures # ============================================================================= -datasets = DATASETS_UNDIRECTED degree_type = ["incoming", "outgoing"] fixture_params = gen_fixture_params_product( - (datasets, "graph_file"), + (DATASETS_UNDIRECTED, "graph_file"), (degree_type, "degree_type"), ) diff --git a/python/cugraph/cugraph/tests/internals/test_renumber.py b/python/cugraph/cugraph/tests/internals/test_renumber.py index 833769131e6..67485221521 100644 --- a/python/cugraph/cugraph/tests/internals/test_renumber.py +++ b/python/cugraph/cugraph/tests/internals/test_renumber.py @@ -21,8 +21,7 @@ from cudf.testing import assert_series_equal from cugraph.structure.number_map import NumberMap -from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS # using old karate variants +from cugraph.testing import utils, DATASETS_TESTING @pytest.mark.sg @@ -108,7 +107,7 @@ def test_renumber_negative_col(): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) def test_renumber_files_col(graph_file): gc.collect() dataset_path = graph_file.get_path() @@ -150,7 +149,7 @@ def test_renumber_files_col(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) def test_renumber_files_multi_col(graph_file): gc.collect() dataset_path = graph_file.get_path() diff --git a/python/cugraph/cugraph/tests/internals/test_symmetrize.py b/python/cugraph/cugraph/tests/internals/test_symmetrize.py index 8f68decf4b1..52d7cc11b5d 100644 --- a/python/cugraph/cugraph/tests/internals/test_symmetrize.py +++ b/python/cugraph/cugraph/tests/internals/test_symmetrize.py @@ -18,7 +18,7 @@ import pandas as pd import cudf import cugraph -from cugraph.experimental.datasets import DATASETS # using old karate variants +from cugraph.testing import DATASETS_TESTING @pytest.mark.sg @@ -155,7 +155,7 @@ def compare(src1, dst1, val1, src2, dst2, val2): @pytest.mark.sg @pytest.mark.skip("debugging") -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) def test_symmetrize_unweighted(graph_file): gc.collect() @@ -178,7 +178,7 @@ def test_symmetrize_unweighted(graph_file): @pytest.mark.sg @pytest.mark.skip("debugging") -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) def test_symmetrize_weighted(graph_file): gc.collect() cu_M = graph_file.get_edgelist() diff --git a/python/cugraph/cugraph/tests/link_analysis/test_pagerank.py b/python/cugraph/cugraph/tests/link_analysis/test_pagerank.py index 9fa491e7dad..532c3c2162c 100644 --- a/python/cugraph/cugraph/tests/link_analysis/test_pagerank.py +++ b/python/cugraph/cugraph/tests/link_analysis/test_pagerank.py @@ -19,8 +19,8 @@ import cudf import cugraph -from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS, karate # using old karate variants +from cugraph.testing import utils, DATASETS_TESTING +from cugraph.experimental.datasets import karate # using old karate variants # Temporarily suppress warnings till networkX fixes deprecation warnings @@ -158,7 +158,7 @@ def setup_function(): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) @pytest.mark.parametrize("max_iter", MAX_ITERATIONS) @pytest.mark.parametrize("tol", TOLERANCE) @pytest.mark.parametrize("alpha", ALPHA) @@ -224,7 +224,7 @@ def test_pagerank( @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) @pytest.mark.parametrize("max_iter", MAX_ITERATIONS) @pytest.mark.parametrize("tol", TOLERANCE) @pytest.mark.parametrize("alpha", ALPHA) @@ -269,7 +269,7 @@ def test_pagerank_nx(graph_file, max_iter, tol, alpha, personalization_perc, has @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) @pytest.mark.parametrize("max_iter", MAX_ITERATIONS) @pytest.mark.parametrize("tol", TOLERANCE) @pytest.mark.parametrize("alpha", ALPHA) diff --git a/python/cugraph/cugraph/tests/nx/test_nx_convert.py b/python/cugraph/cugraph/tests/nx/test_nx_convert.py index 038a9a890e5..4d60228b98a 100644 --- a/python/cugraph/cugraph/tests/nx/test_nx_convert.py +++ b/python/cugraph/cugraph/tests/nx/test_nx_convert.py @@ -16,8 +16,7 @@ import cudf import cugraph -from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS # using old karate variant +from cugraph.testing import utils, DATASETS_TESTING # Temporarily suppress warnings till networkX fixes deprecation warnings @@ -70,7 +69,7 @@ def _compare_graphs(nxG, cuG, has_wt=True): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) def test_networkx_compatibility(graph_file): # test to make sure cuGraph and Nx build similar Graphs # Read in the graph @@ -97,7 +96,7 @@ def test_networkx_compatibility(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) def test_nx_convert_undirected(graph_file): # read data and create a Nx Graph dataset_path = graph_file.get_path() @@ -114,7 +113,7 @@ def test_nx_convert_undirected(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) def test_nx_convert_directed(graph_file): # read data and create a Nx DiGraph dataset_path = graph_file.get_path() @@ -130,7 +129,7 @@ def test_nx_convert_directed(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) def test_nx_convert_weighted(graph_file): # read data and create a Nx DiGraph dataset_path = graph_file.get_path() @@ -147,7 +146,7 @@ def test_nx_convert_weighted(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) def test_nx_convert_multicol(graph_file): # read data and create a Nx Graph dataset_path = graph_file.get_path() diff --git a/python/cugraph/cugraph/tests/sampling/test_egonet.py b/python/cugraph/cugraph/tests/sampling/test_egonet.py index 3a983bd538b..b330dcf4040 100644 --- a/python/cugraph/cugraph/tests/sampling/test_egonet.py +++ b/python/cugraph/cugraph/tests/sampling/test_egonet.py @@ -16,8 +16,7 @@ import cudf import cugraph -from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS # using old karate variants +from cugraph.testing import utils, DATASETS_TESTING # using old karate variants # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from @@ -37,7 +36,7 @@ @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) @pytest.mark.parametrize("seed", SEEDS) @pytest.mark.parametrize("radius", RADIUS) def test_ego_graph_nx(graph_file, seed, radius): @@ -58,7 +57,7 @@ def test_ego_graph_nx(graph_file, seed, radius): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) @pytest.mark.parametrize("seeds", [[0, 5, 13]]) @pytest.mark.parametrize("radius", [1, 2, 3]) def test_batched_ego_graphs(graph_file, seeds, radius): @@ -83,7 +82,7 @@ def test_batched_ego_graphs(graph_file, seeds, radius): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) @pytest.mark.parametrize("seed", SEEDS) @pytest.mark.parametrize("radius", RADIUS) def test_multi_column_ego_graph(graph_file, seed, radius): diff --git a/python/cugraph/cugraph/tests/sampling/test_node2vec.py b/python/cugraph/cugraph/tests/sampling/test_node2vec.py index 5ec54bdcefe..2e1ca1b6911 100644 --- a/python/cugraph/cugraph/tests/sampling/test_node2vec.py +++ b/python/cugraph/cugraph/tests/sampling/test_node2vec.py @@ -18,7 +18,7 @@ from cugraph.testing import utils, DATASETS_SMALL import cugraph import cudf -from cugraph.experimental.datasets import small_line, karate +from cugraph.datasets import small_line, karate # ============================================================================= diff --git a/python/cugraph/cugraph/tests/sampling/test_random_walks.py b/python/cugraph/cugraph/tests/sampling/test_random_walks.py index 34fa4db6ae0..b811fbd0f11 100644 --- a/python/cugraph/cugraph/tests/sampling/test_random_walks.py +++ b/python/cugraph/cugraph/tests/sampling/test_random_walks.py @@ -21,15 +21,14 @@ import cudf import networkx as nx from cugraph.utilities import ensure_cugraph_obj_for_nx -from cugraph.experimental.datasets import DATASETS # using old karate variants -from cugraph.testing import DATASETS_SMALL +from cugraph.testing import DATASETS_SMALL, DATASETS_TESTING # ============================================================================= # Parameters # ============================================================================= DIRECTED_GRAPH_OPTIONS = [False, True] WEIGHTED_GRAPH_OPTIONS = [False, True] -DATASETS = [pytest.param(d) for d in DATASETS] +DATASETS = [pytest.param(d) for d in DATASETS_TESTING] DATASETS_SMALL = [pytest.param(d) for d in DATASETS_SMALL] 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 2e7db9254ac..078b095030d 100644 --- a/python/cugraph/cugraph/tests/sampling/test_random_walks_mg.py +++ b/python/cugraph/cugraph/tests/sampling/test_random_walks_mg.py @@ -22,7 +22,7 @@ # from cugraph.dask.common.mg_utils import is_single_gpu import cugraph.dask as dcg -from cugraph.experimental.datasets import karate_asymmetric +from cugraph.datasets import karate_asymmetric from cugraph.testing import DATASETS_SMALL diff --git a/python/cugraph/cugraph/tests/structure/test_multigraph.py b/python/cugraph/cugraph/tests/structure/test_multigraph.py index 733c77a6039..e8f1f8cf53a 100644 --- a/python/cugraph/cugraph/tests/structure/test_multigraph.py +++ b/python/cugraph/cugraph/tests/structure/test_multigraph.py @@ -18,8 +18,7 @@ import numpy as np import cugraph -from cugraph.testing import utils -from cugraph.experimental.datasets import DATASETS # using deleted karate variants +from cugraph.testing import utils, DATASETS_TESTING # ============================================================================= @@ -30,7 +29,7 @@ def setup_function(): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) def test_multigraph(graph_file): # FIXME: Migrate to new test fixtures for Graph setup once available G = graph_file.get_graph(create_using=cugraph.MultiGraph(directed=True)) @@ -61,7 +60,7 @@ def test_multigraph(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) def test_Graph_from_MultiGraph(graph_file): # FIXME: Migrate to new test fixtures for Graph setup once available GM = graph_file.get_graph(create_using=cugraph.MultiGraph()) @@ -92,7 +91,7 @@ def test_Graph_from_MultiGraph(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) def test_multigraph_sssp(graph_file): # FIXME: Migrate to new test fixtures for Graph setup once available G = graph_file.get_graph(create_using=cugraph.MultiGraph(directed=True)) diff --git a/python/cugraph/cugraph/tests/traversal/test_filter_unreachable.py b/python/cugraph/cugraph/tests/traversal/test_filter_unreachable.py index 16ecee540a0..35d5cc8d43a 100644 --- a/python/cugraph/cugraph/tests/traversal/test_filter_unreachable.py +++ b/python/cugraph/cugraph/tests/traversal/test_filter_unreachable.py @@ -17,7 +17,7 @@ import numpy as np import cugraph -from cugraph.experimental.datasets import DATASETS # using deleted karate variants +from cugraph.testing import DATASETS_TESTING # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from @@ -45,7 +45,7 @@ def setup_function(): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_TESTING) @pytest.mark.parametrize("source", SOURCES) def test_filter_unreachable(graph_file, source): G = graph_file.get_graph(create_using=cugraph.Graph(directed=True)) diff --git a/python/cugraph/cugraph/tests/traversal/test_sssp.py b/python/cugraph/cugraph/tests/traversal/test_sssp.py index 5779d658a42..a4dd3cb0586 100644 --- a/python/cugraph/cugraph/tests/traversal/test_sssp.py +++ b/python/cugraph/cugraph/tests/traversal/test_sssp.py @@ -29,9 +29,7 @@ from pylibcugraph.testing.utils import gen_fixture_params_product import cugraph -from cugraph.testing import utils, DATASETS_UNDIRECTED -from cugraph.experimental import datasets - +from cugraph.testing import utils, DATASETS_UNDIRECTED, DATASETS_SMALL # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from @@ -185,7 +183,7 @@ def networkx_call(graph_file, source, edgevals=True): # FIXME: tests with datasets like 'netscience' which has a weight column different # than than 1's fail because it looks like netwokX doesn't consider weights during # the computation. -DATASETS = [pytest.param(d) for d in datasets.DATASETS_SMALL] +DATASETS = [pytest.param(d) for d in DATASETS_SMALL] SOURCES = [pytest.param(1)] fixture_params = gen_fixture_params_product((DATASETS, "ds"), (SOURCES, "src")) fixture_params_single_dataset = gen_fixture_params_product( @@ -395,7 +393,7 @@ def test_sssp_networkx_edge_attr(): @pytest.mark.sg def test_scipy_api_compat(): - graph_file = datasets.DATASETS[0] + graph_file = DATASETS_SMALL[0] dataset_path = graph_file.get_path() input_cugraph_graph = graph_file.get_graph() input_coo_matrix = utils.create_obj_from_csv( @@ -506,7 +504,7 @@ def test_sssp_csr_graph(graph_file): @pytest.mark.sg def test_sssp_unweighted_graph(): - karate = DATASETS_UNDIRECTED[0] + karate = DATASETS_SMALL[0] G = karate.get_graph(ignore_weights=True) error_msg = ( 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 eedcafc78bf..ac6794eb59e 100644 --- a/python/cugraph/cugraph/tests/tree/test_maximum_spanning_tree.py +++ b/python/cugraph/cugraph/tests/tree/test_maximum_spanning_tree.py @@ -20,7 +20,8 @@ import cudf import cugraph -from cugraph.testing import utils, DATASETS_UNDIRECTED_WEIGHTS +from cugraph.testing import utils +from cugraph.datasets import netscience # Temporarily suppress warnings till networkX fixes deprecation warnings @@ -36,10 +37,13 @@ print("Networkx version : {} ".format(nx.__version__)) +DATASETS_UNDIRECTED_WEIGHTS = [netscience] # ============================================================================= # Pytest Setup / Teardown - called for each test function # ============================================================================= + + def setup_function(): gc.collect() 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 20d1c58d33f..fa7652d26d1 100644 --- a/python/cugraph/cugraph/tests/tree/test_minimum_spanning_tree.py +++ b/python/cugraph/cugraph/tests/tree/test_minimum_spanning_tree.py @@ -20,7 +20,8 @@ import cudf import cugraph -from cugraph.testing import utils, DATASETS_UNDIRECTED_WEIGHTS +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 @@ -35,10 +36,13 @@ print("Networkx version : {} ".format(nx.__version__)) +DATASETS_UNDIRECTED_WEIGHTS = [netscience] # ============================================================================= # Pytest Setup / Teardown - called for each test function # ============================================================================= + + def setup_function(): gc.collect() diff --git a/python/cugraph/cugraph/tests/utils/test_dataset.py b/python/cugraph/cugraph/tests/utils/test_dataset.py index 02ae6e61ffc..1263e1e6cb3 100644 --- a/python/cugraph/cugraph/tests/utils/test_dataset.py +++ b/python/cugraph/cugraph/tests/utils/test_dataset.py @@ -20,11 +20,11 @@ import pytest from cugraph.structure import Graph -from cugraph.testing import RAPIDS_DATASET_ROOT_DIR_PATH from cugraph.testing import ( + RAPIDS_DATASET_ROOT_DIR_PATH, ALL_DATASETS, - ALL_DATASETS_WGT, - SMALL_DATASETS, + DATASETS_WEIGHTS, + DATASETS_SMALL, ) from cugraph import datasets @@ -139,7 +139,7 @@ def test_get_path(dataset): tmpd.cleanup() -@pytest.mark.parametrize("dataset", ALL_DATASETS_WGT) +@pytest.mark.parametrize("dataset", DATASETS_WEIGHTS) def test_weights(dataset): G = dataset.get_graph(fetch=True) assert G.is_weighted() @@ -147,7 +147,7 @@ def test_weights(dataset): assert not G.is_weighted() -@pytest.mark.parametrize("dataset", SMALL_DATASETS) +@pytest.mark.parametrize("dataset", DATASETS_SMALL) def test_create_using(dataset): G = dataset.get_graph(fetch=True) assert not G.is_directed() @@ -158,7 +158,7 @@ def test_create_using(dataset): def test_ctor_with_datafile(): - from cugraph.experimental.datasets import karate + from cugraph.datasets import karate karate_csv = RAPIDS_DATASET_ROOT_DIR_PATH / "karate.csv" From a7c5d1f173bd1d8121409f65e2a5959d23166eda Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Tue, 11 Jul 2023 06:06:24 -0700 Subject: [PATCH 13/57] empty commit to re-run CI notebook checks --- notebooks/algorithms/traversal/BFS.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebooks/algorithms/traversal/BFS.ipynb b/notebooks/algorithms/traversal/BFS.ipynb index f9dd3d2e53d..5b03d9ef1c2 100755 --- a/notebooks/algorithms/traversal/BFS.ipynb +++ b/notebooks/algorithms/traversal/BFS.ipynb @@ -285,7 +285,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.10.12" }, "vscode": { "interpreter": { From 8309ce1365da5de6007f0bedd775ae76bc80f221 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Tue, 11 Jul 2023 06:53:46 -0700 Subject: [PATCH 14/57] refactored remaining tests using experimental datasets --- python/cugraph/cugraph/tests/community/test_leiden.py | 4 +--- .../tests/community/test_subgraph_extraction.py | 2 +- .../cugraph/tests/community/test_triangle_count.py | 4 +--- .../cugraph/tests/components/test_connectivity.py | 8 ++++---- .../cugraph/tests/link_prediction/test_sorensen.py | 2 +- python/cugraph/cugraph/tests/nx/test_compat_pr.py | 2 +- .../cugraph/tests/sampling/test_random_walks_mg.py | 4 +--- python/cugraph/cugraph/tests/traversal/test_bfs.py | 10 +++++----- 8 files changed, 15 insertions(+), 21 deletions(-) diff --git a/python/cugraph/cugraph/tests/community/test_leiden.py b/python/cugraph/cugraph/tests/community/test_leiden.py index 8a277e8746f..a5101cd40d0 100644 --- a/python/cugraph/cugraph/tests/community/test_leiden.py +++ b/python/cugraph/cugraph/tests/community/test_leiden.py @@ -20,9 +20,7 @@ import cugraph import cudf from cugraph.testing import utils, DATASETS_UNDIRECTED -from cugraph.experimental.datasets import ( - karate_asymmetric, -) # using experimental karate variant +from cugraph.datasets import karate_asymmetric from cudf.testing.testing import assert_series_equal diff --git a/python/cugraph/cugraph/tests/community/test_subgraph_extraction.py b/python/cugraph/cugraph/tests/community/test_subgraph_extraction.py index 5c20bb3d00e..db5bd47567b 100644 --- a/python/cugraph/cugraph/tests/community/test_subgraph_extraction.py +++ b/python/cugraph/cugraph/tests/community/test_subgraph_extraction.py @@ -20,7 +20,7 @@ import cudf import cugraph from cugraph.testing import utils, DATASETS_TESTING -from cugraph.experimental.datasets import karate +from cugraph.datasets import karate ############################################################################### diff --git a/python/cugraph/cugraph/tests/community/test_triangle_count.py b/python/cugraph/cugraph/tests/community/test_triangle_count.py index 91658cd8999..17f13a11b35 100644 --- a/python/cugraph/cugraph/tests/community/test_triangle_count.py +++ b/python/cugraph/cugraph/tests/community/test_triangle_count.py @@ -20,9 +20,7 @@ import cugraph from cugraph.testing import utils, DATASETS_UNDIRECTED -from cugraph.experimental.datasets import ( - karate_asymmetric, -) # using experimental karate variant +from cugraph.datasets import karate_asymmetric # Temporarily suppress warnings till networkX fixes deprecation warnings diff --git a/python/cugraph/cugraph/tests/components/test_connectivity.py b/python/cugraph/cugraph/tests/components/test_connectivity.py index 1326165aa5f..bbf3340ad91 100644 --- a/python/cugraph/cugraph/tests/components/test_connectivity.py +++ b/python/cugraph/cugraph/tests/components/test_connectivity.py @@ -33,7 +33,7 @@ from cugraph.datasets import dolphins, netscience, email_Eu_core -STRONGDATASETS = [dolphins, netscience, email_Eu_core] +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 @@ -283,12 +283,12 @@ def single_dataset_nxresults_weak(request): return networkx_weak_call(request.param) -@pytest.fixture(scope="module", params=STRONGDATASETS) +@pytest.fixture(scope="module", params=DATASETS_BATCH) def dataset_nxresults_strong(request): return networkx_strong_call(request.param) -@pytest.fixture(scope="module", params=[STRONGDATASETS[0]]) +@pytest.fixture(scope="module", params=[DATASETS_BATCH[0]]) def single_dataset_nxresults_strong(request): return networkx_strong_call(request.param) @@ -443,7 +443,7 @@ def test_scipy_api_compat_strong(single_dataset_nxresults_strong): @pytest.mark.parametrize("connection_type", ["strong", "weak"]) def test_scipy_api_compat(connection_type): if connection_type == "strong": - graph_file = STRONGDATASETS[0] + graph_file = DATASETS_BATCH[0] else: graph_file = DATASETS_TESTING[0] diff --git a/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py b/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py index eaac0d6496e..8b82a5e7520 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py @@ -19,8 +19,8 @@ import cugraph from cugraph.testing import utils, DATASETS_UNDIRECTED -from cugraph.experimental import sorensen as exp_sorensen from cugraph.datasets import netscience +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 diff --git a/python/cugraph/cugraph/tests/nx/test_compat_pr.py b/python/cugraph/cugraph/tests/nx/test_compat_pr.py index 14e216bce32..a8dc6f7bb22 100644 --- a/python/cugraph/cugraph/tests/nx/test_compat_pr.py +++ b/python/cugraph/cugraph/tests/nx/test_compat_pr.py @@ -25,7 +25,7 @@ from pylibcugraph.testing.utils import gen_fixture_params_product from cugraph.testing import utils -from cugraph.datasets import karate +from cugraph.experimental.datasets import karate MAX_ITERATIONS = [100, 200] 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 d4b626e2e48..078b095030d 100644 --- a/python/cugraph/cugraph/tests/sampling/test_random_walks_mg.py +++ b/python/cugraph/cugraph/tests/sampling/test_random_walks_mg.py @@ -22,9 +22,7 @@ # from cugraph.dask.common.mg_utils import is_single_gpu import cugraph.dask as dcg -from cugraph.experimental.datasets import ( - karate_asymmetric, -) # using experimental karate variant +from cugraph.datasets import karate_asymmetric from cugraph.testing import DATASETS_SMALL diff --git a/python/cugraph/cugraph/tests/traversal/test_bfs.py b/python/cugraph/cugraph/tests/traversal/test_bfs.py index 7446b32ee5d..84ef406948d 100644 --- a/python/cugraph/cugraph/tests/traversal/test_bfs.py +++ b/python/cugraph/cugraph/tests/traversal/test_bfs.py @@ -28,8 +28,8 @@ from pylibcugraph.testing.utils import gen_fixture_params_product import cugraph -from cugraph.testing import utils -from cugraph.experimental import datasets +from cugraph.testing import utils, DATASETS_TESTING, DATASETS_SMALL + # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from @@ -291,8 +291,8 @@ def get_cu_graph_nx_results_and_params(seed, depth_limit, G, dataset, directed, # ============================================================================= SEEDS = [pytest.param(s) for s in SUBSET_SEED_OPTIONS] DIRECTED = [pytest.param(d) for d in DIRECTED_GRAPH_OPTIONS] -DATASETS = [pytest.param(d) for d in datasets.DATASETS] -DATASETS_SMALL = [pytest.param(d) for d in datasets.DATASETS_SMALL] +DATASETS = [pytest.param(d) for d in DATASETS_TESTING] +DATASETS_SMALL = [pytest.param(d) for d in DATASETS_SMALL] DEPTH_LIMIT = [pytest.param(d) for d in DEPTH_LIMITS] # Call gen_fixture_params_product() to caluculate the cartesian product of @@ -449,7 +449,7 @@ def test_bfs_invalid_start( @pytest.mark.sg def test_scipy_api_compat(): - graph_file = datasets.DATASETS[0] + graph_file = DATASETS_TESTING[0] dataset_path = graph_file.get_path() input_cugraph_graph = graph_file.get_graph(ignore_weights=True) From 552fa2b2e91dd54aa4278f962b4b419eef9dd408 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Tue, 11 Jul 2023 12:58:09 -0700 Subject: [PATCH 15/57] fix failing notebook --- notebooks/algorithms/centrality/Eigenvector.ipynb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/notebooks/algorithms/centrality/Eigenvector.ipynb b/notebooks/algorithms/centrality/Eigenvector.ipynb index 0f23da1396c..c174e6635cf 100644 --- a/notebooks/algorithms/centrality/Eigenvector.ipynb +++ b/notebooks/algorithms/centrality/Eigenvector.ipynb @@ -11,7 +11,8 @@ "\n", "| Author Credit | Date | Update | cuGraph Version | Test Hardware |\n", "| --------------|------------|------------------|-----------------|----------------|\n", - "| Don Acosta | 07/05/2022 | created | 22.08 nightly | DGX Tesla V100 CUDA 11.5" + "| Don Acosta | 07/05/2022 | created | 22.08 nightly | DGX Tesla V100 CUDA 11.5\n", + "| Ralph Liu | 07/11/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5" ] }, { @@ -153,7 +154,7 @@ "metadata": {}, "outputs": [], "source": [ - "from cugraph.datasets import karate_data" + "from cugraph.datasets import karate" ] }, { @@ -190,7 +191,7 @@ "metadata": {}, "outputs": [], "source": [ - "G = karate_data.get_graph(fetch=True)" + "G = karate.get_graph(fetch=True)" ] }, { From 294166c612db7f7bab7a3c0f0bf429442a397575 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Thu, 13 Jul 2023 07:02:42 -0700 Subject: [PATCH 16/57] Update dataset batch naming scheme. update unit tests. --- python/cugraph/cugraph/testing/__init__.py | 8 ++++---- .../centrality/test_betweenness_centrality.py | 10 +++++----- .../tests/centrality/test_degree_centrality.py | 6 +++--- .../centrality/test_edge_betweenness_centrality.py | 12 ++++++------ .../centrality/test_eigenvector_centrality.py | 6 +++--- .../centrality/test_eigenvector_centrality_mg.py | 6 +++--- .../tests/centrality/test_katz_centrality.py | 10 +++++----- .../cugraph/tests/community/test_balanced_cut.py | 8 ++++---- .../cugraph/cugraph/tests/community/test_leiden.py | 6 +++--- .../cugraph/tests/community/test_louvain.py | 6 +++--- .../cugraph/tests/community/test_modularity.py | 8 ++++---- .../tests/community/test_subgraph_extraction.py | 10 +++++----- .../cugraph/tests/community/test_triangle_count.py | 4 ++-- .../cugraph/tests/components/test_connectivity.py | 8 ++++---- .../cugraph/cugraph/tests/core/test_core_number.py | 4 ++-- python/cugraph/cugraph/tests/core/test_k_core.py | 10 +++++----- .../cugraph/tests/internals/test_renumber.py | 6 +++--- .../cugraph/tests/internals/test_symmetrize.py | 6 +++--- .../cugraph/tests/link_analysis/test_hits.py | 4 ++-- .../cugraph/tests/link_analysis/test_pagerank.py | 8 ++++---- .../cugraph/tests/link_prediction/test_jaccard.py | 6 +++--- .../cugraph/tests/link_prediction/test_overlap.py | 8 ++++---- .../cugraph/tests/link_prediction/test_sorensen.py | 6 +++--- .../cugraph/tests/link_prediction/test_wjaccard.py | 4 ++-- .../cugraph/tests/link_prediction/test_woverlap.py | 6 +++--- .../tests/link_prediction/test_wsorensen.py | 4 ++-- python/cugraph/cugraph/tests/nx/test_nx_convert.py | 12 ++++++------ .../cugraph/cugraph/tests/sampling/test_egonet.py | 8 ++++---- .../cugraph/tests/sampling/test_node2vec.py | 4 ++-- .../cugraph/tests/sampling/test_random_walks.py | 14 +++++++------- .../cugraph/tests/sampling/test_random_walks_mg.py | 4 ++-- .../tests/sampling/test_uniform_neighbor_sample.py | 4 ++-- .../sampling/test_uniform_neighbor_sample_mg.py | 4 ++-- .../cugraph/tests/structure/test_multigraph.py | 8 ++++---- python/cugraph/cugraph/tests/traversal/test_bfs.py | 12 ++++++------ .../tests/traversal/test_filter_unreachable.py | 4 ++-- .../cugraph/cugraph/tests/traversal/test_sssp.py | 10 +++++----- .../tests/tree/test_maximum_spanning_tree.py | 6 +++--- .../tests/tree/test_minimum_spanning_tree.py | 6 +++--- python/cugraph/cugraph/tests/utils/test_dataset.py | 8 ++++---- 40 files changed, 142 insertions(+), 142 deletions(-) diff --git a/python/cugraph/cugraph/testing/__init__.py b/python/cugraph/cugraph/testing/__init__.py index f72aeff31ba..de3eb5229d7 100644 --- a/python/cugraph/cugraph/testing/__init__.py +++ b/python/cugraph/cugraph/testing/__init__.py @@ -31,9 +31,9 @@ # Moved Dataset Batches # -DATASETS_UNDIRECTED = [karate, dolphins] -DATASETS_SMALL = [karate, dolphins, polbooks] -DATASETS_WEIGHTS = [ +UNDIRECTED_DATASETS = [karate, dolphins] +SMALL_DATASETS = [karate, dolphins, polbooks] +WEIGHTED_DATASETS = [ dolphins, karate, karate_disjoint, @@ -55,4 +55,4 @@ toy_graph, toy_graph_undirected, ] -DATASETS_TESTING = [dolphins, netscience, karate_disjoint] +DEFAULT_DATASETS = [dolphins, netscience, karate_disjoint] diff --git a/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py b/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py index b3b36f24b3d..ac1f48dc6e8 100644 --- a/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py @@ -17,7 +17,7 @@ import cugraph from cugraph.datasets import karate_disjoint -from cugraph.testing import utils, DATASETS_SMALL +from cugraph.testing import utils, SMALL_DATASETS import random import numpy as np import cudf @@ -306,7 +306,7 @@ def compare_scores(sorted_df, first_key, second_key, epsilon=DEFAULT_EPSILON): # Tests # ============================================================================= @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_SMALL) +@pytest.mark.parametrize("graph_file", SMALL_DATASETS) @pytest.mark.parametrize("directed", [False, True]) @pytest.mark.parametrize("subset_size", SUBSET_SIZE_OPTIONS) @pytest.mark.parametrize("normalized", NORMALIZED_OPTIONS) @@ -341,7 +341,7 @@ def test_betweenness_centrality_0( @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_SMALL) +@pytest.mark.parametrize("graph_file", SMALL_DATASETS) @pytest.mark.parametrize("directed", DIRECTED_GRAPH_OPTIONS) @pytest.mark.parametrize("subset_size", [None]) @pytest.mark.parametrize("normalized", NORMALIZED_OPTIONS) @@ -425,7 +425,7 @@ def test_betweenness_centrality_fixed_sample( @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_SMALL) +@pytest.mark.parametrize("graph_file", SMALL_DATASETS) @pytest.mark.parametrize("directed", DIRECTED_GRAPH_OPTIONS) @pytest.mark.parametrize("subset_size", SUBSET_SIZE_OPTIONS) @pytest.mark.parametrize("normalized", NORMALIZED_OPTIONS) @@ -466,7 +466,7 @@ def test_betweenness_centrality_weight_except( @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_SMALL) +@pytest.mark.parametrize("graph_file", SMALL_DATASETS) @pytest.mark.parametrize("directed", DIRECTED_GRAPH_OPTIONS) @pytest.mark.parametrize("normalized", NORMALIZED_OPTIONS) @pytest.mark.parametrize("subset_size", SUBSET_SIZE_OPTIONS) diff --git a/python/cugraph/cugraph/tests/centrality/test_degree_centrality.py b/python/cugraph/cugraph/tests/centrality/test_degree_centrality.py index cc39398270f..dda35c9f0eb 100644 --- a/python/cugraph/cugraph/tests/centrality/test_degree_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_degree_centrality.py @@ -17,7 +17,7 @@ import cudf import cugraph -from cugraph.testing import utils, DATASETS_UNDIRECTED +from cugraph.testing import utils, UNDIRECTED_DATASETS import networkx as nx @@ -36,7 +36,7 @@ def topKVertices(degree, col, k): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED) +@pytest.mark.parametrize("graph_file", UNDIRECTED_DATASETS) def test_degree_centrality_nx(graph_file): dataset_path = graph_file.get_path() NM = utils.read_csv_for_nx(dataset_path) @@ -68,7 +68,7 @@ def test_degree_centrality_nx(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED) +@pytest.mark.parametrize("graph_file", UNDIRECTED_DATASETS) def test_degree_centrality_multi_column(graph_file): dataset_path = graph_file.get_path() cu_M = utils.read_csv_file(dataset_path) 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 efba3089b55..f1abaa7ea9d 100644 --- a/python/cugraph/cugraph/tests/centrality/test_edge_betweenness_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_edge_betweenness_centrality.py @@ -17,7 +17,7 @@ import cugraph from cugraph.datasets import karate_disjoint -from cugraph.testing import utils, DATASETS_SMALL +from cugraph.testing import utils, SMALL_DATASETS import random import numpy as np import cupy @@ -311,7 +311,7 @@ def generate_upper_triangle(dataframe): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_SMALL) +@pytest.mark.parametrize("graph_file", SMALL_DATASETS) @pytest.mark.parametrize("directed", DIRECTED_GRAPH_OPTIONS) @pytest.mark.parametrize("subset_size", SUBSET_SIZE_OPTIONS) @pytest.mark.parametrize("normalized", NORMALIZED_OPTIONS) @@ -343,7 +343,7 @@ def test_edge_betweenness_centrality( @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_SMALL) +@pytest.mark.parametrize("graph_file", SMALL_DATASETS) @pytest.mark.parametrize("directed", DIRECTED_GRAPH_OPTIONS) @pytest.mark.parametrize("subset_size", [None]) @pytest.mark.parametrize("normalized", NORMALIZED_OPTIONS) @@ -422,7 +422,7 @@ def test_edge_betweenness_centrality_fixed_sample( @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_SMALL) +@pytest.mark.parametrize("graph_file", SMALL_DATASETS) @pytest.mark.parametrize("directed", DIRECTED_GRAPH_OPTIONS) @pytest.mark.parametrize("subset_size", SUBSET_SIZE_OPTIONS) @pytest.mark.parametrize("normalized", NORMALIZED_OPTIONS) @@ -461,7 +461,7 @@ def test_edge_betweenness_centrality_weight_except( @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_SMALL) +@pytest.mark.parametrize("graph_file", SMALL_DATASETS) @pytest.mark.parametrize("directed", DIRECTED_GRAPH_OPTIONS) @pytest.mark.parametrize("normalized", NORMALIZED_OPTIONS) @pytest.mark.parametrize("subset_size", SUBSET_SIZE_OPTIONS) @@ -496,7 +496,7 @@ def test_edge_betweenness_invalid_dtype( @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_SMALL) +@pytest.mark.parametrize("graph_file", SMALL_DATASETS) @pytest.mark.parametrize("directed", DIRECTED_GRAPH_OPTIONS) @pytest.mark.parametrize("edgevals", WEIGHTED_GRAPH_OPTIONS) def test_edge_betweenness_centrality_nx(graph_file, directed, edgevals): diff --git a/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py b/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py index 00b858c645f..38af1e20061 100644 --- a/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py @@ -16,7 +16,7 @@ import pytest import cugraph -from cugraph.testing import utils, DATASETS_UNDIRECTED, DATASETS_TESTING +from cugraph.testing import utils, UNDIRECTED_DATASETS, DEFAULT_DATASETS from cugraph.datasets import toy_graph, karate import networkx as nx @@ -57,7 +57,7 @@ def calc_eigenvector(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) def test_eigenvector_centrality(graph_file): eigen_scores = calc_eigenvector(graph_file) @@ -68,7 +68,7 @@ def test_eigenvector_centrality(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED) +@pytest.mark.parametrize("graph_file", UNDIRECTED_DATASETS) def test_eigenvector_centrality_nx(graph_file): dataset_path = graph_file.get_path() NM = utils.read_csv_for_nx(dataset_path) 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 f91ac418ef0..220b275e4c2 100644 --- a/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality_mg.py +++ b/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality_mg.py @@ -19,7 +19,7 @@ import dask_cudf import cudf from cugraph.dask.common.mg_utils import is_single_gpu -from cugraph.testing.utils import DATASETS +from cugraph.testing.utils import DEFAULT_DATASETS # ============================================================================= @@ -37,7 +37,7 @@ def setup_function(): @pytest.mark.mg @pytest.mark.skipif(is_single_gpu(), reason="skipping MG testing on Single GPU system") @pytest.mark.parametrize("directed", IS_DIRECTED) -@pytest.mark.parametrize("input_data_path", DATASETS) +@pytest.mark.parametrize("input_data_path", DEFAULT_DATASETS) def test_dask_eigenvector_centrality(dask_client, directed, input_data_path): input_data_path = input_data_path.as_posix() print(f"dataset={input_data_path}") @@ -86,7 +86,7 @@ def test_dask_eigenvector_centrality(dask_client, directed, input_data_path): @pytest.mark.mg def test_dask_eigenvector_centrality_transposed_false(dask_client): - input_data_path = DATASETS[0] + input_data_path = DEFAULT_DATASETS[0] chunksize = dcg.get_chunksize(input_data_path) diff --git a/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py b/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py index 43cdf2c0362..3befff8643d 100644 --- a/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py @@ -19,8 +19,8 @@ import cugraph from cugraph.testing import ( utils, - DATASETS_TESTING, - DATASETS_UNDIRECTED, + DEFAULT_DATASETS, + UNDIRECTED_DATASETS, ) from cugraph.datasets import toy_graph_undirected, karate @@ -74,7 +74,7 @@ def calc_katz(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) def test_katz_centrality(graph_file): katz_scores = calc_katz(graph_file) @@ -85,7 +85,7 @@ def test_katz_centrality(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED) +@pytest.mark.parametrize("graph_file", UNDIRECTED_DATASETS) def test_katz_centrality_nx(graph_file): dataset_path = graph_file.get_path() NM = utils.read_csv_for_nx(dataset_path) @@ -117,7 +117,7 @@ def test_katz_centrality_nx(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED) +@pytest.mark.parametrize("graph_file", UNDIRECTED_DATASETS) def test_katz_centrality_multi_column(graph_file): dataset_path = graph_file.get_path() cu_M = utils.read_csv_file(dataset_path) diff --git a/python/cugraph/cugraph/tests/community/test_balanced_cut.py b/python/cugraph/cugraph/tests/community/test_balanced_cut.py index 7d7d6bfe58c..4049b9d0eb9 100644 --- a/python/cugraph/cugraph/tests/community/test_balanced_cut.py +++ b/python/cugraph/cugraph/tests/community/test_balanced_cut.py @@ -19,7 +19,7 @@ import pandas as pd import cudf import cugraph -from cugraph.testing import DATASETS_TESTING +from cugraph.testing import DEFAULT_DATASETS def cugraph_call(G, partitions): @@ -57,7 +57,7 @@ def random_call(G, partitions): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) @pytest.mark.parametrize("partitions", PARTITIONS) def test_edge_cut_clustering(graph_file, partitions): gc.collect() @@ -78,7 +78,7 @@ def test_edge_cut_clustering(graph_file, partitions): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) @pytest.mark.parametrize("partitions", PARTITIONS) def test_edge_cut_clustering_with_edgevals(graph_file, partitions): gc.collect() @@ -101,7 +101,7 @@ def test_edge_cut_clustering_with_edgevals(graph_file, partitions): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", [DATASETS_TESTING[2]]) +@pytest.mark.parametrize("graph_file", [DEFAULT_DATASETS[2]]) @pytest.mark.parametrize("partitions", PARTITIONS) def test_edge_cut_clustering_with_edgevals_nx(graph_file, partitions): gc.collect() diff --git a/python/cugraph/cugraph/tests/community/test_leiden.py b/python/cugraph/cugraph/tests/community/test_leiden.py index a5101cd40d0..ef312d36159 100644 --- a/python/cugraph/cugraph/tests/community/test_leiden.py +++ b/python/cugraph/cugraph/tests/community/test_leiden.py @@ -19,7 +19,7 @@ import networkx as nx import cugraph import cudf -from cugraph.testing import utils, DATASETS_UNDIRECTED +from cugraph.testing import utils, UNDIRECTED_DATASETS from cugraph.datasets import karate_asymmetric from cudf.testing.testing import assert_series_equal @@ -179,7 +179,7 @@ def cugraph_louvain(G): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED) +@pytest.mark.parametrize("graph_file", UNDIRECTED_DATASETS) def test_leiden(graph_file): edgevals = True @@ -192,7 +192,7 @@ def test_leiden(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED) +@pytest.mark.parametrize("graph_file", UNDIRECTED_DATASETS) def test_leiden_nx(graph_file): dataset_path = graph_file.get_path() NM = utils.read_csv_for_nx(dataset_path) diff --git a/python/cugraph/cugraph/tests/community/test_louvain.py b/python/cugraph/cugraph/tests/community/test_louvain.py index 0670c4a6b98..7b8347bc5e2 100644 --- a/python/cugraph/cugraph/tests/community/test_louvain.py +++ b/python/cugraph/cugraph/tests/community/test_louvain.py @@ -19,7 +19,7 @@ import cugraph import cupyx import cudf -from cugraph.testing import utils, DATASETS_UNDIRECTED +from cugraph.testing import utils, UNDIRECTED_DATASETS from cugraph.datasets import karate_asymmetric # Temporarily suppress warnings till networkX fixes deprecation warnings @@ -82,7 +82,7 @@ def networkx_call(M): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED) +@pytest.mark.parametrize("graph_file", UNDIRECTED_DATASETS) def test_louvain(graph_file): dataset_path = graph_file.get_path() M = utils.read_csv_for_nx(dataset_path) @@ -116,7 +116,7 @@ def test_louvain_directed_graph(): @pytest.mark.sg @pytest.mark.parametrize("is_weighted", [True, False]) def test_louvain_csr_graph(is_weighted): - karate = DATASETS_UNDIRECTED[0] + karate = UNDIRECTED_DATASETS[0] df = karate.get_edgelist() M = cupyx.scipy.sparse.coo_matrix( diff --git a/python/cugraph/cugraph/tests/community/test_modularity.py b/python/cugraph/cugraph/tests/community/test_modularity.py index 294a574dfd9..cc919700490 100644 --- a/python/cugraph/cugraph/tests/community/test_modularity.py +++ b/python/cugraph/cugraph/tests/community/test_modularity.py @@ -18,7 +18,7 @@ import cudf import cugraph -from cugraph.testing import utils, DATASETS_TESTING +from cugraph.testing import utils, DEFAULT_DATASETS from cugraph.utilities import ensure_cugraph_obj_for_nx import networkx as nx @@ -54,7 +54,7 @@ def random_call(G, partitions): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) @pytest.mark.parametrize("partitions", PARTITIONS) def test_modularity_clustering(graph_file, partitions): gc.collect() @@ -76,7 +76,7 @@ def test_modularity_clustering(graph_file, partitions): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) @pytest.mark.parametrize("partitions", PARTITIONS) def test_modularity_clustering_nx(graph_file, partitions): # Read in the graph and get a cugraph object @@ -107,7 +107,7 @@ def test_modularity_clustering_nx(graph_file, partitions): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) @pytest.mark.parametrize("partitions", PARTITIONS) def test_modularity_clustering_multi_column(graph_file, partitions): # Read in the graph and get a cugraph object diff --git a/python/cugraph/cugraph/tests/community/test_subgraph_extraction.py b/python/cugraph/cugraph/tests/community/test_subgraph_extraction.py index db5bd47567b..8abab3179fe 100644 --- a/python/cugraph/cugraph/tests/community/test_subgraph_extraction.py +++ b/python/cugraph/cugraph/tests/community/test_subgraph_extraction.py @@ -19,7 +19,7 @@ import cudf import cugraph -from cugraph.testing import utils, DATASETS_TESTING +from cugraph.testing import utils, DEFAULT_DATASETS from cugraph.datasets import karate @@ -66,7 +66,7 @@ def nx_call(M, verts, directed=True): ############################################################################### @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) def test_subgraph_extraction_DiGraph(graph_file): dataset_path = graph_file.get_path() M = utils.read_csv_for_nx(dataset_path) @@ -80,7 +80,7 @@ def test_subgraph_extraction_DiGraph(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) def test_subgraph_extraction_Graph(graph_file): dataset_path = graph_file.get_path() M = utils.read_csv_for_nx(dataset_path) @@ -94,7 +94,7 @@ def test_subgraph_extraction_Graph(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", [DATASETS_TESTING[2]]) +@pytest.mark.parametrize("graph_file", [DEFAULT_DATASETS[2]]) def test_subgraph_extraction_Graph_nx(graph_file): directed = False verts = np.zeros(3, dtype=np.int32) @@ -123,7 +123,7 @@ def test_subgraph_extraction_Graph_nx(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) def test_subgraph_extraction_multi_column(graph_file): dataset_path = graph_file.get_path() M = utils.read_csv_for_nx(dataset_path) diff --git a/python/cugraph/cugraph/tests/community/test_triangle_count.py b/python/cugraph/cugraph/tests/community/test_triangle_count.py index 17f13a11b35..4de624a3321 100644 --- a/python/cugraph/cugraph/tests/community/test_triangle_count.py +++ b/python/cugraph/cugraph/tests/community/test_triangle_count.py @@ -19,7 +19,7 @@ from pylibcugraph.testing.utils import gen_fixture_params_product import cugraph -from cugraph.testing import utils, DATASETS_UNDIRECTED +from cugraph.testing import utils, UNDIRECTED_DATASETS from cugraph.datasets import karate_asymmetric @@ -45,7 +45,7 @@ def setup_function(): # ============================================================================= # Pytest fixtures # ============================================================================= -datasets = DATASETS_UNDIRECTED +datasets = UNDIRECTED_DATASETS fixture_params = gen_fixture_params_product( (datasets, "graph_file"), ([True, False], "edgevals"), diff --git a/python/cugraph/cugraph/tests/components/test_connectivity.py b/python/cugraph/cugraph/tests/components/test_connectivity.py index bbf3340ad91..1b8787cb1da 100644 --- a/python/cugraph/cugraph/tests/components/test_connectivity.py +++ b/python/cugraph/cugraph/tests/components/test_connectivity.py @@ -29,7 +29,7 @@ import cudf import cugraph -from cugraph.testing import utils, DATASETS_TESTING +from cugraph.testing import utils, DEFAULT_DATASETS from cugraph.datasets import dolphins, netscience, email_Eu_core @@ -273,12 +273,12 @@ def assert_scipy_api_compat(G, dataset_path, api_type): # ============================================================================= # Pytest fixtures # ============================================================================= -@pytest.fixture(scope="module", params=DATASETS_TESTING) +@pytest.fixture(scope="module", params=DEFAULT_DATASETS) def dataset_nxresults_weak(request): return networkx_weak_call(request.param) -@pytest.fixture(scope="module", params=[DATASETS_TESTING[0]]) +@pytest.fixture(scope="module", params=[DEFAULT_DATASETS[0]]) def single_dataset_nxresults_weak(request): return networkx_weak_call(request.param) @@ -445,7 +445,7 @@ def test_scipy_api_compat(connection_type): if connection_type == "strong": graph_file = DATASETS_BATCH[0] else: - graph_file = DATASETS_TESTING[0] + graph_file = DEFAULT_DATASETS[0] input_cugraph_graph = graph_file.get_graph() diff --git a/python/cugraph/cugraph/tests/core/test_core_number.py b/python/cugraph/cugraph/tests/core/test_core_number.py index 6f924415585..eba775dd26f 100644 --- a/python/cugraph/cugraph/tests/core/test_core_number.py +++ b/python/cugraph/cugraph/tests/core/test_core_number.py @@ -19,7 +19,7 @@ import networkx as nx import cugraph -from cugraph.testing import utils, DATASETS_UNDIRECTED +from cugraph.testing import utils, UNDIRECTED_DATASETS # ============================================================================= @@ -35,7 +35,7 @@ def setup_function(): degree_type = ["incoming", "outgoing"] fixture_params = gen_fixture_params_product( - (DATASETS_UNDIRECTED, "graph_file"), + (UNDIRECTED_DATASETS, "graph_file"), (degree_type, "degree_type"), ) diff --git a/python/cugraph/cugraph/tests/core/test_k_core.py b/python/cugraph/cugraph/tests/core/test_k_core.py index fa8067d8cc6..c1351276fa5 100644 --- a/python/cugraph/cugraph/tests/core/test_k_core.py +++ b/python/cugraph/cugraph/tests/core/test_k_core.py @@ -16,7 +16,7 @@ import pytest import cugraph -from cugraph.testing import utils, DATASETS_UNDIRECTED +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 @@ -72,7 +72,7 @@ def compare_edges(cg, nxg): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED) +@pytest.mark.parametrize("graph_file", UNDIRECTED_DATASETS) def test_k_core_Graph(graph_file): cu_kcore, nx_kcore = calc_k_cores(graph_file, False) @@ -81,7 +81,7 @@ def test_k_core_Graph(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED) +@pytest.mark.parametrize("graph_file", UNDIRECTED_DATASETS) def test_k_core_Graph_nx(graph_file): dataset_path = graph_file.get_path() NM = utils.read_csv_for_nx(dataset_path) @@ -93,7 +93,7 @@ def test_k_core_Graph_nx(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED) +@pytest.mark.parametrize("graph_file", UNDIRECTED_DATASETS) def test_k_core_corenumber_multicolumn(graph_file): dataset_path = graph_file.get_path() cu_M = utils.read_csv_file(dataset_path) @@ -132,7 +132,7 @@ def test_k_core_corenumber_multicolumn(graph_file): @pytest.mark.sg def test_k_core_invalid_input(): - karate = DATASETS_UNDIRECTED[0] + karate = UNDIRECTED_DATASETS[0] G = karate.get_graph(create_using=cugraph.Graph(directed=True)) with pytest.raises(ValueError): cugraph.k_core(G) diff --git a/python/cugraph/cugraph/tests/internals/test_renumber.py b/python/cugraph/cugraph/tests/internals/test_renumber.py index 67485221521..eb396dc66f1 100644 --- a/python/cugraph/cugraph/tests/internals/test_renumber.py +++ b/python/cugraph/cugraph/tests/internals/test_renumber.py @@ -21,7 +21,7 @@ from cudf.testing import assert_series_equal from cugraph.structure.number_map import NumberMap -from cugraph.testing import utils, DATASETS_TESTING +from cugraph.testing import utils, DEFAULT_DATASETS @pytest.mark.sg @@ -107,7 +107,7 @@ def test_renumber_negative_col(): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) def test_renumber_files_col(graph_file): gc.collect() dataset_path = graph_file.get_path() @@ -149,7 +149,7 @@ def test_renumber_files_col(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) def test_renumber_files_multi_col(graph_file): gc.collect() dataset_path = graph_file.get_path() diff --git a/python/cugraph/cugraph/tests/internals/test_symmetrize.py b/python/cugraph/cugraph/tests/internals/test_symmetrize.py index 52d7cc11b5d..30395862a20 100644 --- a/python/cugraph/cugraph/tests/internals/test_symmetrize.py +++ b/python/cugraph/cugraph/tests/internals/test_symmetrize.py @@ -18,7 +18,7 @@ import pandas as pd import cudf import cugraph -from cugraph.testing import DATASETS_TESTING +from cugraph.testing import DEFAULT_DATASETS @pytest.mark.sg @@ -155,7 +155,7 @@ def compare(src1, dst1, val1, src2, dst2, val2): @pytest.mark.sg @pytest.mark.skip("debugging") -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) def test_symmetrize_unweighted(graph_file): gc.collect() @@ -178,7 +178,7 @@ def test_symmetrize_unweighted(graph_file): @pytest.mark.sg @pytest.mark.skip("debugging") -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) def test_symmetrize_weighted(graph_file): gc.collect() cu_M = graph_file.get_edgelist() diff --git a/python/cugraph/cugraph/tests/link_analysis/test_hits.py b/python/cugraph/cugraph/tests/link_analysis/test_hits.py index 63253ac14c4..b21265f16c8 100644 --- a/python/cugraph/cugraph/tests/link_analysis/test_hits.py +++ b/python/cugraph/cugraph/tests/link_analysis/test_hits.py @@ -20,7 +20,7 @@ from pylibcugraph.testing.utils import gen_fixture_params_product import cugraph -from cugraph.testing import utils, DATASETS_UNDIRECTED +from cugraph.testing import utils, UNDIRECTED_DATASETS from cugraph.datasets import email_Eu_core, karate @@ -34,7 +34,7 @@ def setup_function(): # ============================================================================= # Pytest fixtures # ============================================================================= -datasets = DATASETS_UNDIRECTED + [email_Eu_core] +datasets = UNDIRECTED_DATASETS + [email_Eu_core] fixture_params = gen_fixture_params_product( (datasets, "graph_file"), ([50], "max_iter"), diff --git a/python/cugraph/cugraph/tests/link_analysis/test_pagerank.py b/python/cugraph/cugraph/tests/link_analysis/test_pagerank.py index 86fabb4a65b..af371722c01 100644 --- a/python/cugraph/cugraph/tests/link_analysis/test_pagerank.py +++ b/python/cugraph/cugraph/tests/link_analysis/test_pagerank.py @@ -19,7 +19,7 @@ import cudf import cugraph -from cugraph.testing import utils, DATASETS_TESTING +from cugraph.testing import utils, DEFAULT_DATASETS from cugraph.datasets import karate @@ -158,7 +158,7 @@ def setup_function(): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) @pytest.mark.parametrize("max_iter", MAX_ITERATIONS) @pytest.mark.parametrize("tol", TOLERANCE) @pytest.mark.parametrize("alpha", ALPHA) @@ -224,7 +224,7 @@ def test_pagerank( @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) @pytest.mark.parametrize("max_iter", MAX_ITERATIONS) @pytest.mark.parametrize("tol", TOLERANCE) @pytest.mark.parametrize("alpha", ALPHA) @@ -269,7 +269,7 @@ def test_pagerank_nx(graph_file, max_iter, tol, alpha, personalization_perc, has @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) @pytest.mark.parametrize("max_iter", MAX_ITERATIONS) @pytest.mark.parametrize("tol", TOLERANCE) @pytest.mark.parametrize("alpha", ALPHA) diff --git a/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py b/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py index 2bbd24727c1..dd0cd226916 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py @@ -18,7 +18,7 @@ from cudf.testing import assert_series_equal, assert_frame_equal import cugraph -from cugraph.testing import utils, DATASETS_UNDIRECTED +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 @@ -140,7 +140,7 @@ def networkx_call(M, benchmark_callable=None): # ============================================================================= # Pytest Fixtures # ============================================================================= -@pytest.fixture(scope="module", params=DATASETS_UNDIRECTED) +@pytest.fixture(scope="module", params=UNDIRECTED_DATASETS) def read_csv(request): """ Read csv file for both networkx and cugraph @@ -317,7 +317,7 @@ def test_jaccard_multi_column(read_csv): @pytest.mark.sg def test_weighted_exp_jaccard(): - karate = DATASETS_UNDIRECTED[0] + karate = UNDIRECTED_DATASETS[0] G = karate.get_graph() with pytest.raises(ValueError): exp_jaccard(G) diff --git a/python/cugraph/cugraph/tests/link_prediction/test_overlap.py b/python/cugraph/cugraph/tests/link_prediction/test_overlap.py index 9d5638a1bfb..1b5396aad92 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_overlap.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_overlap.py @@ -22,7 +22,7 @@ from cugraph.experimental import overlap as exp_overlap import cugraph -from cugraph.testing import utils, DATASETS_UNDIRECTED +from cugraph.testing import utils, UNDIRECTED_DATASETS # ============================================================================= @@ -112,7 +112,7 @@ def cpu_call(M, first, second): # ============================================================================= # Pytest Fixtures # ============================================================================= -@pytest.fixture(scope="module", params=DATASETS_UNDIRECTED) +@pytest.fixture(scope="module", params=UNDIRECTED_DATASETS) def read_csv(request): """ Read csv file for both networkx and cugraph @@ -170,7 +170,7 @@ def test_overlap_edge_vals(gpubenchmark, read_csv, extract_two_hop): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED) +@pytest.mark.parametrize("graph_file", UNDIRECTED_DATASETS) def test_overlap_multi_column(graph_file): dataset_path = graph_file.get_path() M = utils.read_csv_for_nx(dataset_path) @@ -215,7 +215,7 @@ def test_overlap_multi_column(graph_file): @pytest.mark.sg def test_weighted_exp_overlap(): - karate = DATASETS_UNDIRECTED[0] + karate = UNDIRECTED_DATASETS[0] G = karate.get_graph() with pytest.raises(ValueError): exp_overlap(G) diff --git a/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py b/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py index 8b82a5e7520..24db3d3b895 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py @@ -18,7 +18,7 @@ from cudf.testing import assert_series_equal, assert_frame_equal import cugraph -from cugraph.testing import utils, DATASETS_UNDIRECTED +from cugraph.testing import utils, UNDIRECTED_DATASETS from cugraph.datasets import netscience from cugraph.experimental import sorensen as exp_sorensen @@ -145,7 +145,7 @@ def networkx_call(M, benchmark_callable=None): # ============================================================================= # Pytest Fixtures # ============================================================================= -@pytest.fixture(scope="module", params=DATASETS_UNDIRECTED) +@pytest.fixture(scope="module", params=UNDIRECTED_DATASETS) def read_csv(request): """ Read csv file for both networkx and cugraph @@ -279,7 +279,7 @@ def test_sorensen_multi_column(read_csv): @pytest.mark.sg def test_weighted_exp_sorensen(): - karate = DATASETS_UNDIRECTED[0] + karate = UNDIRECTED_DATASETS[0] G = karate.get_graph() with pytest.raises(ValueError): exp_sorensen(G) diff --git a/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py b/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py index 8ed64e1c787..bb017841241 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py @@ -20,7 +20,7 @@ from cudf.testing import assert_series_equal import cugraph -from cugraph.testing import utils, DATASETS_UNDIRECTED +from cugraph.testing import utils, UNDIRECTED_DATASETS # Temporarily suppress warnings till networkX fixes deprecation warnings @@ -96,7 +96,7 @@ def networkx_call(M, benchmark_callable=None): # ============================================================================= # Pytest Fixtures # ============================================================================= -@pytest.fixture(scope="module", params=DATASETS_UNDIRECTED) +@pytest.fixture(scope="module", params=UNDIRECTED_DATASETS) def read_csv(request): """ Read csv file for both networkx and cugraph diff --git a/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py b/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py index 360ac9f9286..c37af976c7a 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py @@ -20,7 +20,7 @@ from cudf.testing import assert_series_equal import cugraph -from cugraph.testing import utils, DATASETS_UNDIRECTED +from cugraph.testing import utils, UNDIRECTED_DATASETS # ============================================================================= @@ -93,7 +93,7 @@ def cpu_call(M, first, second): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED) +@pytest.mark.parametrize("graph_file", UNDIRECTED_DATASETS) def test_woverlap(gpubenchmark, graph_file): dataset_path = graph_file.get_path() Mnx = utils.read_csv_for_nx(dataset_path) @@ -121,7 +121,7 @@ def test_woverlap(gpubenchmark, graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED) +@pytest.mark.parametrize("graph_file", UNDIRECTED_DATASETS) def test_woverlap_multi_column(graph_file): dataset_path = graph_file.get_path() M = utils.read_csv_for_nx(dataset_path) diff --git a/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py b/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py index e2cae33d432..5c537f7aa54 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py @@ -20,7 +20,7 @@ from cudf.testing import assert_series_equal import cugraph -from cugraph.testing import utils, DATASETS_UNDIRECTED +from cugraph.testing import utils, UNDIRECTED_DATASETS # Temporarily suppress warnings till networkX fixes deprecation warnings @@ -100,7 +100,7 @@ def networkx_call(M, benchmark_callable=None): # ============================================================================= # Pytest Fixtures # ============================================================================= -@pytest.fixture(scope="module", params=DATASETS_UNDIRECTED) +@pytest.fixture(scope="module", params=UNDIRECTED_DATASETS) def read_csv(request): """ Read csv file for both networkx and cugraph diff --git a/python/cugraph/cugraph/tests/nx/test_nx_convert.py b/python/cugraph/cugraph/tests/nx/test_nx_convert.py index 4d60228b98a..86e1eaa7fe4 100644 --- a/python/cugraph/cugraph/tests/nx/test_nx_convert.py +++ b/python/cugraph/cugraph/tests/nx/test_nx_convert.py @@ -16,7 +16,7 @@ import cudf import cugraph -from cugraph.testing import utils, DATASETS_TESTING +from cugraph.testing import utils, DEFAULT_DATASETS # Temporarily suppress warnings till networkX fixes deprecation warnings @@ -69,7 +69,7 @@ def _compare_graphs(nxG, cuG, has_wt=True): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) def test_networkx_compatibility(graph_file): # test to make sure cuGraph and Nx build similar Graphs # Read in the graph @@ -96,7 +96,7 @@ def test_networkx_compatibility(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) def test_nx_convert_undirected(graph_file): # read data and create a Nx Graph dataset_path = graph_file.get_path() @@ -113,7 +113,7 @@ def test_nx_convert_undirected(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) def test_nx_convert_directed(graph_file): # read data and create a Nx DiGraph dataset_path = graph_file.get_path() @@ -129,7 +129,7 @@ def test_nx_convert_directed(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) def test_nx_convert_weighted(graph_file): # read data and create a Nx DiGraph dataset_path = graph_file.get_path() @@ -146,7 +146,7 @@ def test_nx_convert_weighted(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) def test_nx_convert_multicol(graph_file): # read data and create a Nx Graph dataset_path = graph_file.get_path() diff --git a/python/cugraph/cugraph/tests/sampling/test_egonet.py b/python/cugraph/cugraph/tests/sampling/test_egonet.py index 7b1a2c04fcf..83f0aa66af1 100644 --- a/python/cugraph/cugraph/tests/sampling/test_egonet.py +++ b/python/cugraph/cugraph/tests/sampling/test_egonet.py @@ -16,7 +16,7 @@ import cudf import cugraph -from cugraph.testing import utils, DATASETS_TESTING +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 @@ -36,7 +36,7 @@ @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) @pytest.mark.parametrize("seed", SEEDS) @pytest.mark.parametrize("radius", RADIUS) def test_ego_graph_nx(graph_file, seed, radius): @@ -57,7 +57,7 @@ def test_ego_graph_nx(graph_file, seed, radius): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) @pytest.mark.parametrize("seeds", [[0, 5, 13]]) @pytest.mark.parametrize("radius", [1, 2, 3]) def test_batched_ego_graphs(graph_file, seeds, radius): @@ -82,7 +82,7 @@ def test_batched_ego_graphs(graph_file, seeds, radius): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) @pytest.mark.parametrize("seed", SEEDS) @pytest.mark.parametrize("radius", RADIUS) def test_multi_column_ego_graph(graph_file, seed, radius): diff --git a/python/cugraph/cugraph/tests/sampling/test_node2vec.py b/python/cugraph/cugraph/tests/sampling/test_node2vec.py index 2e1ca1b6911..c3441801169 100644 --- a/python/cugraph/cugraph/tests/sampling/test_node2vec.py +++ b/python/cugraph/cugraph/tests/sampling/test_node2vec.py @@ -15,7 +15,7 @@ import random import pytest -from cugraph.testing import utils, DATASETS_SMALL +from cugraph.testing import utils, SMALL_DATASETS import cugraph import cudf from cugraph.datasets import small_line, karate @@ -144,7 +144,7 @@ def test_node2vec_line(graph_file, directed): @pytest.mark.sg -@pytest.mark.parametrize(*_get_param_args("graph_file", DATASETS_SMALL)) +@pytest.mark.parametrize(*_get_param_args("graph_file", SMALL_DATASETS)) @pytest.mark.parametrize(*_get_param_args("directed", DIRECTED_GRAPH_OPTIONS)) @pytest.mark.parametrize(*_get_param_args("compress", COMPRESSED)) def test_node2vec( diff --git a/python/cugraph/cugraph/tests/sampling/test_random_walks.py b/python/cugraph/cugraph/tests/sampling/test_random_walks.py index b811fbd0f11..8e446c3955e 100644 --- a/python/cugraph/cugraph/tests/sampling/test_random_walks.py +++ b/python/cugraph/cugraph/tests/sampling/test_random_walks.py @@ -21,15 +21,15 @@ import cudf import networkx as nx from cugraph.utilities import ensure_cugraph_obj_for_nx -from cugraph.testing import DATASETS_SMALL, DATASETS_TESTING +from cugraph.testing import SMALL_DATASETS, DEFAULT_DATASETS # ============================================================================= # Parameters # ============================================================================= DIRECTED_GRAPH_OPTIONS = [False, True] WEIGHTED_GRAPH_OPTIONS = [False, True] -DATASETS = [pytest.param(d) for d in DATASETS_TESTING] -DATASETS_SMALL = [pytest.param(d) for d in DATASETS_SMALL] +DATASETS = [pytest.param(d) for d in DEFAULT_DATASETS] +SMALL_DATASETS = [pytest.param(d) for d in SMALL_DATASETS] # ============================================================================= @@ -207,7 +207,7 @@ def check_random_walks_padded(G, path_data, seeds, max_depth, legacy_result_type @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_SMALL) +@pytest.mark.parametrize("graph_file", SMALL_DATASETS) @pytest.mark.parametrize("directed", DIRECTED_GRAPH_OPTIONS) @pytest.mark.parametrize("max_depth", [None]) def test_random_walks_invalid_max_dept(graph_file, directed, max_depth): @@ -219,7 +219,7 @@ def test_random_walks_invalid_max_dept(graph_file, directed, max_depth): @pytest.mark.sg @pytest.mark.cugraph_ops -@pytest.mark.parametrize("graph_file", DATASETS_SMALL) +@pytest.mark.parametrize("graph_file", SMALL_DATASETS) @pytest.mark.parametrize("directed", DIRECTED_GRAPH_OPTIONS) def test_random_walks_coalesced(graph_file, directed): max_depth = random.randint(2, 10) @@ -243,7 +243,7 @@ def test_random_walks_coalesced(graph_file, directed): @pytest.mark.sg @pytest.mark.cugraph_ops -@pytest.mark.parametrize("graph_file", DATASETS_SMALL) +@pytest.mark.parametrize("graph_file", SMALL_DATASETS) @pytest.mark.parametrize("directed", DIRECTED_GRAPH_OPTIONS) def test_random_walks_padded_0(graph_file, directed): max_depth = random.randint(2, 10) @@ -291,7 +291,7 @@ def test_random_walks_padded_1(): @pytest.mark.sg @pytest.mark.cugraph_ops -@pytest.mark.parametrize("graph_file", DATASETS_SMALL) +@pytest.mark.parametrize("graph_file", SMALL_DATASETS) def test_random_walks_nx(graph_file): G = graph_file.get_graph(create_using=cugraph.Graph(directed=True)) 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 078b095030d..b2db08aac92 100644 --- a/python/cugraph/cugraph/tests/sampling/test_random_walks_mg.py +++ b/python/cugraph/cugraph/tests/sampling/test_random_walks_mg.py @@ -23,7 +23,7 @@ # from cugraph.dask.common.mg_utils import is_single_gpu import cugraph.dask as dcg from cugraph.datasets import karate_asymmetric -from cugraph.testing import DATASETS_SMALL +from cugraph.testing import SMALL_DATASETS # ============================================================================= @@ -42,7 +42,7 @@ def setup_function(): # Pytest fixtures # ============================================================================= -datasets = DATASETS_SMALL + [karate_asymmetric] +datasets = SMALL_DATASETS + [karate_asymmetric] fixture_params = gen_fixture_params_product( (datasets, "graph_file"), 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 55462b9c6e4..4a67e8b2ae1 100644 --- a/python/cugraph/cugraph/tests/sampling/test_uniform_neighbor_sample.py +++ b/python/cugraph/cugraph/tests/sampling/test_uniform_neighbor_sample.py @@ -20,7 +20,7 @@ import cugraph from cugraph import uniform_neighbor_sample from cugraph.datasets import email_Eu_core, small_tree -from cugraph.testing import DATASETS_UNDIRECTED +from cugraph.testing import UNDIRECTED_DATASETS # ============================================================================= @@ -35,7 +35,7 @@ def setup_function(): # ============================================================================= IS_DIRECTED = [True, False] -datasets = DATASETS_UNDIRECTED + [email_Eu_core] +datasets = UNDIRECTED_DATASETS + [email_Eu_core] fixture_params = gen_fixture_params_product( (datasets, "graph_file"), 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 117b7e0c3d7..4ac8a044c22 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 @@ -26,7 +26,7 @@ from cugraph.dask import uniform_neighbor_sample from cugraph.datasets import email_Eu_core, small_tree -from cugraph.testing import DATASETS_UNDIRECTED +from cugraph.testing import UNDIRECTED_DATASETS # If the rapids-pytest-benchmark plugin is installed, the "gpubenchmark" # fixture will be available automatically. Check that this fixture is available @@ -54,7 +54,7 @@ def setup_function(): # ============================================================================= IS_DIRECTED = [True, False] -datasets = DATASETS_UNDIRECTED + [email_Eu_core] +datasets = UNDIRECTED_DATASETS + [email_Eu_core] fixture_params = gen_fixture_params_product( (datasets, "graph_file"), diff --git a/python/cugraph/cugraph/tests/structure/test_multigraph.py b/python/cugraph/cugraph/tests/structure/test_multigraph.py index e8f1f8cf53a..3c0d6f52975 100644 --- a/python/cugraph/cugraph/tests/structure/test_multigraph.py +++ b/python/cugraph/cugraph/tests/structure/test_multigraph.py @@ -18,7 +18,7 @@ import numpy as np import cugraph -from cugraph.testing import utils, DATASETS_TESTING +from cugraph.testing import utils, DEFAULT_DATASETS # ============================================================================= @@ -29,7 +29,7 @@ def setup_function(): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) def test_multigraph(graph_file): # FIXME: Migrate to new test fixtures for Graph setup once available G = graph_file.get_graph(create_using=cugraph.MultiGraph(directed=True)) @@ -60,7 +60,7 @@ def test_multigraph(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) def test_Graph_from_MultiGraph(graph_file): # FIXME: Migrate to new test fixtures for Graph setup once available GM = graph_file.get_graph(create_using=cugraph.MultiGraph()) @@ -91,7 +91,7 @@ def test_Graph_from_MultiGraph(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) def test_multigraph_sssp(graph_file): # FIXME: Migrate to new test fixtures for Graph setup once available G = graph_file.get_graph(create_using=cugraph.MultiGraph(directed=True)) diff --git a/python/cugraph/cugraph/tests/traversal/test_bfs.py b/python/cugraph/cugraph/tests/traversal/test_bfs.py index 84ef406948d..340f5812ab7 100644 --- a/python/cugraph/cugraph/tests/traversal/test_bfs.py +++ b/python/cugraph/cugraph/tests/traversal/test_bfs.py @@ -28,7 +28,7 @@ from pylibcugraph.testing.utils import gen_fixture_params_product import cugraph -from cugraph.testing import utils, DATASETS_TESTING, DATASETS_SMALL +from cugraph.testing import utils, DEFAULT_DATASETS, SMALL_DATASETS # Temporarily suppress warnings till networkX fixes deprecation warnings @@ -291,8 +291,8 @@ def get_cu_graph_nx_results_and_params(seed, depth_limit, G, dataset, directed, # ============================================================================= SEEDS = [pytest.param(s) for s in SUBSET_SEED_OPTIONS] DIRECTED = [pytest.param(d) for d in DIRECTED_GRAPH_OPTIONS] -DATASETS = [pytest.param(d) for d in DATASETS_TESTING] -DATASETS_SMALL = [pytest.param(d) for d in DATASETS_SMALL] +DATASETS = [pytest.param(d) for d in DEFAULT_DATASETS] +SMALL_DATASETS = [pytest.param(d) for d in SMALL_DATASETS] DEPTH_LIMIT = [pytest.param(d) for d in DEPTH_LIMITS] # Call gen_fixture_params_product() to caluculate the cartesian product of @@ -309,7 +309,7 @@ def get_cu_graph_nx_results_and_params(seed, depth_limit, G, dataset, directed, ) small_graph_fixture_params = gen_fixture_params_product( - (DATASETS_SMALL, "ds"), (DIRECTED, "dirctd") + (SMALL_DATASETS, "ds"), (DIRECTED, "dirctd") ) # The single param list variants are used when only 1 param combination is @@ -320,7 +320,7 @@ def get_cu_graph_nx_results_and_params(seed, depth_limit, G, dataset, directed, ) single_small_graph_fixture_params = gen_fixture_params_product( - ([DATASETS_SMALL[0]], "ds"), (DIRECTED, "dirctd") + ([SMALL_DATASETS[0]], "ds"), (DIRECTED, "dirctd") ) @@ -449,7 +449,7 @@ def test_bfs_invalid_start( @pytest.mark.sg def test_scipy_api_compat(): - graph_file = DATASETS_TESTING[0] + graph_file = DEFAULT_DATASETS[0] dataset_path = graph_file.get_path() input_cugraph_graph = graph_file.get_graph(ignore_weights=True) diff --git a/python/cugraph/cugraph/tests/traversal/test_filter_unreachable.py b/python/cugraph/cugraph/tests/traversal/test_filter_unreachable.py index 35d5cc8d43a..9ae746e2820 100644 --- a/python/cugraph/cugraph/tests/traversal/test_filter_unreachable.py +++ b/python/cugraph/cugraph/tests/traversal/test_filter_unreachable.py @@ -17,7 +17,7 @@ import numpy as np import cugraph -from cugraph.testing import DATASETS_TESTING +from cugraph.testing import DEFAULT_DATASETS # Temporarily suppress warnings till networkX fixes deprecation warnings # (Using or importing the ABCs from 'collections' instead of from @@ -45,7 +45,7 @@ def setup_function(): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_TESTING) +@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS) @pytest.mark.parametrize("source", SOURCES) def test_filter_unreachable(graph_file, source): G = graph_file.get_graph(create_using=cugraph.Graph(directed=True)) diff --git a/python/cugraph/cugraph/tests/traversal/test_sssp.py b/python/cugraph/cugraph/tests/traversal/test_sssp.py index a4dd3cb0586..41dc915e116 100644 --- a/python/cugraph/cugraph/tests/traversal/test_sssp.py +++ b/python/cugraph/cugraph/tests/traversal/test_sssp.py @@ -29,7 +29,7 @@ from pylibcugraph.testing.utils import gen_fixture_params_product import cugraph -from cugraph.testing import utils, DATASETS_UNDIRECTED, DATASETS_SMALL +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 @@ -183,7 +183,7 @@ def networkx_call(graph_file, source, edgevals=True): # FIXME: tests with datasets like 'netscience' which has a weight column different # than than 1's fail because it looks like netwokX doesn't consider weights during # the computation. -DATASETS = [pytest.param(d) for d in DATASETS_SMALL] +DATASETS = [pytest.param(d) for d in SMALL_DATASETS] SOURCES = [pytest.param(1)] fixture_params = gen_fixture_params_product((DATASETS, "ds"), (SOURCES, "src")) fixture_params_single_dataset = gen_fixture_params_product( @@ -393,7 +393,7 @@ def test_sssp_networkx_edge_attr(): @pytest.mark.sg def test_scipy_api_compat(): - graph_file = DATASETS_SMALL[0] + graph_file = SMALL_DATASETS[0] dataset_path = graph_file.get_path() input_cugraph_graph = graph_file.get_graph() input_coo_matrix = utils.create_obj_from_csv( @@ -462,7 +462,7 @@ def test_scipy_api_compat(): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED) +@pytest.mark.parametrize("graph_file", UNDIRECTED_DATASETS) def test_sssp_csr_graph(graph_file): df = graph_file.get_edgelist() @@ -504,7 +504,7 @@ def test_sssp_csr_graph(graph_file): @pytest.mark.sg def test_sssp_unweighted_graph(): - karate = DATASETS_SMALL[0] + karate = SMALL_DATASETS[0] G = karate.get_graph(ignore_weights=True) error_msg = ( 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 ac6794eb59e..5037866fd27 100644 --- a/python/cugraph/cugraph/tests/tree/test_maximum_spanning_tree.py +++ b/python/cugraph/cugraph/tests/tree/test_maximum_spanning_tree.py @@ -37,7 +37,7 @@ print("Networkx version : {} ".format(nx.__version__)) -DATASETS_UNDIRECTED_WEIGHTS = [netscience] +UNDIRECTED_WEIGHTED_DATASET = [netscience] # ============================================================================= # Pytest Setup / Teardown - called for each test function @@ -58,7 +58,7 @@ def _get_param_args(param_name, param_values): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED_WEIGHTS) +@pytest.mark.parametrize("graph_file", UNDIRECTED_WEIGHTED_DATASET) def test_maximum_spanning_tree_nx(graph_file): # cugraph G = graph_file.get_graph() @@ -89,7 +89,7 @@ def test_maximum_spanning_tree_nx(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED_WEIGHTS) +@pytest.mark.parametrize("graph_file", UNDIRECTED_WEIGHTED_DATASET) @pytest.mark.parametrize(*_get_param_args("use_adjlist", [True, False])) def test_maximum_spanning_tree_graph_repr_compat(graph_file, use_adjlist): G = graph_file.get_graph() 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 fa7652d26d1..14457239f32 100644 --- a/python/cugraph/cugraph/tests/tree/test_minimum_spanning_tree.py +++ b/python/cugraph/cugraph/tests/tree/test_minimum_spanning_tree.py @@ -36,7 +36,7 @@ print("Networkx version : {} ".format(nx.__version__)) -DATASETS_UNDIRECTED_WEIGHTS = [netscience] +UNDIRECTED_WEIGHTED_DATASET = [netscience] # ============================================================================= # Pytest Setup / Teardown - called for each test function @@ -57,7 +57,7 @@ def _get_param_args(param_name, param_values): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED_WEIGHTS) +@pytest.mark.parametrize("graph_file", UNDIRECTED_WEIGHTED_DATASET) def test_minimum_spanning_tree_nx(graph_file): # cugraph G = graph_file.get_graph() @@ -86,7 +86,7 @@ def test_minimum_spanning_tree_nx(graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED_WEIGHTS) +@pytest.mark.parametrize("graph_file", UNDIRECTED_WEIGHTED_DATASET) @pytest.mark.parametrize(*_get_param_args("use_adjlist", [True, False])) def test_minimum_spanning_tree_graph_repr_compat(graph_file, use_adjlist): G = graph_file.get_graph() diff --git a/python/cugraph/cugraph/tests/utils/test_dataset.py b/python/cugraph/cugraph/tests/utils/test_dataset.py index 1263e1e6cb3..ba993360867 100644 --- a/python/cugraph/cugraph/tests/utils/test_dataset.py +++ b/python/cugraph/cugraph/tests/utils/test_dataset.py @@ -23,8 +23,8 @@ from cugraph.testing import ( RAPIDS_DATASET_ROOT_DIR_PATH, ALL_DATASETS, - DATASETS_WEIGHTS, - DATASETS_SMALL, + WEIGHTED_DATASETS, + SMALL_DATASETS, ) from cugraph import datasets @@ -139,7 +139,7 @@ def test_get_path(dataset): tmpd.cleanup() -@pytest.mark.parametrize("dataset", DATASETS_WEIGHTS) +@pytest.mark.parametrize("dataset", WEIGHTED_DATASETS) def test_weights(dataset): G = dataset.get_graph(fetch=True) assert G.is_weighted() @@ -147,7 +147,7 @@ def test_weights(dataset): assert not G.is_weighted() -@pytest.mark.parametrize("dataset", DATASETS_SMALL) +@pytest.mark.parametrize("dataset", SMALL_DATASETS) def test_create_using(dataset): G = dataset.get_graph(fetch=True) assert not G.is_directed() From 0e7e8814d51035adbde77531e3751afb9b1d42f6 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Thu, 13 Jul 2023 07:09:42 -0700 Subject: [PATCH 17/57] remove warnings import before nx --- .../tests/components/test_connectivity.py | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/python/cugraph/cugraph/tests/components/test_connectivity.py b/python/cugraph/cugraph/tests/components/test_connectivity.py index 1b8787cb1da..f9abacfe7df 100644 --- a/python/cugraph/cugraph/tests/components/test_connectivity.py +++ b/python/cugraph/cugraph/tests/components/test_connectivity.py @@ -14,7 +14,6 @@ import gc import time from collections import defaultdict -import warnings import pytest import cupy as cp @@ -31,20 +30,9 @@ import cugraph from cugraph.testing import utils, DEFAULT_DATASETS from cugraph.datasets import dolphins, netscience, email_Eu_core +import networkx as nx - -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 - +CUSTOM_DATASETS_BATCH = [dolphins, netscience, email_Eu_core] print("Networkx version : {} ".format(nx.__version__)) @@ -283,12 +271,12 @@ def single_dataset_nxresults_weak(request): return networkx_weak_call(request.param) -@pytest.fixture(scope="module", params=DATASETS_BATCH) +@pytest.fixture(scope="module", params=CUSTOM_DATASETS_BATCH) def dataset_nxresults_strong(request): return networkx_strong_call(request.param) -@pytest.fixture(scope="module", params=[DATASETS_BATCH[0]]) +@pytest.fixture(scope="module", params=[CUSTOM_DATASETS_BATCH[0]]) def single_dataset_nxresults_strong(request): return networkx_strong_call(request.param) @@ -443,7 +431,7 @@ def test_scipy_api_compat_strong(single_dataset_nxresults_strong): @pytest.mark.parametrize("connection_type", ["strong", "weak"]) def test_scipy_api_compat(connection_type): if connection_type == "strong": - graph_file = DATASETS_BATCH[0] + graph_file = CUSTOM_DATASETS_BATCH[0] else: graph_file = DEFAULT_DATASETS[0] From 3b47cdfd02ec46a55dc7a4927c13253a66185a0a Mon Sep 17 00:00:00 2001 From: ralph Date: Thu, 13 Jul 2023 14:38:04 -0400 Subject: [PATCH 18/57] Revert "remove warnings import before nx" This reverts commit 0e7e8814d51035adbde77531e3751afb9b1d42f6. --- .../tests/components/test_connectivity.py | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/python/cugraph/cugraph/tests/components/test_connectivity.py b/python/cugraph/cugraph/tests/components/test_connectivity.py index f9abacfe7df..1b8787cb1da 100644 --- a/python/cugraph/cugraph/tests/components/test_connectivity.py +++ b/python/cugraph/cugraph/tests/components/test_connectivity.py @@ -14,6 +14,7 @@ import gc import time from collections import defaultdict +import warnings import pytest import cupy as cp @@ -30,9 +31,20 @@ import cugraph from cugraph.testing import utils, DEFAULT_DATASETS from cugraph.datasets import dolphins, netscience, email_Eu_core -import networkx as nx -CUSTOM_DATASETS_BATCH = [dolphins, netscience, email_Eu_core] + +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__)) @@ -271,12 +283,12 @@ def single_dataset_nxresults_weak(request): return networkx_weak_call(request.param) -@pytest.fixture(scope="module", params=CUSTOM_DATASETS_BATCH) +@pytest.fixture(scope="module", params=DATASETS_BATCH) def dataset_nxresults_strong(request): return networkx_strong_call(request.param) -@pytest.fixture(scope="module", params=[CUSTOM_DATASETS_BATCH[0]]) +@pytest.fixture(scope="module", params=[DATASETS_BATCH[0]]) def single_dataset_nxresults_strong(request): return networkx_strong_call(request.param) @@ -431,7 +443,7 @@ def test_scipy_api_compat_strong(single_dataset_nxresults_strong): @pytest.mark.parametrize("connection_type", ["strong", "weak"]) def test_scipy_api_compat(connection_type): if connection_type == "strong": - graph_file = CUSTOM_DATASETS_BATCH[0] + graph_file = DATASETS_BATCH[0] else: graph_file = DEFAULT_DATASETS[0] From 60bc7253c9d9e0ca2e50beb3a2d9f605d956cfa7 Mon Sep 17 00:00:00 2001 From: Naim <110031745+naimnv@users.noreply.github.com> Date: Mon, 17 Jul 2023 14:25:04 +0200 Subject: [PATCH 19/57] Update concurrent_unordered_map.cuh Update concurrent_unordered_map.cuh to include hash_functions.cuh from cudf/hashing/detail --- cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh b/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh index f097f9c43a2..326833c3de3 100644 --- a/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh +++ b/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include From 811970580de382586591616b8def2c686313b51a Mon Sep 17 00:00:00 2001 From: Md Naim Date: Mon, 17 Jul 2023 06:55:21 -0700 Subject: [PATCH 20/57] Fix include path for default_has --- cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh b/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh index 326833c3de3..bcfc205c481 100644 --- a/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh +++ b/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh @@ -118,7 +118,7 @@ union pair_packer()>> { */ template , + typename Hasher = cudf::hashing::detail::default_hash, typename Equality = equal_to, typename Allocator = default_allocator>> class concurrent_unordered_map { From f182366819eaf5638fbfbfff61d19b3597270fcd Mon Sep 17 00:00:00 2001 From: Md Naim Date: Mon, 17 Jul 2023 07:29:18 -0700 Subject: [PATCH 21/57] Fix include path for default_hash and hash_functions --- cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh b/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh index bcfc205c481..ab14ff6c685 100644 --- a/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh +++ b/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh @@ -27,6 +27,7 @@ #include #include +#include #include #include From 128cadca1f86783958d6fe10e807a5bf3147dd28 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Mon, 17 Jul 2023 09:21:35 -0700 Subject: [PATCH 22/57] test_dataset.py verifies experimental DeprecationWarnings --- python/cugraph/cugraph/datasets/dataset.py | 2 +- .../cugraph/cugraph/experimental/__init__.py | 4 --- .../cugraph/experimental/datasets/__init__.py | 12 +++++++ .../cugraph/tests/utils/test_dataset.py | 31 +++++++++++++++++++ 4 files changed, 44 insertions(+), 5 deletions(-) diff --git a/python/cugraph/cugraph/datasets/dataset.py b/python/cugraph/cugraph/datasets/dataset.py index 6b395d50fef..145badfdc2c 100644 --- a/python/cugraph/cugraph/datasets/dataset.py +++ b/python/cugraph/cugraph/datasets/dataset.py @@ -177,7 +177,7 @@ def get_edgelist(self, fetch=False): else: raise RuntimeError( f"The datafile {full_path} does not" - " exist. Try get_edgelist(fetch=True)" + " exist. Try setting fetch=True" " to download the datafile" ) header = None diff --git a/python/cugraph/cugraph/experimental/__init__.py b/python/cugraph/cugraph/experimental/__init__.py index 61093f46058..b96b760e634 100644 --- a/python/cugraph/cugraph/experimental/__init__.py +++ b/python/cugraph/cugraph/experimental/__init__.py @@ -48,10 +48,6 @@ experimental_warning_wrapper(EXPERIMENTAL__find_bicliques) ) -from cugraph.experimental.datasets.dataset import Dataset - -Dataset = promoted_experimental_warning_wrapper(Dataset) - from cugraph.experimental.link_prediction.jaccard import ( EXPERIMENTAL__jaccard, EXPERIMENTAL__jaccard_coefficient, diff --git a/python/cugraph/cugraph/experimental/datasets/__init__.py b/python/cugraph/cugraph/experimental/datasets/__init__.py index a1dd45b3d9f..a47061e5da9 100644 --- a/python/cugraph/cugraph/experimental/datasets/__init__.py +++ b/python/cugraph/cugraph/experimental/datasets/__init__.py @@ -22,9 +22,19 @@ from cugraph.experimental.datasets import metadata from pathlib import Path +from cugraph.utilities.api_tools import promoted_experimental_warning_wrapper + + +# wrap the Dataset class in the promoted_wrapper +Dataset = promoted_experimental_warning_wrapper(Dataset) +load_all = promoted_experimental_warning_wrapper(load_all) +set_download_dir = promoted_experimental_warning_wrapper(set_download_dir) +get_download_dir = promoted_experimental_warning_wrapper(get_download_dir) meta_path = Path(__file__).parent / "metadata" + +# individual dataset objects karate = Dataset(meta_path / "karate.yaml") karate_data = Dataset(meta_path / "karate_data.yaml") karate_undirected = Dataset(meta_path / "karate_undirected.yaml") @@ -41,6 +51,8 @@ email_Eu_core = Dataset(meta_path / "email-Eu-core.yaml") ktruss_polbooks = Dataset(meta_path / "ktruss_polbooks.yaml") + +# batches of datasets DATASETS_UNDIRECTED = [karate, dolphins] DATASETS_UNDIRECTED_WEIGHTS = [netscience] diff --git a/python/cugraph/cugraph/tests/utils/test_dataset.py b/python/cugraph/cugraph/tests/utils/test_dataset.py index ba993360867..791377e8e58 100644 --- a/python/cugraph/cugraph/tests/utils/test_dataset.py +++ b/python/cugraph/cugraph/tests/utils/test_dataset.py @@ -16,6 +16,7 @@ from pathlib import Path from tempfile import TemporaryDirectory import gc +import warnings import pytest @@ -264,3 +265,33 @@ def test_is_directed(dataset): G = dataset.get_graph(fetch=True, create_using=Graph(directed=dataset_is_directed)) assert G.is_directed() == dataset.metadata["is_directed"] + + +def test_experimental_dataset_import(): + warnings.filterwarnings("default") + + with pytest.deprecated_call() as record: + from cugraph.experimental.datasets import karate + + karate.unload() + + assert len(record) == 15 + + +def test_experimental_method_warnings(): + from cugraph.experimental.datasets import ( + load_all, + set_download_dir, + get_download_dir, + ) + + warnings.filterwarnings("default") + tmpd = TemporaryDirectory() + with pytest.deprecated_call() as record: + set_download_dir(tmpd.name) + load_all() + get_download_dir() + + assert len(record) == 3 + + tmpd.cleanup() From 01212d6c634e47e597da25a1e5887d41d8f720e2 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Tue, 18 Jul 2023 07:04:55 -0700 Subject: [PATCH 23/57] Update notebook headers to correct CUDA version --- notebooks/algorithms/centrality/Betweenness.ipynb | 2 +- notebooks/algorithms/centrality/Centrality.ipynb | 2 +- notebooks/algorithms/centrality/Degree.ipynb | 2 +- notebooks/algorithms/centrality/Eigenvector.ipynb | 2 +- notebooks/algorithms/centrality/Katz.ipynb | 2 +- notebooks/algorithms/community/ECG.ipynb | 2 +- notebooks/algorithms/community/Louvain.ipynb | 2 +- notebooks/algorithms/community/Spectral-Clustering.ipynb | 2 +- notebooks/algorithms/community/Subgraph-Extraction.ipynb | 2 +- notebooks/algorithms/community/Triangle-Counting.ipynb | 2 +- notebooks/algorithms/community/ktruss.ipynb | 2 +- notebooks/algorithms/components/ConnectedComponents.ipynb | 2 +- notebooks/algorithms/cores/core-number.ipynb | 2 +- notebooks/algorithms/cores/kcore.ipynb | 2 +- notebooks/algorithms/layout/Force-Atlas2.ipynb | 2 +- notebooks/algorithms/link_analysis/HITS.ipynb | 2 +- notebooks/algorithms/link_analysis/Pagerank.ipynb | 2 +- notebooks/algorithms/link_prediction/Jaccard-Similarity.ipynb | 2 +- notebooks/algorithms/link_prediction/Overlap-Similarity.ipynb | 2 +- notebooks/algorithms/sampling/RandomWalk.ipynb | 2 +- notebooks/algorithms/structure/Renumber-2.ipynb | 2 +- notebooks/algorithms/structure/Symmetrize.ipynb | 2 +- notebooks/algorithms/traversal/BFS.ipynb | 2 +- notebooks/algorithms/traversal/SSSP.ipynb | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/notebooks/algorithms/centrality/Betweenness.ipynb b/notebooks/algorithms/centrality/Betweenness.ipynb index a0ca0b70c31..f9dabd4b139 100644 --- a/notebooks/algorithms/centrality/Betweenness.ipynb +++ b/notebooks/algorithms/centrality/Betweenness.ipynb @@ -15,7 +15,7 @@ "| Brad Rees | 08/16/2020 | tested / updated | 21.10 nightly | RTX 3090 CUDA 11.4\n", "| Don Acosta | 07/05/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5\n", "| Ralph Liu | 07/26/2022 | updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5\n", - "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5" + "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0" ] }, { diff --git a/notebooks/algorithms/centrality/Centrality.ipynb b/notebooks/algorithms/centrality/Centrality.ipynb index 2b8e14f4ca7..564e2d68cee 100644 --- a/notebooks/algorithms/centrality/Centrality.ipynb +++ b/notebooks/algorithms/centrality/Centrality.ipynb @@ -20,7 +20,7 @@ "| Brad Rees | 04/16/2021 | created | 0.19 | GV100, CUDA 11.0\n", "| Brad Rees | 08/05/2021 | tested / updated | 21.10 nightly | RTX 3090 CUDA 11.4\n", "| Don Acosta | 07/29/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5\n", - "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0\n", " " ] }, diff --git a/notebooks/algorithms/centrality/Degree.ipynb b/notebooks/algorithms/centrality/Degree.ipynb index e3682e6fd36..b12fec17c8a 100644 --- a/notebooks/algorithms/centrality/Degree.ipynb +++ b/notebooks/algorithms/centrality/Degree.ipynb @@ -12,7 +12,7 @@ "| Author Credit | Date | Update | cuGraph Version | Test Hardware |\n", "| --------------|------------|------------------|-----------------|----------------|\n", "| Don Acosta | 07/05/2022 | created | 22.08 nightly | DGX Tesla V100 CUDA 11.5\n", - "| Ralph Liu | 06/29/2023 | updated w/ `datasets` api | 23.08 nightly | DGX Tesla V100 CUDA 11.5" + "| Ralph Liu | 06/29/2023 | updated w/ `datasets` api | 23.08 nightly | DGX Tesla V100 CUDA 12.0" ] }, { diff --git a/notebooks/algorithms/centrality/Eigenvector.ipynb b/notebooks/algorithms/centrality/Eigenvector.ipynb index c174e6635cf..39a6a2d8d80 100644 --- a/notebooks/algorithms/centrality/Eigenvector.ipynb +++ b/notebooks/algorithms/centrality/Eigenvector.ipynb @@ -12,7 +12,7 @@ "| Author Credit | Date | Update | cuGraph Version | Test Hardware |\n", "| --------------|------------|------------------|-----------------|----------------|\n", "| Don Acosta | 07/05/2022 | created | 22.08 nightly | DGX Tesla V100 CUDA 11.5\n", - "| Ralph Liu | 07/11/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5" + "| Ralph Liu | 07/11/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0" ] }, { diff --git a/notebooks/algorithms/centrality/Katz.ipynb b/notebooks/algorithms/centrality/Katz.ipynb index 5e39f7ce9c2..784b89ce915 100755 --- a/notebooks/algorithms/centrality/Katz.ipynb +++ b/notebooks/algorithms/centrality/Katz.ipynb @@ -15,7 +15,7 @@ "| Brad Rees | 08/16/2020 | tested / updated | 0.15.1 nightly | RTX 3090 CUDA 11.4\n", "| Don Acosta | 07/05/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5\n", "| Ralph Liu | 07/26/2022 | updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5\n", - "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5" + "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0" ] }, { diff --git a/notebooks/algorithms/community/ECG.ipynb b/notebooks/algorithms/community/ECG.ipynb index 9550cb61b5f..b1a26f78322 100644 --- a/notebooks/algorithms/community/ECG.ipynb +++ b/notebooks/algorithms/community/ECG.ipynb @@ -15,7 +15,7 @@ "| | 08/05/2021 | tested/updated | 21.10 nightly | RTX 3090 CUDA 11.4 |\n", "| Don Acosta | 07/20/2022 | tested/updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", "| Ralph Liu | 07/26/2022 | updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", - "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", + "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0\n", "\n", "## Introduction\n", "\n", diff --git a/notebooks/algorithms/community/Louvain.ipynb b/notebooks/algorithms/community/Louvain.ipynb index 4c1ddc61b1d..d57ce7685bd 100755 --- a/notebooks/algorithms/community/Louvain.ipynb +++ b/notebooks/algorithms/community/Louvain.ipynb @@ -17,7 +17,7 @@ "| | 08/05/2021 | tested / updated | 21.10 nightly | RTX 3090 CUDA 11.4 |\n", "| Don Acosta | 07/11/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", "| Ralph Liu | 07/26/2022 | updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", - "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", + "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0\n", "\n", "\n", "\n", diff --git a/notebooks/algorithms/community/Spectral-Clustering.ipynb b/notebooks/algorithms/community/Spectral-Clustering.ipynb index 295e7ba8da8..4db946b43ae 100755 --- a/notebooks/algorithms/community/Spectral-Clustering.ipynb +++ b/notebooks/algorithms/community/Spectral-Clustering.ipynb @@ -16,7 +16,7 @@ "| | 08/16/2020 | updated | 0.15 | GV100 32G, CUDA 10.2 |\n", "| Don Acosta | 07/11/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", "| Ralph Liu | 07/26/2022 | updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", - "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5" + "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0" ] }, { diff --git a/notebooks/algorithms/community/Subgraph-Extraction.ipynb b/notebooks/algorithms/community/Subgraph-Extraction.ipynb index 14a97e900cd..499e833a326 100755 --- a/notebooks/algorithms/community/Subgraph-Extraction.ipynb +++ b/notebooks/algorithms/community/Subgraph-Extraction.ipynb @@ -16,7 +16,7 @@ "| | 08/16/2020 | updated | 0.15 | GV100 32G, CUDA 10.2 |\n", "| Don Acosta | 07/11/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", "| Ralph Liu | 07/26/2022 | updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", - "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5" + "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0" ] }, { diff --git a/notebooks/algorithms/community/Triangle-Counting.ipynb b/notebooks/algorithms/community/Triangle-Counting.ipynb index 4e3f0a5aad7..07203373617 100755 --- a/notebooks/algorithms/community/Triangle-Counting.ipynb +++ b/notebooks/algorithms/community/Triangle-Counting.ipynb @@ -16,7 +16,7 @@ "| | 08/16/2020 | updated | 0.15 | GV100 32G, CUDA 10.2 |\n", "| Don Acosta | 07/11/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", "| Ralph Liu | 07/27/2022 | updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", - "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", + "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0\n", "\n", "## Introduction\n", "Triangle Counting, as the name implies, finds the number of triangles in a graph. Triangles are important in computing the clustering Coefficient and can be used for clustering. \n", diff --git a/notebooks/algorithms/community/ktruss.ipynb b/notebooks/algorithms/community/ktruss.ipynb index 7d926dfc88f..e163576e55e 100644 --- a/notebooks/algorithms/community/ktruss.ipynb +++ b/notebooks/algorithms/community/ktruss.ipynb @@ -16,7 +16,7 @@ "| | 08/05/2021 | tested/updated | 21.10 nightly | RTX 3090 CUDA 11.4 |\n", "| Don Acosta | 07/08/2022 | tested/updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", "| Ralph Liu | 07/26/2022 | updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", - "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", + "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0\n", "## Introduction\n", "\n", "Compute the k-truss of the graph G. A K-Truss is a relaxed cliques where every vertex is supported by at least k-2 triangle.\n", diff --git a/notebooks/algorithms/components/ConnectedComponents.ipynb b/notebooks/algorithms/components/ConnectedComponents.ipynb index 5b030e4b093..b11dcc523e4 100755 --- a/notebooks/algorithms/components/ConnectedComponents.ipynb +++ b/notebooks/algorithms/components/ConnectedComponents.ipynb @@ -23,7 +23,7 @@ "| Brad Rees | 10/18/2021 | updated | 21.12 nightly | GV100, CUDA 11.4 |\n", "| Ralph Liu | 06/22/2022 | updated/tested | 22.08 | TV100, CUDA 11.5 |\n", "| Don Acosta | 07/22/2021 | updated | 22.08 nightly | DGX Tesla V100, CUDA 11.5 |\n", - "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0\n", "\n", "\n", "\n", diff --git a/notebooks/algorithms/cores/core-number.ipynb b/notebooks/algorithms/cores/core-number.ipynb index 4d71189a8e8..c1fbab61803 100755 --- a/notebooks/algorithms/cores/core-number.ipynb +++ b/notebooks/algorithms/cores/core-number.ipynb @@ -18,7 +18,7 @@ "| Brad Rees | 10/28/2019 | created | 0.13 | GV100, CUDA 10.2 |\n", "| Don Acosta | 07/21/2022 | updated/tested | 22.08 nightly | DGX Tesla V100, CUDA 11.5 |\n", "| Ralph Liu | 07/26/2022 | updated/tested | 22.08 nightly | DGX Tesla V100, CUDA 11.5 |\n", - "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", + "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0\n", "\n", "## Introduction\n", "\n", diff --git a/notebooks/algorithms/cores/kcore.ipynb b/notebooks/algorithms/cores/kcore.ipynb index 1e83311cf19..a2ecb110f6b 100755 --- a/notebooks/algorithms/cores/kcore.ipynb +++ b/notebooks/algorithms/cores/kcore.ipynb @@ -19,7 +19,7 @@ "| Brad Rees | 08/16/2020 | created | 0.15 | GV100, CUDA 10.2 |\n", "| Don Acosta | 07/21/2022 | updated/tested | 22.08 nightly | DGX Tesla V100, CUDA 11.5 |\n", "| Ralph Liu | 07/26/2022 | updated/tested | 22.08 nightly | DGX Tesla V100, CUDA 11.5 |\n", - "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", + "| | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0\n", "\n", "## Introduction\n", "\n", diff --git a/notebooks/algorithms/layout/Force-Atlas2.ipynb b/notebooks/algorithms/layout/Force-Atlas2.ipynb index 8fa28a9904a..1d290857f4b 100644 --- a/notebooks/algorithms/layout/Force-Atlas2.ipynb +++ b/notebooks/algorithms/layout/Force-Atlas2.ipynb @@ -24,7 +24,7 @@ "| Brad Rees | 01/11/2022 | tested / updated | 22.02 nightly | RTX A6000 CUDA 11.5\n", "| Ralph Liu | 06/22/2022 | updated/tested | 22.08 | TV100, CUDA 11.5\n", "| Don Acosta | 08/01/2022 | tested / updated | 22.08 nightly | DGX Tesla A100 CUDA 11.5 \n", - "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5" + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0" ] }, { diff --git a/notebooks/algorithms/link_analysis/HITS.ipynb b/notebooks/algorithms/link_analysis/HITS.ipynb index 5004bea889c..0c0be19a7b5 100755 --- a/notebooks/algorithms/link_analysis/HITS.ipynb +++ b/notebooks/algorithms/link_analysis/HITS.ipynb @@ -16,7 +16,7 @@ "| | 08/16/2020 | tested / updated | 0.15.1 nightly | RTX 3090 CUDA 11.4\n", "| Ralph Liu | 06/22/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5\n", "| Don Acosta | 07/27/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5\n", - "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0\n", "\n", "## Introduction\n", "HITS, also known as hubs and authorities, computes the relative importance of vertices. \n", diff --git a/notebooks/algorithms/link_analysis/Pagerank.ipynb b/notebooks/algorithms/link_analysis/Pagerank.ipynb index 08c99317131..5d1bf9e773b 100755 --- a/notebooks/algorithms/link_analysis/Pagerank.ipynb +++ b/notebooks/algorithms/link_analysis/Pagerank.ipynb @@ -17,7 +17,7 @@ "| | 04/06/2022 | tested / updated | 22.04 nightly | GV100 32G, CUDA 11.5\n", "| Ralph Liu | 06/22/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5\n", "| Don Acosta | 07/27/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5\n", - "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0\n", "\n", "## Introduction\n", "Pagerank is measure of the relative importance, also called centrality, of a vertex based on the relative importance of it's neighbors. PageRank was developed by Google and is (was) used to rank it's search results. PageRank uses the connectivity information of a graph to rank the importance of each vertex. \n", diff --git a/notebooks/algorithms/link_prediction/Jaccard-Similarity.ipynb b/notebooks/algorithms/link_prediction/Jaccard-Similarity.ipynb index 2cdec51112c..d8a1092dd28 100755 --- a/notebooks/algorithms/link_prediction/Jaccard-Similarity.ipynb +++ b/notebooks/algorithms/link_prediction/Jaccard-Similarity.ipynb @@ -20,7 +20,7 @@ "| --------------|------------|------------------|-----------------|-----------------------|\n", "| Brad Rees | 10/14/2019 | created | 0.14 | GV100 32 GB, CUDA 10.2 |\n", "| Don Acosta | 07/20/2022 | tested/updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", - "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5" + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0" ] }, { diff --git a/notebooks/algorithms/link_prediction/Overlap-Similarity.ipynb b/notebooks/algorithms/link_prediction/Overlap-Similarity.ipynb index 344feaf7e4f..c46366541d4 100755 --- a/notebooks/algorithms/link_prediction/Overlap-Similarity.ipynb +++ b/notebooks/algorithms/link_prediction/Overlap-Similarity.ipynb @@ -20,7 +20,7 @@ "| | 08/05/2021 | tested / updated | 21.10 nightly | RTX 3090 CUDA 11.4 |\n", "| Ralph Liu | 06/22/2022 | updated/tested | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", "| Don Acosta | 08/03/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 |\n", - "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5" + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0" ] }, { diff --git a/notebooks/algorithms/sampling/RandomWalk.ipynb b/notebooks/algorithms/sampling/RandomWalk.ipynb index 58a92733a88..81d0820c89c 100644 --- a/notebooks/algorithms/sampling/RandomWalk.ipynb +++ b/notebooks/algorithms/sampling/RandomWalk.ipynb @@ -15,7 +15,7 @@ "| Brad Rees | 04/20/2021 | created | 0.19 | GV100, CUDA 11.0\n", "| Ralph Liu | 06/22/2022 | updated/tested | 22.08 | TV100, CUDA 11.5\n", "| Don Acosta | 08/28/2022 | updated/tested | 22.10 | TV100, CUDA 11.5\n", - "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0\n", "\n", "Currently NetworkX does not have a random walk function. There is code on StackOverflow that generates a random walk by getting a vertex and then randomly selecting a neighbor and then repeating the process. " ] diff --git a/notebooks/algorithms/structure/Renumber-2.ipynb b/notebooks/algorithms/structure/Renumber-2.ipynb index 8b6d275c281..666972b5571 100755 --- a/notebooks/algorithms/structure/Renumber-2.ipynb +++ b/notebooks/algorithms/structure/Renumber-2.ipynb @@ -21,7 +21,7 @@ "| Brad Rees | 07/08/2020 | updated | 0.15 | GV100, CUDA 11.0\n", "| Ralph Liu | 06/22/2022 | docs & code change | 22.08 | TV100, CUDA 11.5\n", "| Don Acosta | 08/28/2022 | updated/tested | 22.10 | TV100, CUDA 11.5\n", - "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0\n", "\n", "\n", "## Introduction\n", diff --git a/notebooks/algorithms/structure/Symmetrize.ipynb b/notebooks/algorithms/structure/Symmetrize.ipynb index 3884636244c..0a9f962b98e 100755 --- a/notebooks/algorithms/structure/Symmetrize.ipynb +++ b/notebooks/algorithms/structure/Symmetrize.ipynb @@ -15,7 +15,7 @@ "| Brad Rees and James Wyles | 08/13/2019 | created | 0.10 | GV100, CUDA 11.0\n", "| Brad Rees | 06/22/2020 | updated | 0.15 | GV100, CUDA 11.0\n", "| Don Acosta | 08/28/2022 | updated/tested | 22.10 | TV100, CUDA 11.5\n", - "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0\n", "\n", "\n", "## Introduction\n", diff --git a/notebooks/algorithms/traversal/BFS.ipynb b/notebooks/algorithms/traversal/BFS.ipynb index 5b03d9ef1c2..5962d4d28a3 100755 --- a/notebooks/algorithms/traversal/BFS.ipynb +++ b/notebooks/algorithms/traversal/BFS.ipynb @@ -15,7 +15,7 @@ "| Brad Rees and James Wyles | 08/13/2019 | created | 0.10 | GV100, CUDA 11.0\n", "| Ralph Liu | 06/22/2020 | updated | 22.08 | GV100, CUDA 11.0\n", "| Don Acosta | 08/28/2022 | updated/tested | 22.10 | TV100, CUDA 11.5\n", - "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0\n", "\n", "## Introduction\n", "\n", diff --git a/notebooks/algorithms/traversal/SSSP.ipynb b/notebooks/algorithms/traversal/SSSP.ipynb index 06ff4381dbb..eab8ee1d0db 100755 --- a/notebooks/algorithms/traversal/SSSP.ipynb +++ b/notebooks/algorithms/traversal/SSSP.ipynb @@ -15,7 +15,7 @@ "| Brad Rees and James Wyles | 08/13/2019 | created | 0.10 | GV100, CUDA 11.0\n", "| Ralph Liu | 06/22/2022 | updated | 22.08 | GV100, CUDA 11.0\n", "| Don Acosta | 08/28/2022 | updated/tested | 22.10 | TV100, CUDA 11.5\n", - "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 11.5\n", + "| Ralph Liu | 06/29/2023 | updated | 23.08 nightly | DGX Tesla V100 CUDA 12.0\n", "\n", "## Introduction\n", "\n", From a897d4538f3c9cf44b9e94f8d6579ddcdce59dd7 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Tue, 18 Jul 2023 09:31:09 -0700 Subject: [PATCH 24/57] Minor notebook changes and fixing test bug --- notebooks/algorithms/centrality/Eigenvector.ipynb | 5 ++++- .../tests/centrality/test_eigenvector_centrality_mg.py | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/notebooks/algorithms/centrality/Eigenvector.ipynb b/notebooks/algorithms/centrality/Eigenvector.ipynb index 39a6a2d8d80..504187624ec 100644 --- a/notebooks/algorithms/centrality/Eigenvector.ipynb +++ b/notebooks/algorithms/centrality/Eigenvector.ipynb @@ -182,7 +182,10 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Create a Graph " + "### Create a Graph\n", + "\n", + "cuGraph's dataset objects depend on cuDF for data loading and the intial edge-list creation.\n", + "The original data file contains an edge-list, which represents the connection of a vertex to another. These `source` to `destination` pairs are in what is known as Coordinate Format (COO). In this case, the data is just two columns. However, a third `weight` column is also possible" ] }, { 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..f91ac418ef0 100644 --- a/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality_mg.py +++ b/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality_mg.py @@ -19,7 +19,7 @@ import dask_cudf import cudf from cugraph.dask.common.mg_utils import is_single_gpu -from cugraph.testing.utils import DEFAULT_DATASETS +from cugraph.testing.utils import DATASETS # ============================================================================= @@ -37,7 +37,7 @@ def setup_function(): @pytest.mark.mg @pytest.mark.skipif(is_single_gpu(), reason="skipping MG testing on Single GPU system") @pytest.mark.parametrize("directed", IS_DIRECTED) -@pytest.mark.parametrize("input_data_path", DEFAULT_DATASETS) +@pytest.mark.parametrize("input_data_path", DATASETS) def test_dask_eigenvector_centrality(dask_client, directed, input_data_path): input_data_path = input_data_path.as_posix() print(f"dataset={input_data_path}") @@ -86,7 +86,7 @@ def test_dask_eigenvector_centrality(dask_client, directed, input_data_path): @pytest.mark.mg def test_dask_eigenvector_centrality_transposed_false(dask_client): - input_data_path = DEFAULT_DATASETS[0] + input_data_path = DATASETS[0] chunksize = dcg.get_chunksize(input_data_path) From 864402d3c3c256df167b6d82baceb19e21c0fae9 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Tue, 18 Jul 2023 09:33:33 -0700 Subject: [PATCH 25/57] Clear eigenvector notebook outputs --- notebooks/algorithms/centrality/Eigenvector.ipynb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/notebooks/algorithms/centrality/Eigenvector.ipynb b/notebooks/algorithms/centrality/Eigenvector.ipynb index 504187624ec..f126f2b1de5 100644 --- a/notebooks/algorithms/centrality/Eigenvector.ipynb +++ b/notebooks/algorithms/centrality/Eigenvector.ipynb @@ -185,7 +185,7 @@ "### Create a Graph\n", "\n", "cuGraph's dataset objects depend on cuDF for data loading and the intial edge-list creation.\n", - "The original data file contains an edge-list, which represents the connection of a vertex to another. These `source` to `destination` pairs are in what is known as Coordinate Format (COO). In this case, the data is just two columns. However, a third `weight` column is also possible" + "The original data file contains an edge-list, which represents the connection of a vertex to another. These `source` to `destination` pairs are in what is known as Coordinate Format (COO)." ] }, { @@ -194,7 +194,16 @@ "metadata": {}, "outputs": [], "source": [ - "G = karate.get_graph(fetch=True)" + "karate.get_edgelist(fetch=True)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "G = karate.get_graph()" ] }, { From ab699be2b5a8ef672f6e887499bd9ec8a5ed2153 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Tue, 18 Jul 2023 05:26:49 -0700 Subject: [PATCH 26/57] cleanup unit test imports and remove nx warnings --- .../centrality/test_betweenness_centrality.py | 11 +++---- .../test_betweenness_centrality_mg.py | 9 +++--- .../centrality/test_degree_centrality.py | 3 +- .../centrality/test_degree_centrality_mg.py | 5 +-- .../test_edge_betweenness_centrality.py | 19 +++-------- .../centrality/test_eigenvector_centrality.py | 2 +- .../test_eigenvector_centrality_mg.py | 11 ++++--- .../tests/centrality/test_katz_centrality.py | 11 +------ .../centrality/test_katz_centrality_mg.py | 11 ++++--- .../cugraph/tests/comms/test_comms_mg.py | 10 +++--- .../tests/community/test_balanced_cut.py | 3 +- .../cugraph/tests/community/test_ecg.py | 5 ++- .../community/test_induced_subgraph_mg.py | 8 ++--- .../tests/community/test_k_truss_subgraph.py | 16 ++-------- .../cugraph/tests/community/test_leiden.py | 2 +- .../cugraph/tests/community/test_leiden_mg.py | 5 ++- .../cugraph/tests/community/test_louvain.py | 13 ++------ .../tests/community/test_louvain_mg.py | 1 - .../tests/community/test_modularity.py | 5 ++- .../tests/community/test_triangle_count.py | 19 +++-------- .../tests/community/test_triangle_count_mg.py | 8 ++--- .../tests/components/test_connectivity.py | 13 ++------ .../tests/components/test_connectivity_mg.py | 13 ++++---- .../cugraph/tests/core/test_core_number.py | 4 +-- .../cugraph/tests/core/test_core_number_mg.py | 6 ++-- .../cugraph/cugraph/tests/core/test_k_core.py | 12 +------ .../cugraph/tests/core/test_k_core_mg.py | 8 ++--- .../tests/data_store/test_gnn_feat_storage.py | 6 ++-- .../tests/data_store/test_property_graph.py | 9 +++--- .../data_store/test_property_graph_mg.py | 14 ++++---- .../cugraph/tests/generators/test_rmat.py | 3 +- .../cugraph/tests/generators/test_rmat_mg.py | 5 ++- .../tests/gnn/test_dgl_uniform_sampler.py | 6 ++-- .../tests/gnn/test_dgl_uniform_sampler_mg.py | 9 +++--- .../cugraph/tests/internals/test_renumber.py | 4 +-- .../tests/internals/test_renumber_mg.py | 6 ++-- .../tests/internals/test_symmetrize.py | 2 +- .../tests/internals/test_symmetrize_mg.py | 4 +-- .../cugraph/tests/layout/test_force_atlas2.py | 10 ++---- .../cugraph/tests/link_analysis/test_hits.py | 4 +-- .../tests/link_analysis/test_hits_mg.py | 6 ++-- .../tests/link_analysis/test_pagerank.py | 15 ++------- .../tests/link_analysis/test_pagerank_mg.py | 14 ++++---- .../tests/link_prediction/test_jaccard.py | 20 +++--------- .../tests/link_prediction/test_jaccard_mg.py | 5 +-- .../tests/link_prediction/test_overlap.py | 7 ++-- .../tests/link_prediction/test_overlap_mg.py | 4 +-- .../tests/link_prediction/test_sorensen.py | 18 +++-------- .../tests/link_prediction/test_sorensen_mg.py | 8 ++--- .../tests/link_prediction/test_wjaccard.py | 17 ++-------- .../tests/link_prediction/test_woverlap.py | 4 +-- .../tests/link_prediction/test_wsorensen.py | 17 ++-------- .../cugraph/tests/nx/test_compat_algo.py | 2 +- .../cugraph/tests/nx/test_compat_pr.py | 2 +- .../cugraph/tests/nx/test_nx_convert.py | 17 ++-------- .../tests/sampling/test_bulk_sampler.py | 7 ++-- .../tests/sampling/test_bulk_sampler_io.py | 7 ++-- .../tests/sampling/test_bulk_sampler_io_mg.py | 7 ++-- .../tests/sampling/test_bulk_sampler_mg.py | 7 ++-- .../cugraph/tests/sampling/test_egonet.py | 12 ++----- .../cugraph/tests/sampling/test_egonet_mg.py | 8 ++--- .../cugraph/tests/sampling/test_node2vec.py | 5 +-- .../tests/sampling/test_random_walks.py | 7 ++-- .../tests/sampling/test_random_walks_mg.py | 8 ++--- .../sampling/test_uniform_neighbor_sample.py | 6 ++-- .../test_uniform_neighbor_sample_mg.py | 11 +++---- .../tests/structure/test_convert_matrix.py | 16 +++------- .../cugraph/tests/structure/test_graph.py | 32 ++++++------------- .../cugraph/tests/structure/test_graph_mg.py | 19 +++++------ .../tests/structure/test_multigraph.py | 2 +- .../cugraph/tests/traversal/test_bfs.py | 27 +++++----------- .../cugraph/tests/traversal/test_bfs_mg.py | 10 +++--- .../traversal/test_filter_unreachable.py | 14 ++------ .../cugraph/tests/traversal/test_paths.py | 8 ++--- .../cugraph/tests/traversal/test_sssp.py | 21 ++++-------- .../cugraph/tests/traversal/test_sssp_mg.py | 11 +++---- .../tests/tree/test_maximum_spanning_tree.py | 16 ++-------- .../tests/tree/test_minimum_spanning_tree.py | 15 ++------- .../cugraph/cugraph/tests/utils/mg_context.py | 5 ++- .../tests/utils/test_replication_mg.py | 9 +++--- .../cugraph/cugraph/tests/utils/test_utils.py | 4 +-- .../cugraph/tests/utils/test_utils_mg.py | 21 ++++++------ 82 files changed, 281 insertions(+), 505 deletions(-) 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 f91ac418ef0..6828dd3cbd2 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 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 # ============================================================================= From cf363951a967b8f8f57c8a82fd17acf3d6ac2f86 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Tue, 18 Jul 2023 10:54:14 -0700 Subject: [PATCH 27/57] Dataset unit test comment --- python/cugraph/cugraph/tests/utils/test_dataset.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/cugraph/cugraph/tests/utils/test_dataset.py b/python/cugraph/cugraph/tests/utils/test_dataset.py index 791377e8e58..326c6814003 100644 --- a/python/cugraph/cugraph/tests/utils/test_dataset.py +++ b/python/cugraph/cugraph/tests/utils/test_dataset.py @@ -267,6 +267,7 @@ def test_is_directed(dataset): assert G.is_directed() == dataset.metadata["is_directed"] +# Test experimental for DeprecationWarnings def test_experimental_dataset_import(): warnings.filterwarnings("default") From 66584441b11d74f9033cac26eeac670cce5fd5b4 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Wed, 19 Jul 2023 10:23:17 -0700 Subject: [PATCH 28/57] Fix style issue in unit test --- .../cugraph/cugraph/tests/link_prediction/test_jaccard.py | 6 +++--- .../cugraph/cugraph/tests/link_prediction/test_overlap.py | 8 ++++---- .../cugraph/tests/link_prediction/test_sorensen.py | 6 +++--- .../cugraph/tests/link_prediction/test_wjaccard.py | 4 ++-- .../cugraph/tests/link_prediction/test_woverlap.py | 6 +++--- .../cugraph/tests/link_prediction/test_wsorensen.py | 4 ++-- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py b/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py index d065f3b04d7..397aa9c2ea5 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py @@ -18,7 +18,7 @@ from cudf.testing import assert_series_equal, assert_frame_equal import cugraph -from cugraph.testing import utils, UNDIRECTED_DATASETS +from cugraph.testing import utils, DATASETS_UNDIRECTED from cugraph.experimental import jaccard_coefficient as exp_jaccard_coefficient from cugraph.experimental import jaccard as exp_jaccard from cugraph.datasets import netscience @@ -140,7 +140,7 @@ def networkx_call(M, benchmark_callable=None): # ============================================================================= # Pytest Fixtures # ============================================================================= -@pytest.fixture(scope="module", params=UNDIRECTED_DATASETS) +@pytest.fixture(scope="module", params=DATASETS_UNDIRECTED) def read_csv(request): """ Read csv file for both networkx and cugraph @@ -318,7 +318,7 @@ def test_jaccard_multi_column(read_csv): @pytest.mark.sg def test_weighted_exp_jaccard(): - karate = UNDIRECTED_DATASETS[0] + karate = DATASETS_UNDIRECTED[0] G = karate.get_graph() with pytest.raises(ValueError): exp_jaccard(G) diff --git a/python/cugraph/cugraph/tests/link_prediction/test_overlap.py b/python/cugraph/cugraph/tests/link_prediction/test_overlap.py index 07f5ed36e24..74920845679 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_overlap.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_overlap.py @@ -22,7 +22,7 @@ from cugraph.experimental import overlap as exp_overlap import cugraph -from cugraph.testing import utils, UNDIRECTED_DATASETS +from cugraph.testing import utils, DATASETS_UNDIRECTED # ============================================================================= @@ -112,7 +112,7 @@ def cpu_call(M, first, second): # ============================================================================= # Pytest Fixtures # ============================================================================= -@pytest.fixture(scope="module", params=UNDIRECTED_DATASETS) +@pytest.fixture(scope="module", params=DATASETS_UNDIRECTED) def read_csv(request): """ Read csv file for both networkx and cugraph @@ -170,7 +170,7 @@ def test_overlap_edge_vals(gpubenchmark, read_csv, extract_two_hop): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", UNDIRECTED_DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED) def test_overlap_multi_column(graph_file): dataset_path = graph_file.get_path() M = utils.read_csv_for_nx(dataset_path) @@ -215,7 +215,7 @@ def test_overlap_multi_column(graph_file): @pytest.mark.sg def test_weighted_exp_overlap(): - karate = UNDIRECTED_DATASETS[0] + karate = DATASETS_UNDIRECTED[0] G = karate.get_graph() with pytest.raises(ValueError): exp_overlap(G) diff --git a/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py b/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py index a67ab18b7af..44fdbdb729f 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py @@ -18,7 +18,7 @@ from cudf.testing import assert_series_equal, assert_frame_equal import cugraph -from cugraph.testing import utils, UNDIRECTED_DATASETS +from cugraph.testing import utils, DATASETS_UNDIRECTED from cugraph.datasets import netscience from cugraph.experimental import sorensen as exp_sorensen @@ -145,7 +145,7 @@ def networkx_call(M, benchmark_callable=None): # ============================================================================= # Pytest Fixtures # ============================================================================= -@pytest.fixture(scope="module", params=UNDIRECTED_DATASETS) +@pytest.fixture(scope="module", params=DATASETS_UNDIRECTED) def read_csv(request): """ Read csv file for both networkx and cugraph @@ -280,7 +280,7 @@ def test_sorensen_multi_column(read_csv): @pytest.mark.sg def test_weighted_exp_sorensen(): - karate = UNDIRECTED_DATASETS[0] + karate = DATASETS_UNDIRECTED[0] G = karate.get_graph() with pytest.raises(ValueError): exp_sorensen(G) diff --git a/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py b/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py index 3d0bdb43a48..4184a90fa82 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py @@ -20,7 +20,7 @@ from cudf.testing import assert_series_equal import cugraph -from cugraph.testing import utils, UNDIRECTED_DATASETS +from cugraph.testing import utils, DATASETS_UNDIRECTED # Temporarily suppress warnings till networkX fixes deprecation warnings @@ -96,7 +96,7 @@ def networkx_call(M, benchmark_callable=None): # ============================================================================= # Pytest Fixtures # ============================================================================= -@pytest.fixture(scope="module", params=UNDIRECTED_DATASETS) +@pytest.fixture(scope="module", params=DATASETS_UNDIRECTED) def read_csv(request): """ Read csv file for both networkx and cugraph diff --git a/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py b/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py index 381d5062114..bf49877696d 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py @@ -20,7 +20,7 @@ from cudf.testing import assert_series_equal import cugraph -from cugraph.testing import utils, UNDIRECTED_DATASETS +from cugraph.testing import utils, DATASETS_UNDIRECTED # ============================================================================= @@ -93,7 +93,7 @@ def cpu_call(M, first, second): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", UNDIRECTED_DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED) def test_woverlap(gpubenchmark, graph_file): dataset_path = graph_file.get_path() Mnx = utils.read_csv_for_nx(dataset_path) @@ -121,7 +121,7 @@ def test_woverlap(gpubenchmark, graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", UNDIRECTED_DATASETS) +@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED) def test_woverlap_multi_column(graph_file): dataset_path = graph_file.get_path() M = utils.read_csv_for_nx(dataset_path) diff --git a/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py b/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py index 428aed77416..342876379ee 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py @@ -20,7 +20,7 @@ from cudf.testing import assert_series_equal import cugraph -from cugraph.testing import utils, UNDIRECTED_DATASETS +from cugraph.testing import utils, DATASETS_UNDIRECTED # Temporarily suppress warnings till networkX fixes deprecation warnings @@ -100,7 +100,7 @@ def networkx_call(M, benchmark_callable=None): # ============================================================================= # Pytest Fixtures # ============================================================================= -@pytest.fixture(scope="module", params=UNDIRECTED_DATASETS) +@pytest.fixture(scope="module", params=DATASETS_UNDIRECTED) def read_csv(request): """ Read csv file for both networkx and cugraph From 6b41038bf20dccc1965a319f4cd908639292310f Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Wed, 19 Jul 2023 12:24:26 -0700 Subject: [PATCH 29/57] Fix link_prediction import issue --- .../cugraph/tests/link_prediction/test_jaccard.py | 8 ++++---- .../cugraph/tests/link_prediction/test_overlap.py | 10 +++++----- .../cugraph/tests/link_prediction/test_sorensen.py | 8 ++++---- .../cugraph/tests/link_prediction/test_wjaccard.py | 6 +++--- .../cugraph/tests/link_prediction/test_woverlap.py | 8 ++++---- .../cugraph/tests/link_prediction/test_wsorensen.py | 6 +++--- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py b/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py index 397aa9c2ea5..a3fb1b04480 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_jaccard.py @@ -18,7 +18,7 @@ from cudf.testing import assert_series_equal, assert_frame_equal import cugraph -from cugraph.testing import utils, DATASETS_UNDIRECTED +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 @@ -140,7 +140,7 @@ def networkx_call(M, benchmark_callable=None): # ============================================================================= # Pytest Fixtures # ============================================================================= -@pytest.fixture(scope="module", params=DATASETS_UNDIRECTED) +@pytest.fixture(scope="module", params=UNDIRECTED_DATASETS) def read_csv(request): """ Read csv file for both networkx and cugraph @@ -318,7 +318,7 @@ def test_jaccard_multi_column(read_csv): @pytest.mark.sg def test_weighted_exp_jaccard(): - karate = DATASETS_UNDIRECTED[0] + karate = UNDIRECTED_DATASETS[0] G = karate.get_graph() with pytest.raises(ValueError): exp_jaccard(G) @@ -331,7 +331,7 @@ def test_weighted_exp_jaccard(): @pytest.mark.sg def test_invalid_datasets_jaccard(): - karate = DATASETS_UNDIRECTED[0] + karate = UNDIRECTED_DATASETS[0] df = karate.get_edgelist() df = df.add(1) G = cugraph.Graph(directed=False) diff --git a/python/cugraph/cugraph/tests/link_prediction/test_overlap.py b/python/cugraph/cugraph/tests/link_prediction/test_overlap.py index 74920845679..95608659c66 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_overlap.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_overlap.py @@ -22,7 +22,7 @@ from cugraph.experimental import overlap as exp_overlap import cugraph -from cugraph.testing import utils, DATASETS_UNDIRECTED +from cugraph.testing import utils, UNDIRECTED_DATASETS # ============================================================================= @@ -112,7 +112,7 @@ def cpu_call(M, first, second): # ============================================================================= # Pytest Fixtures # ============================================================================= -@pytest.fixture(scope="module", params=DATASETS_UNDIRECTED) +@pytest.fixture(scope="module", params=UNDIRECTED_DATASETS) def read_csv(request): """ Read csv file for both networkx and cugraph @@ -170,7 +170,7 @@ def test_overlap_edge_vals(gpubenchmark, read_csv, extract_two_hop): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED) +@pytest.mark.parametrize("graph_file", UNDIRECTED_DATASETS) def test_overlap_multi_column(graph_file): dataset_path = graph_file.get_path() M = utils.read_csv_for_nx(dataset_path) @@ -215,7 +215,7 @@ def test_overlap_multi_column(graph_file): @pytest.mark.sg def test_weighted_exp_overlap(): - karate = DATASETS_UNDIRECTED[0] + karate = UNDIRECTED_DATASETS[0] G = karate.get_graph() with pytest.raises(ValueError): exp_overlap(G) @@ -228,7 +228,7 @@ def test_weighted_exp_overlap(): @pytest.mark.sg def test_invalid_datasets_overlap(): - karate = DATASETS_UNDIRECTED[0] + karate = UNDIRECTED_DATASETS[0] df = karate.get_edgelist() df = df.add(1) G = cugraph.Graph(directed=False) diff --git a/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py b/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py index 44fdbdb729f..fdb80410a4a 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py @@ -18,7 +18,7 @@ from cudf.testing import assert_series_equal, assert_frame_equal import cugraph -from cugraph.testing import utils, DATASETS_UNDIRECTED +from cugraph.testing import utils, UNDIRECTED_DATASETS from cugraph.datasets import netscience from cugraph.experimental import sorensen as exp_sorensen @@ -145,7 +145,7 @@ def networkx_call(M, benchmark_callable=None): # ============================================================================= # Pytest Fixtures # ============================================================================= -@pytest.fixture(scope="module", params=DATASETS_UNDIRECTED) +@pytest.fixture(scope="module", params=UNDIRECTED_DATASETS) def read_csv(request): """ Read csv file for both networkx and cugraph @@ -280,7 +280,7 @@ def test_sorensen_multi_column(read_csv): @pytest.mark.sg def test_weighted_exp_sorensen(): - karate = DATASETS_UNDIRECTED[0] + karate = UNDIRECTED_DATASETS[0] G = karate.get_graph() with pytest.raises(ValueError): exp_sorensen(G) @@ -293,7 +293,7 @@ def test_weighted_exp_sorensen(): @pytest.mark.sg def test_invalid_datasets_sorensen(): - karate = DATASETS_UNDIRECTED[0] + karate = UNDIRECTED_DATASETS[0] df = karate.get_edgelist() df = df.add(1) G = cugraph.Graph(directed=False) diff --git a/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py b/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py index 4184a90fa82..285abc64b1e 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_wjaccard.py @@ -20,7 +20,7 @@ from cudf.testing import assert_series_equal import cugraph -from cugraph.testing import utils, DATASETS_UNDIRECTED +from cugraph.testing import utils, UNDIRECTED_DATASETS # Temporarily suppress warnings till networkX fixes deprecation warnings @@ -96,7 +96,7 @@ def networkx_call(M, benchmark_callable=None): # ============================================================================= # Pytest Fixtures # ============================================================================= -@pytest.fixture(scope="module", params=DATASETS_UNDIRECTED) +@pytest.fixture(scope="module", params=UNDIRECTED_DATASETS) def read_csv(request): """ Read csv file for both networkx and cugraph @@ -179,7 +179,7 @@ def test_wjaccard_multi_column(read_csv): @pytest.mark.sg def test_invalid_datasets_jaccard_w(): - karate = DATASETS_UNDIRECTED[0] + karate = UNDIRECTED_DATASETS[0] df = karate.get_edgelist() df = df.add(1) G = cugraph.Graph(directed=False) diff --git a/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py b/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py index bf49877696d..b9fa6d0001f 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_woverlap.py @@ -20,7 +20,7 @@ from cudf.testing import assert_series_equal import cugraph -from cugraph.testing import utils, DATASETS_UNDIRECTED +from cugraph.testing import utils, UNDIRECTED_DATASETS # ============================================================================= @@ -93,7 +93,7 @@ def cpu_call(M, first, second): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED) +@pytest.mark.parametrize("graph_file", UNDIRECTED_DATASETS) def test_woverlap(gpubenchmark, graph_file): dataset_path = graph_file.get_path() Mnx = utils.read_csv_for_nx(dataset_path) @@ -121,7 +121,7 @@ def test_woverlap(gpubenchmark, graph_file): @pytest.mark.sg -@pytest.mark.parametrize("graph_file", DATASETS_UNDIRECTED) +@pytest.mark.parametrize("graph_file", UNDIRECTED_DATASETS) def test_woverlap_multi_column(graph_file): dataset_path = graph_file.get_path() M = utils.read_csv_for_nx(dataset_path) @@ -162,7 +162,7 @@ def test_woverlap_multi_column(graph_file): @pytest.mark.sg def test_invalid_datasets_overlap_w(): - karate = DATASETS_UNDIRECTED[0] + karate = UNDIRECTED_DATASETS[0] df = karate.get_edgelist() df = df.add(1) G = cugraph.Graph(directed=False) diff --git a/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py b/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py index 342876379ee..21e3d26e33d 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_wsorensen.py @@ -20,7 +20,7 @@ from cudf.testing import assert_series_equal import cugraph -from cugraph.testing import utils, DATASETS_UNDIRECTED +from cugraph.testing import utils, UNDIRECTED_DATASETS # Temporarily suppress warnings till networkX fixes deprecation warnings @@ -100,7 +100,7 @@ def networkx_call(M, benchmark_callable=None): # ============================================================================= # Pytest Fixtures # ============================================================================= -@pytest.fixture(scope="module", params=DATASETS_UNDIRECTED) +@pytest.fixture(scope="module", params=UNDIRECTED_DATASETS) def read_csv(request): """ Read csv file for both networkx and cugraph @@ -183,7 +183,7 @@ def test_wsorensen_multi_column(read_csv): @pytest.mark.sg def test_invalid_datasets_sorensen_w(): - karate = DATASETS_UNDIRECTED[0] + karate = UNDIRECTED_DATASETS[0] df = karate.get_edgelist() df = df.add(1) G = cugraph.Graph(directed=False) From 72a6ecf7cb57f82068db0151cf83afe497d1ccad Mon Sep 17 00:00:00 2001 From: root Date: Thu, 20 Jul 2023 12:46:49 +0000 Subject: [PATCH 30/57] Improved DeprecationWarning check for test_dataset.py --- .../cugraph/tests/utils/test_dataset.py | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/python/cugraph/cugraph/tests/utils/test_dataset.py b/python/cugraph/cugraph/tests/utils/test_dataset.py index 326c6814003..e58f697e82f 100644 --- a/python/cugraph/cugraph/tests/utils/test_dataset.py +++ b/python/cugraph/cugraph/tests/utils/test_dataset.py @@ -266,18 +266,20 @@ def test_is_directed(dataset): assert G.is_directed() == dataset.metadata["is_directed"] - +# # Test experimental for DeprecationWarnings +# def test_experimental_dataset_import(): warnings.filterwarnings("default") with pytest.deprecated_call() as record: from cugraph.experimental.datasets import karate + if not record: + pytest.fail("Expected experimental.datasets to raise DeprecationWarning") + karate.unload() - assert len(record) == 15 - def test_experimental_method_warnings(): from cugraph.experimental.datasets import ( @@ -288,11 +290,23 @@ def test_experimental_method_warnings(): warnings.filterwarnings("default") tmpd = TemporaryDirectory() + with pytest.deprecated_call() as record: set_download_dir(tmpd.name) - load_all() + + if not record: + pytest.fail("Expected set_download_dir to raise DeprecationWarning") + + with pytest.deprecated_call() as record: get_download_dir() - assert len(record) == 3 + if not record: + pytest.fail("Expected get_download_dir to raise DeprecationWarning") + + with pytest.deprecated_call() as record: + load_all() + + if not record: + pytest.fail("Expected load_all to raise DeprecationWarning") - tmpd.cleanup() + tmpd.cleanup() \ No newline at end of file From d6c216b5d4d5ba0aef7d28fe41d435f649421d85 Mon Sep 17 00:00:00 2001 From: ralph Date: Thu, 20 Jul 2023 09:12:31 -0400 Subject: [PATCH 31/57] style fix --- python/cugraph/cugraph/tests/utils/test_dataset.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/cugraph/cugraph/tests/utils/test_dataset.py b/python/cugraph/cugraph/tests/utils/test_dataset.py index e58f697e82f..8dfcd42a5fb 100644 --- a/python/cugraph/cugraph/tests/utils/test_dataset.py +++ b/python/cugraph/cugraph/tests/utils/test_dataset.py @@ -277,7 +277,7 @@ def test_experimental_dataset_import(): if not record: pytest.fail("Expected experimental.datasets to raise DeprecationWarning") - + karate.unload() @@ -302,11 +302,11 @@ def test_experimental_method_warnings(): if not record: pytest.fail("Expected get_download_dir to raise DeprecationWarning") - + with pytest.deprecated_call() as record: load_all() if not record: pytest.fail("Expected load_all to raise DeprecationWarning") - tmpd.cleanup() \ No newline at end of file + tmpd.cleanup() From 3d15c7d42c1d687d9353b16afe503b85a0986208 Mon Sep 17 00:00:00 2001 From: ralph Date: Thu, 20 Jul 2023 09:16:58 -0400 Subject: [PATCH 32/57] more style fix --- python/cugraph/cugraph/tests/utils/test_dataset.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/cugraph/cugraph/tests/utils/test_dataset.py b/python/cugraph/cugraph/tests/utils/test_dataset.py index 8dfcd42a5fb..85a195e6977 100644 --- a/python/cugraph/cugraph/tests/utils/test_dataset.py +++ b/python/cugraph/cugraph/tests/utils/test_dataset.py @@ -266,6 +266,7 @@ def test_is_directed(dataset): assert G.is_directed() == dataset.metadata["is_directed"] + # # Test experimental for DeprecationWarnings # From f9b50a5b1b6217bf4874a44662e42d83236d1b5d Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Thu, 20 Jul 2023 09:38:41 -0700 Subject: [PATCH 33/57] Migrate URLs to s3 --- .../cugraph/datasets/metadata/cyber.yaml | 2 +- .../cugraph/datasets/metadata/dolphins.yaml | 2 +- .../datasets/metadata/email-Eu-core.yaml | 2 +- .../datasets/metadata/karate-disjoint.yaml | 2 +- .../cugraph/datasets/metadata/karate.yaml | 2 +- .../datasets/metadata/karate_asymmetric.yaml | 2 +- .../datasets/metadata/ktruss_polbooks.yaml | 2 +- .../cugraph/datasets/metadata/netscience.yaml | 2 +- .../cugraph/datasets/metadata/one_edge.yaml | 22 +++++++++++++++++++ .../cugraph/datasets/metadata/one_vertex.yaml | 22 +++++++++++++++++++ .../cugraph/datasets/metadata/polbooks.yaml | 2 +- .../cugraph/datasets/metadata/small_line.yaml | 2 +- .../cugraph/datasets/metadata/small_tree.yaml | 2 +- .../cugraph/datasets/metadata/toy_graph.yaml | 2 +- .../metadata/toy_graph_undirected.yaml | 2 +- 15 files changed, 57 insertions(+), 13 deletions(-) create mode 100644 python/cugraph/cugraph/datasets/metadata/one_edge.yaml create mode 100644 python/cugraph/cugraph/datasets/metadata/one_vertex.yaml diff --git a/python/cugraph/cugraph/datasets/metadata/cyber.yaml b/python/cugraph/cugraph/datasets/metadata/cyber.yaml index 93ab5345442..7d35d858cee 100644 --- a/python/cugraph/cugraph/datasets/metadata/cyber.yaml +++ b/python/cugraph/cugraph/datasets/metadata/cyber.yaml @@ -1,7 +1,7 @@ name: cyber file_type: .csv author: N/A -url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/cyber.csv +url: https://data.rapids.ai/cugraph/datasets/cyber.csv refs: N/A col_names: - idx diff --git a/python/cugraph/cugraph/datasets/metadata/dolphins.yaml b/python/cugraph/cugraph/datasets/metadata/dolphins.yaml index e4951375321..cbdf843f34c 100644 --- a/python/cugraph/cugraph/datasets/metadata/dolphins.yaml +++ b/python/cugraph/cugraph/datasets/metadata/dolphins.yaml @@ -1,7 +1,7 @@ name: dolphins file_type: .csv author: D. Lusseau -url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/dolphins.csv +url: https://data.rapids.ai/cugraph/datasets/dolphins.csv refs: D. Lusseau, K. Schneider, O. J. Boisseau, P. Haase, E. Slooten, and S. M. Dawson, The bottlenose dolphin community of Doubtful Sound features a large proportion of diff --git a/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml b/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml index e42a42f132d..4f421405da1 100644 --- a/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml +++ b/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml @@ -1,7 +1,7 @@ name: email-Eu-core file_type: .csv author: null -url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/email-Eu-core.csv +url: https://data.rapids.ai/cugraph/datasets/email-Eu-core.csv refs: null delim: " " header: None diff --git a/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml b/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml index 0c0eaf78b63..f20e9fa8d09 100644 --- a/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml +++ b/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml @@ -1,7 +1,7 @@ name: karate-disjoint file_type: .csv author: null -url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/karate-disjoint.csv +url: https://data.rapids.ai/cugraph/datasets/karate-disjoint.csv refs: null delim: " " header: None diff --git a/python/cugraph/cugraph/datasets/metadata/karate.yaml b/python/cugraph/cugraph/datasets/metadata/karate.yaml index 273381ed368..fadfbd65f45 100644 --- a/python/cugraph/cugraph/datasets/metadata/karate.yaml +++ b/python/cugraph/cugraph/datasets/metadata/karate.yaml @@ -1,7 +1,7 @@ name: karate file_type: .csv author: Zachary W. -url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/karate.csv +url: https://data.rapids.ai/cugraph/datasets/karate.csv refs: W. W. Zachary, An information flow model for conflict and fission in small groups, Journal of Anthropological Research 33, 452-473 (1977). diff --git a/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml index 3616b8fb3a5..bde1478ad83 100644 --- a/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml +++ b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml @@ -1,7 +1,7 @@ name: karate-asymmetric file_type: .csv author: Zachary W. -url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/karate-asymmetric.csv +url: https://data.rapids.ai/cugraph/datasets/karate-asymmetric.csv delim: " " header: None refs: diff --git a/python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml b/python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml index 1ef29b3917e..10e3307b082 100644 --- a/python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml +++ b/python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml @@ -1,7 +1,7 @@ name: ktruss_polbooks file_type: .csv author: null -url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/ref/ktruss/polbooks.csv +url: https://data.rapids.ai/cugraph/datasets/polbooks.csv refs: null delim: " " header: None diff --git a/python/cugraph/cugraph/datasets/metadata/netscience.yaml b/python/cugraph/cugraph/datasets/metadata/netscience.yaml index 3077c4a9002..2e94e30d14f 100644 --- a/python/cugraph/cugraph/datasets/metadata/netscience.yaml +++ b/python/cugraph/cugraph/datasets/metadata/netscience.yaml @@ -1,7 +1,7 @@ name: netscience file_type: .csv author: Newman, Mark EJ -url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/netscience.csv +url: https://data.rapids.ai/cugraph/datasets/netscience.csv refs: Finding community structure in networks using the eigenvectors of matrices. delim: " " header: None diff --git a/python/cugraph/cugraph/datasets/metadata/one_edge.yaml b/python/cugraph/cugraph/datasets/metadata/one_edge.yaml new file mode 100644 index 00000000000..d230377308a --- /dev/null +++ b/python/cugraph/cugraph/datasets/metadata/one_edge.yaml @@ -0,0 +1,22 @@ +name: one_edge +file_type: .csv +author: Ralph Liu +url: null +refs: null +delim: " " +header: None +col_names: + - src + - dst + - wgt +col_types: + - int32 + - int32 + - float32 +has_loop: false +is_directed: false +is_multigraph: false +is_symmetric: false +number_of_edges: 1 +number_of_nodes: 2 +number_of_lines: 0 diff --git a/python/cugraph/cugraph/datasets/metadata/one_vertex.yaml b/python/cugraph/cugraph/datasets/metadata/one_vertex.yaml new file mode 100644 index 00000000000..2c354aa37b8 --- /dev/null +++ b/python/cugraph/cugraph/datasets/metadata/one_vertex.yaml @@ -0,0 +1,22 @@ +name: one_vertex +file_type: .csv +author: Ralph Liu +url: null +refs: +delim: " " +header: None +col_names: + - src + - dst + - wgt +col_types: + - int32 + - int32 + - float32 +has_loop: false +is_directed: false +is_multigraph: false +is_symmetric: false +number_of_edges: 0 +number_of_nodes: 1 +number_of_lines: 0 diff --git a/python/cugraph/cugraph/datasets/metadata/polbooks.yaml b/python/cugraph/cugraph/datasets/metadata/polbooks.yaml index 5816e5672fd..be547f6ac7b 100644 --- a/python/cugraph/cugraph/datasets/metadata/polbooks.yaml +++ b/python/cugraph/cugraph/datasets/metadata/polbooks.yaml @@ -1,7 +1,7 @@ name: polbooks file_type: .csv author: V. Krebs -url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/polbooks.csv +url: https://data.rapids.ai/cugraph/datasets/polbooks.csv refs: null delim: " " header: None diff --git a/python/cugraph/cugraph/datasets/metadata/small_line.yaml b/python/cugraph/cugraph/datasets/metadata/small_line.yaml index 5b724ac99fd..1335cead3cd 100644 --- a/python/cugraph/cugraph/datasets/metadata/small_line.yaml +++ b/python/cugraph/cugraph/datasets/metadata/small_line.yaml @@ -1,7 +1,7 @@ name: small_line file_type: .csv author: null -url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/small_line.csv +url: https://data.rapids.ai/cugraph/datasets/small_line.csv refs: null delim: " " header: None diff --git a/python/cugraph/cugraph/datasets/metadata/small_tree.yaml b/python/cugraph/cugraph/datasets/metadata/small_tree.yaml index 8eeac346d2a..71921c3b335 100644 --- a/python/cugraph/cugraph/datasets/metadata/small_tree.yaml +++ b/python/cugraph/cugraph/datasets/metadata/small_tree.yaml @@ -1,7 +1,7 @@ name: small_tree file_type: .csv author: null -url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/small_tree.csv +url: https://data.rapids.ai/cugraph/datasets/small_tree.csv refs: null delim: " " header: None diff --git a/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml b/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml index 0d8ea46d9a7..9600d25b123 100644 --- a/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml +++ b/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml @@ -1,7 +1,7 @@ name: toy_graph file_type: .csv author: null -url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/toy_graph.csv +url: https://data.rapids.ai/cugraph/datasets/toy_graph.csv refs: null delim: " " header: None diff --git a/python/cugraph/cugraph/datasets/metadata/toy_graph_undirected.yaml b/python/cugraph/cugraph/datasets/metadata/toy_graph_undirected.yaml index c6e86bdf334..077161c3d69 100644 --- a/python/cugraph/cugraph/datasets/metadata/toy_graph_undirected.yaml +++ b/python/cugraph/cugraph/datasets/metadata/toy_graph_undirected.yaml @@ -1,7 +1,7 @@ name: toy_graph_undirected file_type: .csv author: null -url: https://raw.githubusercontent.com/rapidsai/cugraph/branch-22.08/datasets/toy_graph_undirected.csv +url: https://data.rapids.ai/cugraph/datasets/toy_graph_undirected.csv refs: null delim: " " header: None From 121c888707cd5059d6c6072e2d8472b40a1842b5 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Thu, 20 Jul 2023 15:16:34 -0700 Subject: [PATCH 34/57] Add re-import fixture to dataset unit test --- .../cugraph/tests/utils/test_dataset.py | 48 +++++++++---------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/python/cugraph/cugraph/tests/utils/test_dataset.py b/python/cugraph/cugraph/tests/utils/test_dataset.py index 85a195e6977..e79df8c3020 100644 --- a/python/cugraph/cugraph/tests/utils/test_dataset.py +++ b/python/cugraph/cugraph/tests/utils/test_dataset.py @@ -11,12 +11,12 @@ # See the License for the specific language governing permissions and # limitations under the License. - import os -from pathlib import Path -from tempfile import TemporaryDirectory import gc +import sys import warnings +from pathlib import Path +from tempfile import TemporaryDirectory import pytest @@ -73,6 +73,22 @@ def setup(tmpdir): gc.collect() +@pytest.fixture() +def setup_deprecation_warning_tests(): + """ + Fixture used to set warning filters to 'default' and reload + experimental.datasets module if it has been previously + imported. Tests that import this fixture are expected to + import cugraph.experimental.datasets + """ + warnings.filterwarnings("default") + + if "cugraph.experimental.datasets" in sys.modules: + del sys.modules["cugraph.experimental.datasets"] + + yield + + ############################################################################### # Tests @@ -270,19 +286,14 @@ def test_is_directed(dataset): # # Test experimental for DeprecationWarnings # -def test_experimental_dataset_import(): - warnings.filterwarnings("default") - - with pytest.deprecated_call() as record: +def test_experimental_dataset_import(setup_deprecation_warning_tests): + with pytest.deprecated_call(): from cugraph.experimental.datasets import karate - if not record: - pytest.fail("Expected experimental.datasets to raise DeprecationWarning") - karate.unload() -def test_experimental_method_warnings(): +def test_experimental_method_warnings(setup_deprecation_warning_tests): from cugraph.experimental.datasets import ( load_all, set_download_dir, @@ -292,22 +303,9 @@ def test_experimental_method_warnings(): warnings.filterwarnings("default") tmpd = TemporaryDirectory() - with pytest.deprecated_call() as record: + with pytest.deprecated_call(): set_download_dir(tmpd.name) - - if not record: - pytest.fail("Expected set_download_dir to raise DeprecationWarning") - - with pytest.deprecated_call() as record: get_download_dir() - - if not record: - pytest.fail("Expected get_download_dir to raise DeprecationWarning") - - with pytest.deprecated_call() as record: load_all() - if not record: - pytest.fail("Expected load_all to raise DeprecationWarning") - tmpd.cleanup() From c8aa44fe567fc636980b6a36005a68b0551147f9 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Fri, 21 Jul 2023 05:51:43 -0700 Subject: [PATCH 35/57] Update Ktruss polbooks metadata URL --- python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml b/python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml index 10e3307b082..1e68b708ba3 100644 --- a/python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml +++ b/python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml @@ -1,7 +1,7 @@ name: ktruss_polbooks file_type: .csv -author: null -url: https://data.rapids.ai/cugraph/datasets/polbooks.csv +author: V. Krebs +url: https://data.rapids.ai/cugraph/datasets/ref/ktruss/polbooks.csv refs: null delim: " " header: None From 02e23efbcc788b12c51d0b148d8070474c87b6e9 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Fri, 21 Jul 2023 06:57:26 -0700 Subject: [PATCH 36/57] Commit to see if #3680 updates --- python/cugraph/cugraph/tests/utils/test_dataset.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/cugraph/cugraph/tests/utils/test_dataset.py b/python/cugraph/cugraph/tests/utils/test_dataset.py index e79df8c3020..399f491925a 100644 --- a/python/cugraph/cugraph/tests/utils/test_dataset.py +++ b/python/cugraph/cugraph/tests/utils/test_dataset.py @@ -290,6 +290,7 @@ def test_experimental_dataset_import(setup_deprecation_warning_tests): with pytest.deprecated_call(): from cugraph.experimental.datasets import karate + # unload() is called to pass flake8 karate.unload() From eb474787865fd12927f8e6a5bf1c953f9d4fcf3b Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Mon, 24 Jul 2023 07:36:56 -0700 Subject: [PATCH 37/57] Update Datasets with standardized 'download' parameter --- python/cugraph/cugraph/datasets/__init__.py | 3 +-- python/cugraph/cugraph/datasets/dataset.py | 22 ++++++++++----------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/python/cugraph/cugraph/datasets/__init__.py b/python/cugraph/cugraph/datasets/__init__.py index 339af81d802..14c1ae101cb 100644 --- a/python/cugraph/cugraph/datasets/__init__.py +++ b/python/cugraph/cugraph/datasets/__init__.py @@ -16,7 +16,7 @@ # datasets module from cugraph.datasets.dataset import ( Dataset, - load_all, + download_all, set_download_dir, get_download_dir, default_download_dir, @@ -26,7 +26,6 @@ # metadata path for .yaml files meta_path = Path(__file__).parent / "metadata" -# invidual datasets cyber = Dataset(meta_path / "cyber.yaml") dolphins = Dataset(meta_path / "dolphins.yaml") email_Eu_core = Dataset(meta_path / "email-Eu-core.yaml") diff --git a/python/cugraph/cugraph/datasets/dataset.py b/python/cugraph/cugraph/datasets/dataset.py index 145badfdc2c..229d0fda632 100644 --- a/python/cugraph/cugraph/datasets/dataset.py +++ b/python/cugraph/cugraph/datasets/dataset.py @@ -159,25 +159,25 @@ def unload(self): """ self._edgelist = None - def get_edgelist(self, fetch=False): + def get_edgelist(self, download=False): """ Return an Edgelist Parameters ---------- - fetch : Boolean (default=False) - Automatically fetch for the dataset from the 'url' location within + download : Boolean (default=False) + Automatically download the dataset from the 'url' location within the YAML file. """ if self._edgelist is None: full_path = self.get_path() if not full_path.is_file(): - if fetch: + if download: full_path = self.__download_csv(self.metadata["url"]) else: raise RuntimeError( f"The datafile {full_path} does not" - " exist. Try setting fetch=True" + " exist. Try setting download=True" " to download the datafile" ) header = None @@ -195,7 +195,7 @@ def get_edgelist(self, fetch=False): def get_graph( self, - fetch=False, + download=False, create_using=Graph, ignore_weights=False, store_transposed=False, @@ -205,7 +205,7 @@ def get_graph( Parameters ---------- - fetch : Boolean (default=False) + download : Boolean (default=False) Downloads the dataset from the web. create_using: cugraph.Graph (instance or class), optional @@ -221,7 +221,7 @@ def get_graph( be unweighted regardless of ignore_weights. """ if self._edgelist is None: - self.get_edgelist(fetch) + self.get_edgelist(download) if create_using is None: G = Graph() @@ -267,9 +267,9 @@ def get_path(self): return self._path.absolute() -def load_all(force=False): +def download_all(force=False): """ - Looks in `metadata` directory and fetches all datafiles from the the URLs + Looks in `metadata` directory and downloads all datafiles from the the URLs provided in each YAML file. Parameters @@ -295,7 +295,7 @@ def load_all(force=False): def set_download_dir(path): """ - Set the download directory for fetching datasets + Set the download location fors datasets Parameters ---------- From 7d66b369841ed3edec21176893bec959448ee3d8 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Mon, 24 Jul 2023 07:37:28 -0700 Subject: [PATCH 38/57] Update doc strings: fetch -> Download --- .../centrality/betweenness_centrality.py | 4 +-- .../cugraph/centrality/degree_centrality.py | 2 +- .../centrality/eigenvector_centrality.py | 2 +- .../cugraph/centrality/katz_centrality.py | 2 +- python/cugraph/cugraph/community/ecg.py | 2 +- python/cugraph/cugraph/community/egonet.py | 4 +-- .../cugraph/community/induced_subgraph.py | 2 +- .../cugraph/community/ktruss_subgraph.py | 4 +-- python/cugraph/cugraph/community/leiden.py | 2 +- python/cugraph/cugraph/community/louvain.py | 2 +- .../cugraph/community/spectral_clustering.py | 10 +++--- .../cugraph/community/subgraph_extraction.py | 2 +- .../cugraph/components/connectivity.py | 6 ++-- python/cugraph/cugraph/cores/core_number.py | 2 +- python/cugraph/cugraph/cores/k_core.py | 2 +- .../cugraph/gnn/data_loading/bulk_sampler.py | 2 +- python/cugraph/cugraph/layout/force_atlas2.py | 2 +- python/cugraph/cugraph/link_analysis/hits.py | 2 +- .../cugraph/cugraph/link_analysis/pagerank.py | 2 +- .../cugraph/link_prediction/jaccard.py | 6 ++-- .../cugraph/link_prediction/overlap.py | 2 +- .../cugraph/link_prediction/sorensen.py | 4 +-- .../cugraph/link_prediction/wjaccard.py | 2 +- .../cugraph/link_prediction/woverlap.py | 2 +- .../cugraph/link_prediction/wsorensen.py | 2 +- python/cugraph/cugraph/sampling/node2vec.py | 2 +- .../cugraph/cugraph/sampling/random_walks.py | 2 +- .../cugraph/tests/utils/test_dataset.py | 36 ++++++++++--------- 28 files changed, 59 insertions(+), 55 deletions(-) diff --git a/python/cugraph/cugraph/centrality/betweenness_centrality.py b/python/cugraph/cugraph/centrality/betweenness_centrality.py index 222ff4c6465..29f6792fc08 100644 --- a/python/cugraph/cugraph/centrality/betweenness_centrality.py +++ b/python/cugraph/cugraph/centrality/betweenness_centrality.py @@ -123,7 +123,7 @@ def betweenness_centrality( Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> bc = cugraph.betweenness_centrality(G) """ @@ -290,7 +290,7 @@ def edge_betweenness_centrality( Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> bc = cugraph.edge_betweenness_centrality(G) """ diff --git a/python/cugraph/cugraph/centrality/degree_centrality.py b/python/cugraph/cugraph/centrality/degree_centrality.py index b368673067b..12d39f4127e 100644 --- a/python/cugraph/cugraph/centrality/degree_centrality.py +++ b/python/cugraph/cugraph/centrality/degree_centrality.py @@ -46,7 +46,7 @@ def degree_centrality(G, normalized=True): Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> dc = cugraph.degree_centrality(G) """ diff --git a/python/cugraph/cugraph/centrality/eigenvector_centrality.py b/python/cugraph/cugraph/centrality/eigenvector_centrality.py index 860422871e0..6be797096fc 100644 --- a/python/cugraph/cugraph/centrality/eigenvector_centrality.py +++ b/python/cugraph/cugraph/centrality/eigenvector_centrality.py @@ -69,7 +69,7 @@ def eigenvector_centrality(G, max_iter=100, tol=1.0e-6): Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> ec = cugraph.eigenvector_centrality(G) """ diff --git a/python/cugraph/cugraph/centrality/katz_centrality.py b/python/cugraph/cugraph/centrality/katz_centrality.py index 153810f1a82..d902f9b06c9 100644 --- a/python/cugraph/cugraph/centrality/katz_centrality.py +++ b/python/cugraph/cugraph/centrality/katz_centrality.py @@ -106,7 +106,7 @@ def katz_centrality( Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> kc = cugraph.katz_centrality(G) """ diff --git a/python/cugraph/cugraph/community/ecg.py b/python/cugraph/cugraph/community/ecg.py index c3f7de9f9a4..fbf8df43867 100644 --- a/python/cugraph/cugraph/community/ecg.py +++ b/python/cugraph/cugraph/community/ecg.py @@ -66,7 +66,7 @@ def ecg(input_graph, min_weight=0.05, ensemble_size=16, weight=None): Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> parts = cugraph.ecg(G) """ diff --git a/python/cugraph/cugraph/community/egonet.py b/python/cugraph/cugraph/community/egonet.py index ccdf174615c..01bbc41d8cd 100644 --- a/python/cugraph/cugraph/community/egonet.py +++ b/python/cugraph/cugraph/community/egonet.py @@ -87,7 +87,7 @@ def ego_graph(G, n, radius=1, center=True, undirected=None, distance=None): Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> ego_graph = cugraph.ego_graph(G, 1, radius=2) """ @@ -191,7 +191,7 @@ def batched_ego_graphs(G, seeds, radius=1, center=True, undirected=None, distanc Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> b_ego_graph, offsets = cugraph.batched_ego_graphs(G, seeds=[1,5], ... radius=2) diff --git a/python/cugraph/cugraph/community/induced_subgraph.py b/python/cugraph/cugraph/community/induced_subgraph.py index e9fb95f4c02..29fe2f29c1e 100644 --- a/python/cugraph/cugraph/community/induced_subgraph.py +++ b/python/cugraph/cugraph/community/induced_subgraph.py @@ -92,7 +92,7 @@ def induced_subgraph( Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> verts = np.zeros(3, dtype=np.int32) >>> verts[0] = 0 >>> verts[1] = 1 diff --git a/python/cugraph/cugraph/community/ktruss_subgraph.py b/python/cugraph/cugraph/community/ktruss_subgraph.py index a0af11f2535..0ebbe633317 100644 --- a/python/cugraph/cugraph/community/ktruss_subgraph.py +++ b/python/cugraph/cugraph/community/ktruss_subgraph.py @@ -70,7 +70,7 @@ def k_truss(G, k): Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> k_subgraph = cugraph.k_truss(G, 3) """ @@ -151,7 +151,7 @@ def ktruss_subgraph(G, k, use_weights=True): Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> k_subgraph = cugraph.ktruss_subgraph(G, 3) """ diff --git a/python/cugraph/cugraph/community/leiden.py b/python/cugraph/cugraph/community/leiden.py index f7359324d4a..d2a1a413d7b 100644 --- a/python/cugraph/cugraph/community/leiden.py +++ b/python/cugraph/cugraph/community/leiden.py @@ -95,7 +95,7 @@ def leiden( Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> parts, modularity_score = cugraph.leiden(G) """ diff --git a/python/cugraph/cugraph/community/louvain.py b/python/cugraph/cugraph/community/louvain.py index 462c842b17f..35ca864824f 100644 --- a/python/cugraph/cugraph/community/louvain.py +++ b/python/cugraph/cugraph/community/louvain.py @@ -70,7 +70,7 @@ def louvain(G, max_iter=100, resolution=1.0): Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> parts = cugraph.louvain(G) """ diff --git a/python/cugraph/cugraph/community/spectral_clustering.py b/python/cugraph/cugraph/community/spectral_clustering.py index 0f10d672a70..864c1005d20 100644 --- a/python/cugraph/cugraph/community/spectral_clustering.py +++ b/python/cugraph/cugraph/community/spectral_clustering.py @@ -82,7 +82,7 @@ def spectralBalancedCutClustering( Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> df = cugraph.spectralBalancedCutClustering(G, 5) """ @@ -179,7 +179,7 @@ def spectralModularityMaximizationClustering( Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> df = cugraph.spectralModularityMaximizationClustering(G, 5) """ @@ -255,7 +255,7 @@ def analyzeClustering_modularity( Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> df = cugraph.spectralBalancedCutClustering(G, 5) >>> score = cugraph.analyzeClustering_modularity(G, 5, df) @@ -337,7 +337,7 @@ def analyzeClustering_edge_cut( Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> df = cugraph.spectralBalancedCutClustering(G, 5) >>> score = cugraph.analyzeClustering_edge_cut(G, 5, df) @@ -417,7 +417,7 @@ def analyzeClustering_ratio_cut( Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> df = cugraph.spectralBalancedCutClustering(G, 5) >>> score = cugraph.analyzeClustering_ratio_cut(G, 5, df, 'vertex', ... 'cluster') diff --git a/python/cugraph/cugraph/community/subgraph_extraction.py b/python/cugraph/cugraph/community/subgraph_extraction.py index 2a76c8d00ba..77b28d4daff 100644 --- a/python/cugraph/cugraph/community/subgraph_extraction.py +++ b/python/cugraph/cugraph/community/subgraph_extraction.py @@ -58,7 +58,7 @@ def subgraph( Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> verts = np.zeros(3, dtype=np.int32) >>> verts[0] = 0 >>> verts[1] = 1 diff --git a/python/cugraph/cugraph/components/connectivity.py b/python/cugraph/cugraph/components/connectivity.py index 4d5d362b1d0..45dba37d2ce 100644 --- a/python/cugraph/cugraph/components/connectivity.py +++ b/python/cugraph/cugraph/components/connectivity.py @@ -170,7 +170,7 @@ def weakly_connected_components(G, directed=None, connection=None, return_labels Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> df = cugraph.weakly_connected_components(G) """ @@ -279,7 +279,7 @@ def strongly_connected_components( Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> df = cugraph.strongly_connected_components(G) """ @@ -388,7 +388,7 @@ def connected_components(G, directed=None, connection="weak", return_labels=None Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> df = cugraph.connected_components(G, connection="weak") """ diff --git a/python/cugraph/cugraph/cores/core_number.py b/python/cugraph/cugraph/cores/core_number.py index 31414e77839..3e6cbe0d96f 100644 --- a/python/cugraph/cugraph/cores/core_number.py +++ b/python/cugraph/cugraph/cores/core_number.py @@ -56,7 +56,7 @@ def core_number(G, degree_type="bidirectional"): Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> df = cugraph.core_number(G) """ diff --git a/python/cugraph/cugraph/cores/k_core.py b/python/cugraph/cugraph/cores/k_core.py index c651ce155ff..3dbc1cfa377 100644 --- a/python/cugraph/cugraph/cores/k_core.py +++ b/python/cugraph/cugraph/cores/k_core.py @@ -83,7 +83,7 @@ def k_core(G, k=None, core_number=None, degree_type="bidirectional"): Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> KCoreGraph = cugraph.k_core(G) """ diff --git a/python/cugraph/cugraph/gnn/data_loading/bulk_sampler.py b/python/cugraph/cugraph/gnn/data_loading/bulk_sampler.py index 57d1208be19..2a0df3d75d0 100644 --- a/python/cugraph/cugraph/gnn/data_loading/bulk_sampler.py +++ b/python/cugraph/cugraph/gnn/data_loading/bulk_sampler.py @@ -146,7 +146,7 @@ def add_batches( >>> bulk_sampler = BulkSampler( ... batch_size=3, ... output_path=output_tempdir.name, - ... graph=karate.get_graph(fetch=True)) + ... graph=karate.get_graph(download=True)) >>> bulk_sampler.add_batches( ... df, ... start_col_name="start_vid", diff --git a/python/cugraph/cugraph/layout/force_atlas2.py b/python/cugraph/cugraph/layout/force_atlas2.py index b45e166b4e0..0e15eee718f 100644 --- a/python/cugraph/cugraph/layout/force_atlas2.py +++ b/python/cugraph/cugraph/layout/force_atlas2.py @@ -124,7 +124,7 @@ def on_train_end(self, positions): Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> pos = cugraph.force_atlas2(G) """ diff --git a/python/cugraph/cugraph/link_analysis/hits.py b/python/cugraph/cugraph/link_analysis/hits.py index 2280eaaed74..c826efb6095 100644 --- a/python/cugraph/cugraph/link_analysis/hits.py +++ b/python/cugraph/cugraph/link_analysis/hits.py @@ -76,7 +76,7 @@ def hits(G, max_iter=100, tol=1.0e-5, nstart=None, normalized=True): Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> hits = cugraph.hits(G, max_iter = 50) """ diff --git a/python/cugraph/cugraph/link_analysis/pagerank.py b/python/cugraph/cugraph/link_analysis/pagerank.py index 8664b34825c..3b39ac597ab 100644 --- a/python/cugraph/cugraph/link_analysis/pagerank.py +++ b/python/cugraph/cugraph/link_analysis/pagerank.py @@ -208,7 +208,7 @@ def pagerank( Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> pr = cugraph.pagerank(G, alpha = 0.85, max_iter = 500, tol = 1.0e-05) """ diff --git a/python/cugraph/cugraph/link_prediction/jaccard.py b/python/cugraph/cugraph/link_prediction/jaccard.py index 5617b75c024..f1b488c8cca 100644 --- a/python/cugraph/cugraph/link_prediction/jaccard.py +++ b/python/cugraph/cugraph/link_prediction/jaccard.py @@ -59,7 +59,7 @@ def jaccard(input_graph, vertex_pair=None, do_expensive_check=True): solution by doing the following: >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> pairs = G.get_two_hop_neighbors() >>> df = cugraph.jaccard(G, pairs) @@ -108,7 +108,7 @@ def jaccard(input_graph, vertex_pair=None, do_expensive_check=True): Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> df = cugraph.jaccard(G) """ @@ -188,7 +188,7 @@ def jaccard_coefficient(G, ebunch=None, do_expensive_check=True): Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> df = cugraph.jaccard_coefficient(G) """ diff --git a/python/cugraph/cugraph/link_prediction/overlap.py b/python/cugraph/cugraph/link_prediction/overlap.py index 88a9c5b04a3..9bb7b76b0ca 100644 --- a/python/cugraph/cugraph/link_prediction/overlap.py +++ b/python/cugraph/cugraph/link_prediction/overlap.py @@ -98,7 +98,7 @@ def overlap(input_graph, vertex_pair=None, do_expensive_check=True): Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> df = cugraph.overlap(G) """ diff --git a/python/cugraph/cugraph/link_prediction/sorensen.py b/python/cugraph/cugraph/link_prediction/sorensen.py index a7f07a70630..1d43adb51cd 100644 --- a/python/cugraph/cugraph/link_prediction/sorensen.py +++ b/python/cugraph/cugraph/link_prediction/sorensen.py @@ -80,7 +80,7 @@ def sorensen(input_graph, vertex_pair=None, do_expensive_check=True): Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> df = cugraph.sorensen(G) """ @@ -161,7 +161,7 @@ def sorensen_coefficient(G, ebunch=None, do_expensive_check=True): Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> df = cugraph.sorensen_coefficient(G) """ diff --git a/python/cugraph/cugraph/link_prediction/wjaccard.py b/python/cugraph/cugraph/link_prediction/wjaccard.py index 97b9c1a26c9..e3486473fe5 100644 --- a/python/cugraph/cugraph/link_prediction/wjaccard.py +++ b/python/cugraph/cugraph/link_prediction/wjaccard.py @@ -79,7 +79,7 @@ def jaccard_w(input_graph, weights, vertex_pair=None, do_expensive_check=True): -------- >>> import random >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> # Create a dataframe containing the vertices with their >>> # corresponding weight >>> weights = cudf.DataFrame() diff --git a/python/cugraph/cugraph/link_prediction/woverlap.py b/python/cugraph/cugraph/link_prediction/woverlap.py index 44d1b4c8c84..d7ebc5fc684 100644 --- a/python/cugraph/cugraph/link_prediction/woverlap.py +++ b/python/cugraph/cugraph/link_prediction/woverlap.py @@ -81,7 +81,7 @@ def overlap_w(input_graph, weights, vertex_pair=None, do_expensive_check=True): -------- >>> import random >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> # Create a dataframe containing the vertices with their >>> # corresponding weight >>> weights = cudf.DataFrame() diff --git a/python/cugraph/cugraph/link_prediction/wsorensen.py b/python/cugraph/cugraph/link_prediction/wsorensen.py index 57f9d020408..8337b4602de 100644 --- a/python/cugraph/cugraph/link_prediction/wsorensen.py +++ b/python/cugraph/cugraph/link_prediction/wsorensen.py @@ -77,7 +77,7 @@ def sorensen_w(input_graph, weights, vertex_pair=None, do_expensive_check=True): -------- >>> import random >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> # Create a dataframe containing the vertices with their >>> # corresponding weight >>> weights = cudf.DataFrame() diff --git a/python/cugraph/cugraph/sampling/node2vec.py b/python/cugraph/cugraph/sampling/node2vec.py index c9fadeca7a8..bc9b88250af 100644 --- a/python/cugraph/cugraph/sampling/node2vec.py +++ b/python/cugraph/cugraph/sampling/node2vec.py @@ -79,7 +79,7 @@ def node2vec(G, start_vertices, max_depth=1, compress_result=True, p=1.0, q=1.0) Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> start_vertices = cudf.Series([0, 2], dtype=np.int32) >>> paths, weights, path_sizes = cugraph.node2vec(G, start_vertices, 3, ... True, 0.8, 0.5) diff --git a/python/cugraph/cugraph/sampling/random_walks.py b/python/cugraph/cugraph/sampling/random_walks.py index fa7ebbd5b2c..015c05d1b08 100644 --- a/python/cugraph/cugraph/sampling/random_walks.py +++ b/python/cugraph/cugraph/sampling/random_walks.py @@ -115,7 +115,7 @@ def random_walks( Examples -------- >>> from cugraph.datasets import karate - >>> M = karate.get_edgelist(fetch=True) + >>> M = karate.get_edgelist(download=True) >>> G = karate.get_graph() >>> start_vertices = G.nodes()[:4] >>> _, _, _ = cugraph.random_walks(G, "uniform", start_vertices, 3) diff --git a/python/cugraph/cugraph/tests/utils/test_dataset.py b/python/cugraph/cugraph/tests/utils/test_dataset.py index e79df8c3020..26aea76c82d 100644 --- a/python/cugraph/cugraph/tests/utils/test_dataset.py +++ b/python/cugraph/cugraph/tests/utils/test_dataset.py @@ -120,8 +120,8 @@ def test_set_download_dir(): @pytest.mark.parametrize("dataset", ALL_DATASETS) -def test_fetch(dataset): - E = dataset.get_edgelist(fetch=True) +def test_download(dataset): + E = dataset.get_edgelist(download=True) assert E is not None assert dataset.get_path().is_file() @@ -129,13 +129,13 @@ def test_fetch(dataset): @pytest.mark.parametrize("dataset", ALL_DATASETS) def test_get_edgelist(dataset): - E = dataset.get_edgelist(fetch=True) + E = dataset.get_edgelist(download=True) assert E is not None @pytest.mark.parametrize("dataset", ALL_DATASETS) def test_get_graph(dataset): - G = dataset.get_graph(fetch=True) + G = dataset.get_graph(download=True) assert G is not None @@ -150,7 +150,7 @@ def test_metadata(dataset): def test_get_path(dataset): tmpd = TemporaryDirectory() datasets.set_download_dir(tmpd.name) - dataset.get_edgelist(fetch=True) + dataset.get_edgelist(download=True) assert dataset.get_path().is_file() tmpd.cleanup() @@ -158,19 +158,19 @@ def test_get_path(dataset): @pytest.mark.parametrize("dataset", WEIGHTED_DATASETS) def test_weights(dataset): - G = dataset.get_graph(fetch=True) + G = dataset.get_graph(download=True) assert G.is_weighted() - G = dataset.get_graph(fetch=True, ignore_weights=True) + G = dataset.get_graph(download=True, ignore_weights=True) assert not G.is_weighted() @pytest.mark.parametrize("dataset", SMALL_DATASETS) def test_create_using(dataset): - G = dataset.get_graph(fetch=True) + G = dataset.get_graph(download=True) assert not G.is_directed() - G = dataset.get_graph(fetch=True, create_using=Graph) + G = dataset.get_graph(download=True, create_using=Graph) assert not G.is_directed() - G = dataset.get_graph(fetch=True, create_using=Graph(directed=True)) + G = dataset.get_graph(download=True, create_using=Graph(directed=True)) assert G.is_directed() @@ -202,9 +202,9 @@ def test_ctor_with_datafile(): csv_col_dtypes=["int32", "int32", "float32"], ) - expected_karate_edgelist = karate.get_edgelist(fetch=True) + expected_karate_edgelist = karate.get_edgelist(download=True) - # test with file path as string, ensure fetch=True does not break + # test with file path as string, ensure download=True does not break ds = datasets.Dataset( csv_file=karate_csv.as_posix(), csv_col_names=["src", "dst", "wgt"], @@ -261,7 +261,9 @@ def test_unload(): @pytest.mark.parametrize("dataset", ALL_DATASETS) def test_node_and_edge_count(dataset): dataset_is_directed = dataset.metadata["is_directed"] - G = dataset.get_graph(fetch=True, create_using=Graph(directed=dataset_is_directed)) + G = dataset.get_graph( + download=True, create_using=Graph(directed=dataset_is_directed) + ) # these are the values read directly from .yaml file meta_node_count = dataset.metadata["number_of_nodes"] @@ -278,7 +280,9 @@ def test_node_and_edge_count(dataset): @pytest.mark.parametrize("dataset", ALL_DATASETS) def test_is_directed(dataset): dataset_is_directed = dataset.metadata["is_directed"] - G = dataset.get_graph(fetch=True, create_using=Graph(directed=dataset_is_directed)) + G = dataset.get_graph( + download=True, create_using=Graph(directed=dataset_is_directed) + ) assert G.is_directed() == dataset.metadata["is_directed"] @@ -295,7 +299,7 @@ def test_experimental_dataset_import(setup_deprecation_warning_tests): def test_experimental_method_warnings(setup_deprecation_warning_tests): from cugraph.experimental.datasets import ( - load_all, + download_all, set_download_dir, get_download_dir, ) @@ -306,6 +310,6 @@ def test_experimental_method_warnings(setup_deprecation_warning_tests): with pytest.deprecated_call(): set_download_dir(tmpd.name) get_download_dir() - load_all() + download_all() tmpd.cleanup() From e5e9b71b2dab0cac5d802f60d9bdda025425fc8a Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Mon, 24 Jul 2023 07:43:37 -0700 Subject: [PATCH 39/57] Update unit test usage of datasets API: fetch -> download --- .../cugraph/tests/centrality/test_betweenness_centrality.py | 2 +- .../cugraph/tests/centrality/test_eigenvector_centrality.py | 4 ++-- .../cugraph/tests/centrality/test_katz_centrality.py | 2 +- .../cugraph/tests/community/test_k_truss_subgraph.py | 6 +++--- python/cugraph/cugraph/tests/sampling/test_node2vec.py | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py b/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py index ff24024ef0c..7080fea5ca0 100644 --- a/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_betweenness_centrality.py @@ -112,7 +112,7 @@ def calc_betweenness_centrality( edge_attr = None G = graph_file.get_graph( - fetch=True, + download=True, create_using=cugraph.Graph(directed=directed), ignore_weights=not edgevals, ) diff --git a/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py b/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py index 62e996e50ad..006cb89b79c 100644 --- a/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_eigenvector_centrality.py @@ -41,7 +41,7 @@ def topKVertices(eigen, col, k): def calc_eigenvector(graph_file): dataset_path = graph_file.get_path() G = graph_file.get_graph( - fetch=True, create_using=cugraph.Graph(directed=True), ignore_weights=True + download=True, create_using=cugraph.Graph(directed=True), ignore_weights=True ) k_df = cugraph.eigenvector_centrality(G, max_iter=1000) @@ -136,7 +136,7 @@ def test_eigenvector_centrality_multi_column(graph_file): @pytest.mark.parametrize("graph_file", [TOY]) def test_eigenvector_centrality_toy(graph_file): # This test is based off of libcugraph_c and pylibcugraph tests - G = graph_file.get_graph(fetch=True, create_using=cugraph.Graph(directed=True)) + G = graph_file.get_graph(download=True, create_using=cugraph.Graph(directed=True)) tol = 1e-6 max_iter = 200 diff --git a/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py b/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py index e9477dc0aca..3c1371b8eff 100644 --- a/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py +++ b/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py @@ -151,7 +151,7 @@ def test_katz_centrality_multi_column(graph_file): @pytest.mark.parametrize("graph_file", [TOY]) def test_katz_centrality_toy(graph_file): # This test is based off of libcugraph_c and pylibcugraph tests - G = graph_file.get_graph(create_using=cugraph.Graph(directed=True), fetch=True) + G = graph_file.get_graph(create_using=cugraph.Graph(directed=True), download=True) alpha = 0.01 beta = 1.0 tol = 0.000001 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 552702acf46..5fb8d85f840 100644 --- a/python/cugraph/cugraph/tests/community/test_k_truss_subgraph.py +++ b/python/cugraph/cugraph/tests/community/test_k_truss_subgraph.py @@ -83,7 +83,7 @@ def test_unsupported_cuda_version(): k = 5 graph_file = DATASETS_KTRUSS[0][0] - G = graph_file.get_graph(fetch=True) + G = graph_file.get_graph(download=True) if __cuda_version == __unsupported_cuda_version: with pytest.raises(NotImplementedError): cugraph.k_truss(G, k) @@ -100,7 +100,7 @@ def test_unsupported_cuda_version(): def test_ktruss_subgraph_Graph(_, nx_ground_truth): k = 5 - G = polbooks.get_graph(fetch=True, create_using=cugraph.Graph(directed=False)) + G = polbooks.get_graph(download=True, create_using=cugraph.Graph(directed=False)) k_subgraph = cugraph.ktruss_subgraph(G, k) compare_k_truss(k_subgraph, k, nx_ground_truth) @@ -136,7 +136,7 @@ def test_ktruss_subgraph_directed_Graph(): k = 5 edgevals = True G = karate_asymmetric.get_graph( - fetch=True, + download=True, create_using=cugraph.Graph(directed=True), ignore_weights=not edgevals, ) diff --git a/python/cugraph/cugraph/tests/sampling/test_node2vec.py b/python/cugraph/cugraph/tests/sampling/test_node2vec.py index 678d5d76632..b3f4440170a 100644 --- a/python/cugraph/cugraph/tests/sampling/test_node2vec.py +++ b/python/cugraph/cugraph/tests/sampling/test_node2vec.py @@ -76,7 +76,7 @@ def calc_node2vec(G, start_vertices, max_depth, compress_result, p=1.0, q=1.0): @pytest.mark.sg @pytest.mark.parametrize(*_get_param_args("graph_file", [KARATE])) def test_node2vec_invalid(graph_file): - G = graph_file.get_graph(fetch=True, create_using=cugraph.Graph(directed=True)) + G = graph_file.get_graph(download=True, create_using=cugraph.Graph(directed=True)) k = random.randint(1, 10) start_vertices = cudf.Series( random.sample(range(G.number_of_vertices()), k), dtype="int32" @@ -136,7 +136,7 @@ def test_node2vec_invalid(graph_file): @pytest.mark.parametrize(*_get_param_args("graph_file", [LINE])) @pytest.mark.parametrize(*_get_param_args("directed", DIRECTED_GRAPH_OPTIONS)) def test_node2vec_line(graph_file, directed): - G = graph_file.get_graph(fetch=True, create_using=cugraph.Graph(directed=directed)) + G = graph_file.get_graph(download=True, create_using=cugraph.Graph(directed=directed)) max_depth = 3 start_vertices = cudf.Series([0, 3, 6], dtype="int32") df, seeds = calc_node2vec( From a3bb2b3cb3a8adc2dc93d9a6ae0a37de473879df Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Mon, 24 Jul 2023 09:47:24 -0700 Subject: [PATCH 40/57] Cleanup & standardize metadata files --- .../cugraph/datasets/metadata/cyber.yaml | 12 +++++----- .../cugraph/datasets/metadata/dolphins.yaml | 8 +++---- .../datasets/metadata/email-Eu-core.yaml | 4 ++-- .../datasets/metadata/karate-disjoint.yaml | 4 ++-- .../cugraph/datasets/metadata/karate.yaml | 4 ++-- .../datasets/metadata/karate_asymmetric.yaml | 8 +++---- .../datasets/metadata/ktruss_polbooks.yaml | 5 ++--- .../cugraph/datasets/metadata/netscience.yaml | 6 ++--- .../cugraph/datasets/metadata/one_edge.yaml | 22 ------------------- .../cugraph/datasets/metadata/one_vertex.yaml | 22 ------------------- .../cugraph/datasets/metadata/polbooks.yaml | 4 ++-- .../cugraph/datasets/metadata/small_line.yaml | 4 ++-- .../cugraph/datasets/metadata/small_tree.yaml | 4 ++-- .../cugraph/datasets/metadata/toy_graph.yaml | 4 ++-- .../metadata/toy_graph_undirected.yaml | 4 ++-- 15 files changed, 35 insertions(+), 80 deletions(-) delete mode 100644 python/cugraph/cugraph/datasets/metadata/one_edge.yaml delete mode 100644 python/cugraph/cugraph/datasets/metadata/one_vertex.yaml diff --git a/python/cugraph/cugraph/datasets/metadata/cyber.yaml b/python/cugraph/cugraph/datasets/metadata/cyber.yaml index 7d35d858cee..28c0ba28281 100644 --- a/python/cugraph/cugraph/datasets/metadata/cyber.yaml +++ b/python/cugraph/cugraph/datasets/metadata/cyber.yaml @@ -1,8 +1,10 @@ name: cyber file_type: .csv -author: N/A -url: https://data.rapids.ai/cugraph/datasets/cyber.csv -refs: N/A +description: null +author: null +refs: null +delim: "," +header: 0 col_names: - idx - srcip @@ -11,12 +13,10 @@ col_types: - int32 - str - str -delim: "," -header: 0 has_loop: true is_directed: true is_multigraph: false is_symmetric: false number_of_edges: 2546575 number_of_nodes: 706529 -number_of_lines: 2546576 +url: https://data.rapids.ai/cugraph/datasets/cyber.csv diff --git a/python/cugraph/cugraph/datasets/metadata/dolphins.yaml b/python/cugraph/cugraph/datasets/metadata/dolphins.yaml index cbdf843f34c..d57b71eda61 100644 --- a/python/cugraph/cugraph/datasets/metadata/dolphins.yaml +++ b/python/cugraph/cugraph/datasets/metadata/dolphins.yaml @@ -1,11 +1,13 @@ name: dolphins file_type: .csv +description: null author: D. Lusseau -url: https://data.rapids.ai/cugraph/datasets/dolphins.csv refs: D. Lusseau, K. Schneider, O. J. Boisseau, P. Haase, E. Slooten, and S. M. Dawson, The bottlenose dolphin community of Doubtful Sound features a large proportion of long-lasting associations, Behavioral Ecology and Sociobiology 54, 396-405 (2003). +delim: " " +header: None col_names: - src - dst @@ -14,12 +16,10 @@ col_types: - int32 - int32 - float32 -delim: " " -header: None has_loop: false is_directed: true is_multigraph: false is_symmetric: false number_of_edges: 318 number_of_nodes: 62 -number_of_lines: 318 +url: https://data.rapids.ai/cugraph/datasets/dolphins.csv diff --git a/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml b/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml index 4f421405da1..a11691329dc 100644 --- a/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml +++ b/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml @@ -1,7 +1,7 @@ name: email-Eu-core file_type: .csv +description: null author: null -url: https://data.rapids.ai/cugraph/datasets/email-Eu-core.csv refs: null delim: " " header: None @@ -19,4 +19,4 @@ is_multigraph: false is_symmetric: true number_of_edges: 25571 number_of_nodes: 1005 -number_of_lines: 25571 +url: https://data.rapids.ai/cugraph/datasets/email-Eu-core.csv diff --git a/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml b/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml index f20e9fa8d09..bc9229306cd 100644 --- a/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml +++ b/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml @@ -1,7 +1,7 @@ name: karate-disjoint file_type: .csv +description: null author: null -url: https://data.rapids.ai/cugraph/datasets/karate-disjoint.csv refs: null delim: " " header: None @@ -19,4 +19,4 @@ is_multigraph: false is_symmetric: true number_of_edges: 312 number_of_nodes: 68 -number_of_lines: 312 +url: https://data.rapids.ai/cugraph/datasets/karate-disjoint.csv diff --git a/python/cugraph/cugraph/datasets/metadata/karate.yaml b/python/cugraph/cugraph/datasets/metadata/karate.yaml index fadfbd65f45..57b06f7be62 100644 --- a/python/cugraph/cugraph/datasets/metadata/karate.yaml +++ b/python/cugraph/cugraph/datasets/metadata/karate.yaml @@ -1,7 +1,7 @@ name: karate file_type: .csv +description: null author: Zachary W. -url: https://data.rapids.ai/cugraph/datasets/karate.csv refs: W. W. Zachary, An information flow model for conflict and fission in small groups, Journal of Anthropological Research 33, 452-473 (1977). @@ -21,4 +21,4 @@ is_multigraph: false is_symmetric: true number_of_edges: 156 number_of_nodes: 34 -number_of_lines: 156 +url: https://data.rapids.ai/cugraph/datasets/karate.csv diff --git a/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml index bde1478ad83..7c3d2f28d5e 100644 --- a/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml +++ b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml @@ -1,12 +1,12 @@ name: karate-asymmetric file_type: .csv +description: null author: Zachary W. -url: https://data.rapids.ai/cugraph/datasets/karate-asymmetric.csv -delim: " " -header: None refs: W. W. Zachary, An information flow model for conflict and fission in small groups, Journal of Anthropological Research 33, 452-473 (1977). +delim: " " +header: None col_names: - src - dst @@ -21,4 +21,4 @@ is_multigraph: false is_symmetric: false number_of_edges: 78 number_of_nodes: 34 -number_of_lines: 78 +url: https://data.rapids.ai/cugraph/datasets/karate-asymmetric.csv diff --git a/python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml b/python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml index 1e68b708ba3..338840e19fc 100644 --- a/python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml +++ b/python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml @@ -1,7 +1,7 @@ name: ktruss_polbooks file_type: .csv +description: null author: V. Krebs -url: https://data.rapids.ai/cugraph/datasets/ref/ktruss/polbooks.csv refs: null delim: " " header: None @@ -19,5 +19,4 @@ is_multigraph: false is_symmetric: false number_of_edges: 233 number_of_nodes: 58 -number_of_lines: 233 - +url: https://data.rapids.ai/cugraph/datasets/ref/ktruss/polbooks.csv diff --git a/python/cugraph/cugraph/datasets/metadata/netscience.yaml b/python/cugraph/cugraph/datasets/metadata/netscience.yaml index 2e94e30d14f..c29b26a6029 100644 --- a/python/cugraph/cugraph/datasets/metadata/netscience.yaml +++ b/python/cugraph/cugraph/datasets/metadata/netscience.yaml @@ -1,7 +1,7 @@ name: netscience file_type: .csv -author: Newman, Mark EJ -url: https://data.rapids.ai/cugraph/datasets/netscience.csv +description: null +author: Newman, Mark E.J. refs: Finding community structure in networks using the eigenvectors of matrices. delim: " " header: None @@ -19,4 +19,4 @@ is_multigraph: false is_symmetric: true number_of_edges: 5484 number_of_nodes: 1461 -number_of_lines: 5484 +url: https://data.rapids.ai/cugraph/datasets/netscience.csv diff --git a/python/cugraph/cugraph/datasets/metadata/one_edge.yaml b/python/cugraph/cugraph/datasets/metadata/one_edge.yaml deleted file mode 100644 index d230377308a..00000000000 --- a/python/cugraph/cugraph/datasets/metadata/one_edge.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: one_edge -file_type: .csv -author: Ralph Liu -url: null -refs: null -delim: " " -header: None -col_names: - - src - - dst - - wgt -col_types: - - int32 - - int32 - - float32 -has_loop: false -is_directed: false -is_multigraph: false -is_symmetric: false -number_of_edges: 1 -number_of_nodes: 2 -number_of_lines: 0 diff --git a/python/cugraph/cugraph/datasets/metadata/one_vertex.yaml b/python/cugraph/cugraph/datasets/metadata/one_vertex.yaml deleted file mode 100644 index 2c354aa37b8..00000000000 --- a/python/cugraph/cugraph/datasets/metadata/one_vertex.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: one_vertex -file_type: .csv -author: Ralph Liu -url: null -refs: -delim: " " -header: None -col_names: - - src - - dst - - wgt -col_types: - - int32 - - int32 - - float32 -has_loop: false -is_directed: false -is_multigraph: false -is_symmetric: false -number_of_edges: 0 -number_of_nodes: 1 -number_of_lines: 0 diff --git a/python/cugraph/cugraph/datasets/metadata/polbooks.yaml b/python/cugraph/cugraph/datasets/metadata/polbooks.yaml index be547f6ac7b..85e966d1450 100644 --- a/python/cugraph/cugraph/datasets/metadata/polbooks.yaml +++ b/python/cugraph/cugraph/datasets/metadata/polbooks.yaml @@ -1,7 +1,7 @@ name: polbooks file_type: .csv +description: null author: V. Krebs -url: https://data.rapids.ai/cugraph/datasets/polbooks.csv refs: null delim: " " header: None @@ -19,4 +19,4 @@ is_multigraph: null is_symmetric: true number_of_edges: 882 number_of_nodes: 105 -number_of_lines: 882 +url: https://data.rapids.ai/cugraph/datasets/polbooks.csv diff --git a/python/cugraph/cugraph/datasets/metadata/small_line.yaml b/python/cugraph/cugraph/datasets/metadata/small_line.yaml index 1335cead3cd..48398a248a1 100644 --- a/python/cugraph/cugraph/datasets/metadata/small_line.yaml +++ b/python/cugraph/cugraph/datasets/metadata/small_line.yaml @@ -1,7 +1,7 @@ name: small_line file_type: .csv +description: null author: null -url: https://data.rapids.ai/cugraph/datasets/small_line.csv refs: null delim: " " header: None @@ -19,4 +19,4 @@ is_multigraph: false is_symmetric: true number_of_edges: 9 number_of_nodes: 10 -number_of_lines: 8 +url: https://data.rapids.ai/cugraph/datasets/small_line.csv diff --git a/python/cugraph/cugraph/datasets/metadata/small_tree.yaml b/python/cugraph/cugraph/datasets/metadata/small_tree.yaml index 71921c3b335..31c6f3dfa2e 100644 --- a/python/cugraph/cugraph/datasets/metadata/small_tree.yaml +++ b/python/cugraph/cugraph/datasets/metadata/small_tree.yaml @@ -1,7 +1,7 @@ name: small_tree file_type: .csv +description: null author: null -url: https://data.rapids.ai/cugraph/datasets/small_tree.csv refs: null delim: " " header: None @@ -19,4 +19,4 @@ is_multigraph: false is_symmetric: true number_of_edges: 11 number_of_nodes: 9 -number_of_lines: 11 +url: https://data.rapids.ai/cugraph/datasets/small_tree.csv diff --git a/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml b/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml index 9600d25b123..a6e487e1f21 100644 --- a/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml +++ b/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml @@ -1,7 +1,7 @@ name: toy_graph file_type: .csv +description: null author: null -url: https://data.rapids.ai/cugraph/datasets/toy_graph.csv refs: null delim: " " header: None @@ -19,4 +19,4 @@ is_multigraph: false is_symmetric: true number_of_edges: 16 number_of_nodes: 6 -number_of_lines: 16 +url: https://data.rapids.ai/cugraph/datasets/toy_graph.csv diff --git a/python/cugraph/cugraph/datasets/metadata/toy_graph_undirected.yaml b/python/cugraph/cugraph/datasets/metadata/toy_graph_undirected.yaml index 077161c3d69..104dce70852 100644 --- a/python/cugraph/cugraph/datasets/metadata/toy_graph_undirected.yaml +++ b/python/cugraph/cugraph/datasets/metadata/toy_graph_undirected.yaml @@ -1,7 +1,7 @@ name: toy_graph_undirected file_type: .csv +description: null author: null -url: https://data.rapids.ai/cugraph/datasets/toy_graph_undirected.csv refs: null delim: " " header: None @@ -19,4 +19,4 @@ is_multigraph: false is_symmetric: true number_of_edges: 8 number_of_nodes: 6 -number_of_lines: 8 +url: https://data.rapids.ai/cugraph/datasets/toy_graph_undirected.csv From 820dc51879066be134e472f02e264386009915ba Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Mon, 24 Jul 2023 13:29:18 -0700 Subject: [PATCH 41/57] Update metadata fields --- .../cugraph/cugraph/datasets/metadata/cyber.yaml | 10 +++++++--- .../cugraph/datasets/metadata/dolphins.yaml | 2 +- .../cugraph/datasets/metadata/email-Eu-core.yaml | 14 +++++++++++--- .../cugraph/datasets/metadata/karate-disjoint.yaml | 10 +++++++--- .../cugraph/cugraph/datasets/metadata/karate.yaml | 4 +++- .../datasets/metadata/karate_asymmetric.yaml | 9 ++++++--- .../cugraph/datasets/metadata/ktruss_polbooks.yaml | 9 +++++++-- .../cugraph/datasets/metadata/netscience.yaml | 6 ++++-- .../cugraph/datasets/metadata/polbooks.yaml | 10 ++++++---- .../cugraph/datasets/metadata/small_line.yaml | 5 +++-- .../cugraph/datasets/metadata/small_tree.yaml | 5 +++-- .../cugraph/datasets/metadata/toy_graph.yaml | 3 ++- .../datasets/metadata/toy_graph_undirected.yaml | 6 ++++-- .../cugraph/experimental/datasets/__init__.py | 1 - .../tests/community/test_k_truss_subgraph.py | 1 - .../cugraph/tests/sampling/test_node2vec.py | 4 +++- python/cugraph/cugraph/tests/utils/test_dataset.py | 12 ++++++++++++ 17 files changed, 79 insertions(+), 32 deletions(-) diff --git a/python/cugraph/cugraph/datasets/metadata/cyber.yaml b/python/cugraph/cugraph/datasets/metadata/cyber.yaml index 28c0ba28281..881177755cd 100644 --- a/python/cugraph/cugraph/datasets/metadata/cyber.yaml +++ b/python/cugraph/cugraph/datasets/metadata/cyber.yaml @@ -1,8 +1,12 @@ name: cyber file_type: .csv -description: null -author: null -refs: null +description: + IP edge pairs of a cyber data set from the University of New South Wales. +author: Moustafa, Nour, and Jill Slay +refs: + Moustafa, Nour. Designing an online and reliable statistical anomaly detection + framework for dealing with large high-speed network traffic. Diss. University + of New South Wales, Canberra, Australia, 2017. delim: "," header: 0 col_names: diff --git a/python/cugraph/cugraph/datasets/metadata/dolphins.yaml b/python/cugraph/cugraph/datasets/metadata/dolphins.yaml index d57b71eda61..720df77d58a 100644 --- a/python/cugraph/cugraph/datasets/metadata/dolphins.yaml +++ b/python/cugraph/cugraph/datasets/metadata/dolphins.yaml @@ -17,7 +17,7 @@ col_types: - int32 - float32 has_loop: false -is_directed: true +is_directed: false is_multigraph: false is_symmetric: false number_of_edges: 318 diff --git a/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml b/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml index a11691329dc..d87ba781dab 100644 --- a/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml +++ b/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml @@ -1,8 +1,16 @@ name: email-Eu-core file_type: .csv -description: null -author: null -refs: null +description: + The network was generated using email data from a large European research institution. + We have anonymized information about all incoming and outgoing email between members + of the research institution. There is an edge (u, v) in the network if person u + sent person v at least one email. The e-mails only represent communication between + institution members (the core), and the dataset does not contain incoming messages + from or outgoing messages to the rest of the world. +author: Jure Leskovec +refs: + - Hao Yin, Austin R. Benson, Jure Leskovec, and David F. Gleich. 'Local Higher-order Graph Clustering.' In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. 2017. + - J. Leskovec, J. Kleinberg and C. Faloutsos. Graph Evolution. Densification and Shrinking Diameters. ACM Transactions on Knowledge Discovery from Data (ACM TKDD), 1(1), 2007. delim: " " header: None col_names: diff --git a/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml b/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml index bc9229306cd..947d9a6e67c 100644 --- a/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml +++ b/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml @@ -1,8 +1,12 @@ name: karate-disjoint file_type: .csv -description: null -author: null -refs: null +description: + The graph "karate" contains the network of friendships between the 34 members + of a karate club at a US university, as described by Wayne Zachary in 1977. +author: Zachary W. +refs: + W. W. Zachary, An information flow model for conflict and fission in small groups, + Journal of Anthropological Research 33, 452-473 (1977). delim: " " header: None col_names: diff --git a/python/cugraph/cugraph/datasets/metadata/karate.yaml b/python/cugraph/cugraph/datasets/metadata/karate.yaml index 57b06f7be62..ce8f1543ed7 100644 --- a/python/cugraph/cugraph/datasets/metadata/karate.yaml +++ b/python/cugraph/cugraph/datasets/metadata/karate.yaml @@ -1,6 +1,8 @@ name: karate file_type: .csv -description: null +description: + The graph "karate" contains the network of friendships between the 34 members + of a karate club at a US university, as described by Wayne Zachary in 1977. author: Zachary W. refs: W. W. Zachary, An information flow model for conflict and fission in small groups, diff --git a/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml index 7c3d2f28d5e..ce8c72635f3 100644 --- a/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml +++ b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml @@ -1,10 +1,13 @@ name: karate-asymmetric file_type: .csv -description: null +description: + This is the asymmetric variant of the Karate dataset. The graph "karate" + contains the network of friendships between the 34 members of a karate + club at a US university, as described by Wayne Zachary in 1977. author: Zachary W. refs: - W. W. Zachary, An information flow model for conflict and fission in small groups, - Journal of Anthropological Research 33, 452-473 (1977). + W. W. Zachary, An information flow model for conflict and fission in small + groups, Journal of Anthropological Research 33, 452-473 (1977). delim: " " header: None col_names: diff --git a/python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml b/python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml index 338840e19fc..6a09be3b43b 100644 --- a/python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml +++ b/python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml @@ -1,8 +1,13 @@ name: ktruss_polbooks file_type: .csv -description: null +description: + A network of books about U.S. politics published close to the 2004 U.S. + presidential election, and sold by Amazon.com. Edges between books represent + frequent copurchasing of those books by the same buyers. author: V. Krebs -refs: null +refs: + V. Krebs, "The political books network", unpublished, + https://doi.org/10.2307/40124305 [@sci-hub] delim: " " header: None col_names: diff --git a/python/cugraph/cugraph/datasets/metadata/netscience.yaml b/python/cugraph/cugraph/datasets/metadata/netscience.yaml index c29b26a6029..6c31899d8e7 100644 --- a/python/cugraph/cugraph/datasets/metadata/netscience.yaml +++ b/python/cugraph/cugraph/datasets/metadata/netscience.yaml @@ -1,6 +1,8 @@ name: netscience file_type: .csv -description: null +description: + The graph netscience contains a coauthorship network of scientists working + on network theory and experiment, as compiled by M. Newman in May 2006. author: Newman, Mark E.J. refs: Finding community structure in networks using the eigenvectors of matrices. delim: " " @@ -18,5 +20,5 @@ is_directed: true is_multigraph: false is_symmetric: true number_of_edges: 5484 -number_of_nodes: 1461 +number_of_nodes: 1589 url: https://data.rapids.ai/cugraph/datasets/netscience.csv diff --git a/python/cugraph/cugraph/datasets/metadata/polbooks.yaml b/python/cugraph/cugraph/datasets/metadata/polbooks.yaml index 85e966d1450..623558fc9de 100644 --- a/python/cugraph/cugraph/datasets/metadata/polbooks.yaml +++ b/python/cugraph/cugraph/datasets/metadata/polbooks.yaml @@ -1,8 +1,10 @@ name: polbooks file_type: .csv -description: null +description: + A network of books about U.S. politics published close to the 2004 U.S. presidential election, and sold by Amazon.com. Edges between books represent frequent copurchasing of those books by the same buyers. author: V. Krebs -refs: null +refs: + V. Krebs, "The political books network", unpublished, https://doi.org/10.2307/40124305 [@sci-hub] delim: " " header: None col_names: @@ -14,8 +16,8 @@ col_types: - int32 - float32 is_directed: true -has_loop: null -is_multigraph: null +has_loop: false +is_multigraph: false is_symmetric: true number_of_edges: 882 number_of_nodes: 105 diff --git a/python/cugraph/cugraph/datasets/metadata/small_line.yaml b/python/cugraph/cugraph/datasets/metadata/small_line.yaml index 48398a248a1..e5c8484a049 100644 --- a/python/cugraph/cugraph/datasets/metadata/small_line.yaml +++ b/python/cugraph/cugraph/datasets/metadata/small_line.yaml @@ -1,7 +1,8 @@ name: small_line file_type: .csv -description: null -author: null +description: + The `small_line` dataset was created by Nvidia for testing and demonstration purposes. +author: Nvidia refs: null delim: " " header: None diff --git a/python/cugraph/cugraph/datasets/metadata/small_tree.yaml b/python/cugraph/cugraph/datasets/metadata/small_tree.yaml index 31c6f3dfa2e..37baed448a1 100644 --- a/python/cugraph/cugraph/datasets/metadata/small_tree.yaml +++ b/python/cugraph/cugraph/datasets/metadata/small_tree.yaml @@ -1,7 +1,8 @@ name: small_tree file_type: .csv -description: null -author: null +description: + The `small_tree` dataset was created by Nvidia for testing/demonstration purposes. +author: Nvidia refs: null delim: " " header: None diff --git a/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml b/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml index a6e487e1f21..89946fb281f 100644 --- a/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml +++ b/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml @@ -1,6 +1,7 @@ name: toy_graph file_type: .csv -description: null +description: + The `toy_graph` dataset was created by Nvidia for testing and demonstration purposes. author: null refs: null delim: " " diff --git a/python/cugraph/cugraph/datasets/metadata/toy_graph_undirected.yaml b/python/cugraph/cugraph/datasets/metadata/toy_graph_undirected.yaml index 104dce70852..19cd57518d0 100644 --- a/python/cugraph/cugraph/datasets/metadata/toy_graph_undirected.yaml +++ b/python/cugraph/cugraph/datasets/metadata/toy_graph_undirected.yaml @@ -1,7 +1,9 @@ name: toy_graph_undirected file_type: .csv -description: null -author: null +description: + The `toy_graph_undirected` dataset was created by Nvidia for testing and + demonstration purposes. +author: Nvidia refs: null delim: " " header: None diff --git a/python/cugraph/cugraph/experimental/datasets/__init__.py b/python/cugraph/cugraph/experimental/datasets/__init__.py index a47061e5da9..18220243df1 100644 --- a/python/cugraph/cugraph/experimental/datasets/__init__.py +++ b/python/cugraph/cugraph/experimental/datasets/__init__.py @@ -25,7 +25,6 @@ from cugraph.utilities.api_tools import promoted_experimental_warning_wrapper -# wrap the Dataset class in the promoted_wrapper Dataset = promoted_experimental_warning_wrapper(Dataset) load_all = promoted_experimental_warning_wrapper(load_all) set_download_dir = promoted_experimental_warning_wrapper(set_download_dir) 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 5fb8d85f840..e5646261786 100644 --- a/python/cugraph/cugraph/tests/community/test_k_truss_subgraph.py +++ b/python/cugraph/cugraph/tests/community/test_k_truss_subgraph.py @@ -106,7 +106,6 @@ def test_ktruss_subgraph_Graph(_, nx_ground_truth): compare_k_truss(k_subgraph, k, nx_ground_truth) -# FIXME: currently failing due to a FileNotFound error from cugraph build @pytest.mark.sg @pytest.mark.skipif( (__cuda_version == __unsupported_cuda_version), diff --git a/python/cugraph/cugraph/tests/sampling/test_node2vec.py b/python/cugraph/cugraph/tests/sampling/test_node2vec.py index b3f4440170a..0bfdd460cae 100644 --- a/python/cugraph/cugraph/tests/sampling/test_node2vec.py +++ b/python/cugraph/cugraph/tests/sampling/test_node2vec.py @@ -136,7 +136,9 @@ def test_node2vec_invalid(graph_file): @pytest.mark.parametrize(*_get_param_args("graph_file", [LINE])) @pytest.mark.parametrize(*_get_param_args("directed", DIRECTED_GRAPH_OPTIONS)) def test_node2vec_line(graph_file, directed): - G = graph_file.get_graph(download=True, create_using=cugraph.Graph(directed=directed)) + G = graph_file.get_graph( + download=True, create_using=cugraph.Graph(directed=directed) + ) max_depth = 3 start_vertices = cudf.Series([0, 3, 6], dtype="int32") df, seeds = calc_node2vec( diff --git a/python/cugraph/cugraph/tests/utils/test_dataset.py b/python/cugraph/cugraph/tests/utils/test_dataset.py index 26aea76c82d..310faf9cc29 100644 --- a/python/cugraph/cugraph/tests/utils/test_dataset.py +++ b/python/cugraph/cugraph/tests/utils/test_dataset.py @@ -287,6 +287,18 @@ def test_is_directed(dataset): assert G.is_directed() == dataset.metadata["is_directed"] +@pytest.mark.parametrize("dataset", ALL_DATASETS) +def test_has_loop(dataset): + G = dataset.get_graph(download=True) + # check if it has a loop + +@pytest.mark.parametrize("dataset", ALL_DATASETS) +def test_is_multigraph(dataset): + dataset_is_multigraph = dataset.metadata["is_multigraph"] + G = dataset.get_graph(download=True) + + assert G.is_multigraph() == dataset_is_multigraph + # # Test experimental for DeprecationWarnings # From ccbae169fc8cf2c7c15b775e1eac958a0abf56c6 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Mon, 24 Jul 2023 13:51:55 -0700 Subject: [PATCH 42/57] Style fix. test_dataset.py WIP --- .../cugraph/cugraph/tests/utils/test_dataset.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/python/cugraph/cugraph/tests/utils/test_dataset.py b/python/cugraph/cugraph/tests/utils/test_dataset.py index d6674e0680a..33d16527f09 100644 --- a/python/cugraph/cugraph/tests/utils/test_dataset.py +++ b/python/cugraph/cugraph/tests/utils/test_dataset.py @@ -287,10 +287,17 @@ def test_is_directed(dataset): assert G.is_directed() == dataset.metadata["is_directed"] -@pytest.mark.parametrize("dataset", ALL_DATASETS) -def test_has_loop(dataset): - G = dataset.get_graph(download=True) - # check if it has a loop +# TODO: test for loop +# @pytest.mark.parametrize("dataset", ALL_DATASETS) +# def test_has_loop(dataset): +# G = dataset.get_graph(download=True) +# check if it has a loop + +# TODO: test is symmetric +# @pytest.mark.parametrize("dataset", ALL_DATASETS) +# def test_is_symmetric(dataset): +# G = dataset.get_graph(download=True) + @pytest.mark.parametrize("dataset", ALL_DATASETS) def test_is_multigraph(dataset): @@ -299,6 +306,7 @@ def test_is_multigraph(dataset): assert G.is_multigraph() == dataset_is_multigraph + # # Test experimental for DeprecationWarnings # From 3073ec072963e1f07524fbba87375b72f9ce6221 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Tue, 25 Jul 2023 06:03:50 -0700 Subject: [PATCH 43/57] Update yaml --- python/cugraph/cugraph/datasets/metadata/dolphins.yaml | 2 +- python/cugraph/cugraph/datasets/metadata/netscience.yaml | 2 +- python/cugraph/cugraph/tests/utils/test_dataset.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/cugraph/cugraph/datasets/metadata/dolphins.yaml b/python/cugraph/cugraph/datasets/metadata/dolphins.yaml index 720df77d58a..79f4563c85c 100644 --- a/python/cugraph/cugraph/datasets/metadata/dolphins.yaml +++ b/python/cugraph/cugraph/datasets/metadata/dolphins.yaml @@ -20,6 +20,6 @@ has_loop: false is_directed: false is_multigraph: false is_symmetric: false -number_of_edges: 318 +number_of_edges: 159 number_of_nodes: 62 url: https://data.rapids.ai/cugraph/datasets/dolphins.csv diff --git a/python/cugraph/cugraph/datasets/metadata/netscience.yaml b/python/cugraph/cugraph/datasets/metadata/netscience.yaml index 6c31899d8e7..4233da4bc7d 100644 --- a/python/cugraph/cugraph/datasets/metadata/netscience.yaml +++ b/python/cugraph/cugraph/datasets/metadata/netscience.yaml @@ -20,5 +20,5 @@ is_directed: true is_multigraph: false is_symmetric: true number_of_edges: 5484 -number_of_nodes: 1589 +number_of_nodes: 1461 url: https://data.rapids.ai/cugraph/datasets/netscience.csv diff --git a/python/cugraph/cugraph/tests/utils/test_dataset.py b/python/cugraph/cugraph/tests/utils/test_dataset.py index 33d16527f09..7b64d8c5dab 100644 --- a/python/cugraph/cugraph/tests/utils/test_dataset.py +++ b/python/cugraph/cugraph/tests/utils/test_dataset.py @@ -320,7 +320,7 @@ def test_experimental_dataset_import(setup_deprecation_warning_tests): def test_experimental_method_warnings(setup_deprecation_warning_tests): from cugraph.experimental.datasets import ( - download_all, + load_all, set_download_dir, get_download_dir, ) @@ -331,6 +331,6 @@ def test_experimental_method_warnings(setup_deprecation_warning_tests): with pytest.deprecated_call(): set_download_dir(tmpd.name) get_download_dir() - download_all() + load_all() tmpd.cleanup() From df9b19c18650cf68928a4dd160c002d3cb87fbdb Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Tue, 25 Jul 2023 06:30:35 -0700 Subject: [PATCH 44/57] Fix experimental packages' docstrings 'fetch' -> 'download' --- .../cugraph/cugraph/experimental/link_prediction/jaccard.py | 6 +++--- .../cugraph/cugraph/experimental/link_prediction/overlap.py | 4 ++-- .../cugraph/experimental/link_prediction/sorensen.py | 4 ++-- python/cugraph/cugraph/traversal/bfs.py | 4 ++-- python/cugraph/cugraph/traversal/sssp.py | 2 +- python/cugraph/cugraph/tree/minimum_spanning_tree.py | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/python/cugraph/cugraph/experimental/link_prediction/jaccard.py b/python/cugraph/cugraph/experimental/link_prediction/jaccard.py index 81aa871c59d..2eba73b3824 100644 --- a/python/cugraph/cugraph/experimental/link_prediction/jaccard.py +++ b/python/cugraph/cugraph/experimental/link_prediction/jaccard.py @@ -81,7 +81,7 @@ def EXPERIMENTAL__jaccard(G, vertex_pair=None, use_weight=False): solution by doing the following: >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True, ignore_weights=True) + >>> G = karate.get_graph(download=True, ignore_weights=True) >>> pairs = G.get_two_hop_neighbors() >>> df = cugraph.jaccard(G, pairs) @@ -132,7 +132,7 @@ def EXPERIMENTAL__jaccard(G, vertex_pair=None, use_weight=False): -------- >>> from cugraph.datasets import karate >>> from cugraph.experimental import jaccard as exp_jaccard - >>> G = karate.get_graph(fetch=True, ignore_weights=True) + >>> G = karate.get_graph(download=True, ignore_weights=True) >>> df = exp_jaccard(G) """ @@ -232,7 +232,7 @@ def EXPERIMENTAL__jaccard_coefficient(G, ebunch=None, use_weight=False): -------- >>> from cugraph.datasets import karate >>> from cugraph.experimental import jaccard_coefficient as exp_jaccard_coefficient - >>> G = karate.get_graph(fetch=True, ignore_weights=True) + >>> G = karate.get_graph(download=True, ignore_weights=True) >>> df = exp_jaccard_coefficient(G) """ diff --git a/python/cugraph/cugraph/experimental/link_prediction/overlap.py b/python/cugraph/cugraph/experimental/link_prediction/overlap.py index 61f6e488a56..0981ced4835 100644 --- a/python/cugraph/cugraph/experimental/link_prediction/overlap.py +++ b/python/cugraph/cugraph/experimental/link_prediction/overlap.py @@ -88,7 +88,7 @@ def EXPERIMENTAL__overlap_coefficient(G, ebunch=None, use_weight=False): -------- >>> from cugraph.datasets import karate >>> from cugraph.experimental import overlap_coefficient as exp_overlap_coefficient - >>> G = karate.get_graph(fetch=True, ignore_weights=True) + >>> G = karate.get_graph(download=True, ignore_weights=True) >>> df = exp_overlap_coefficient(G) """ vertex_pair = None @@ -166,7 +166,7 @@ def EXPERIMENTAL__overlap(G, vertex_pair=None, use_weight=False): -------- >>> from cugraph.datasets import karate >>> from cugraph.experimental import overlap as exp_overlap - >>> G = karate.get_graph(fetch=True, ignore_weights=True) + >>> G = karate.get_graph(download=True, ignore_weights=True) >>> df = exp_overlap(G) """ diff --git a/python/cugraph/cugraph/experimental/link_prediction/sorensen.py b/python/cugraph/cugraph/experimental/link_prediction/sorensen.py index 5f72962c4d9..ed27e4813d3 100644 --- a/python/cugraph/cugraph/experimental/link_prediction/sorensen.py +++ b/python/cugraph/cugraph/experimental/link_prediction/sorensen.py @@ -100,7 +100,7 @@ def EXPERIMENTAL__sorensen(G, vertex_pair=None, use_weight=False): -------- >>> from cugraph.datasets import karate >>> from cugraph.experimental import sorensen as exp_sorensen - >>> G = karate.get_graph(fetch=True, ignore_weights=True) + >>> G = karate.get_graph(download=True, ignore_weights=True) >>> df = exp_sorensen(G) """ @@ -198,7 +198,7 @@ def EXPERIMENTAL__sorensen_coefficient(G, ebunch=None, use_weight=False): -------- >>> from cugraph.datasets import karate >>> from cugraph.experimental import sorensen_coefficient as exp_sorensen_coef - >>> G = karate.get_graph(fetch=True, ignore_weights=True) + >>> G = karate.get_graph(download=True, ignore_weights=True) >>> df = exp_sorensen_coef(G) """ diff --git a/python/cugraph/cugraph/traversal/bfs.py b/python/cugraph/cugraph/traversal/bfs.py index 46090f36001..cad96947f8b 100644 --- a/python/cugraph/cugraph/traversal/bfs.py +++ b/python/cugraph/cugraph/traversal/bfs.py @@ -198,7 +198,7 @@ def bfs( Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> df = cugraph.bfs(G, 0) """ @@ -316,7 +316,7 @@ def bfs_edges(G, source, reverse=False, depth_limit=None, sort_neighbors=None): Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> df = cugraph.bfs_edges(G, 0) """ diff --git a/python/cugraph/cugraph/traversal/sssp.py b/python/cugraph/cugraph/traversal/sssp.py index afb0ac912eb..5ab97e60390 100644 --- a/python/cugraph/cugraph/traversal/sssp.py +++ b/python/cugraph/cugraph/traversal/sssp.py @@ -199,7 +199,7 @@ def sssp( Examples -------- >>> from cugraph.datasets import karate - >>> G = karate.get_graph(fetch=True) + >>> G = karate.get_graph(download=True) >>> distances = cugraph.sssp(G, 0) >>> distances distance vertex predecessor diff --git a/python/cugraph/cugraph/tree/minimum_spanning_tree.py b/python/cugraph/cugraph/tree/minimum_spanning_tree.py index 062ad5d8d4b..b297042f199 100644 --- a/python/cugraph/cugraph/tree/minimum_spanning_tree.py +++ b/python/cugraph/cugraph/tree/minimum_spanning_tree.py @@ -92,7 +92,7 @@ def minimum_spanning_tree(G, weight=None, algorithm="boruvka", ignore_nan=False) Examples -------- >>> from cugraph.datasets import netscience - >>> G = netscience.get_graph(fetch=True) + >>> G = netscience.get_graph(download=True) >>> G_mst = cugraph.minimum_spanning_tree(G) """ @@ -135,7 +135,7 @@ def maximum_spanning_tree(G, weight=None, algorithm="boruvka", ignore_nan=False) Examples -------- >>> from cugraph.datasets import netscience - >>> G = netscience.get_graph(fetch=True) + >>> G = netscience.get_graph(download=True) >>> G_mst = cugraph.maximum_spanning_tree(G) """ From 53ddb1626d49e6842b27f6c8ffd1cab90d9bdd99 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Tue, 25 Jul 2023 08:43:44 -0700 Subject: [PATCH 45/57] Notebook algorithm fix --- notebooks/algorithms/structure/Renumber-2.ipynb | 2 +- notebooks/algorithms/structure/Symmetrize.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/notebooks/algorithms/structure/Renumber-2.ipynb b/notebooks/algorithms/structure/Renumber-2.ipynb index 666972b5571..479df53c6be 100755 --- a/notebooks/algorithms/structure/Renumber-2.ipynb +++ b/notebooks/algorithms/structure/Renumber-2.ipynb @@ -82,7 +82,7 @@ "source": [ "# Import a built-in dataset\n", "from cugraph.datasets import cyber\n", - "gdf = cyber.get_edgelist(fetch=True)" + "gdf = cyber.get_edgelist(download=True)" ] }, { diff --git a/notebooks/algorithms/structure/Symmetrize.ipynb b/notebooks/algorithms/structure/Symmetrize.ipynb index 0a9f962b98e..5d5b270708a 100755 --- a/notebooks/algorithms/structure/Symmetrize.ipynb +++ b/notebooks/algorithms/structure/Symmetrize.ipynb @@ -83,7 +83,7 @@ "from cugraph.datasets import karate\n", "\n", "# This is the symmetrized dataset\n", - "test_gdf = karate.get_edgelist(fetch=True)" + "test_gdf = karate.get_edgelist(download=True)" ] }, { From 027de9a110916d08d4bc49f46283596faee7d68f Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Tue, 25 Jul 2023 09:24:40 -0700 Subject: [PATCH 46/57] Add unit test to verify self-loops --- .../cugraph/datasets/metadata/cyber.yaml | 2 +- .../datasets/metadata/email-Eu-core.yaml | 2 +- .../cugraph/datasets/metadata/karate.yaml | 2 +- .../datasets/metadata/karate_asymmetric.yaml | 2 +- .../cugraph/datasets/metadata/polbooks.yaml | 2 +- .../cugraph/tests/utils/test_dataset.py | 23 +++++++++++++++---- 6 files changed, 23 insertions(+), 10 deletions(-) diff --git a/python/cugraph/cugraph/datasets/metadata/cyber.yaml b/python/cugraph/cugraph/datasets/metadata/cyber.yaml index 881177755cd..09bf26541c7 100644 --- a/python/cugraph/cugraph/datasets/metadata/cyber.yaml +++ b/python/cugraph/cugraph/datasets/metadata/cyber.yaml @@ -17,7 +17,7 @@ col_types: - int32 - str - str -has_loop: true +has_loop: false is_directed: true is_multigraph: false is_symmetric: false diff --git a/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml b/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml index d87ba781dab..eb2caa96bf8 100644 --- a/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml +++ b/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml @@ -21,7 +21,7 @@ col_types: - int32 - int32 - float32 -has_loop: false +has_loop: true is_directed: true is_multigraph: false is_symmetric: true diff --git a/python/cugraph/cugraph/datasets/metadata/karate.yaml b/python/cugraph/cugraph/datasets/metadata/karate.yaml index ce8f1543ed7..d10ecb242f5 100644 --- a/python/cugraph/cugraph/datasets/metadata/karate.yaml +++ b/python/cugraph/cugraph/datasets/metadata/karate.yaml @@ -17,7 +17,7 @@ col_types: - int32 - int32 - float32 -has_loop: true +has_loop: false is_directed: true is_multigraph: false is_symmetric: true diff --git a/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml index ce8c72635f3..d408734a485 100644 --- a/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml +++ b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml @@ -18,7 +18,7 @@ col_types: - int32 - int32 - float32 -has_loop: true +has_loop: false is_directed: false is_multigraph: false is_symmetric: false diff --git a/python/cugraph/cugraph/datasets/metadata/polbooks.yaml b/python/cugraph/cugraph/datasets/metadata/polbooks.yaml index 623558fc9de..fbeb529ef8a 100644 --- a/python/cugraph/cugraph/datasets/metadata/polbooks.yaml +++ b/python/cugraph/cugraph/datasets/metadata/polbooks.yaml @@ -15,8 +15,8 @@ col_types: - int32 - int32 - float32 -is_directed: true has_loop: false +is_directed: true is_multigraph: false is_symmetric: true number_of_edges: 882 diff --git a/python/cugraph/cugraph/tests/utils/test_dataset.py b/python/cugraph/cugraph/tests/utils/test_dataset.py index 7b64d8c5dab..48d540b4adf 100644 --- a/python/cugraph/cugraph/tests/utils/test_dataset.py +++ b/python/cugraph/cugraph/tests/utils/test_dataset.py @@ -89,6 +89,17 @@ def setup_deprecation_warning_tests(): yield +############################################################################### +# Helper + +# check if there is a row where src == dst +def has_loop(df): + df.rename(columns={df.columns[0]: "src", df.columns[1]: "dst"}, inplace=True) + res = df.where(df["src"] == df["dst"]) + + return res.notnull().values.any() + + ############################################################################### # Tests @@ -287,11 +298,13 @@ def test_is_directed(dataset): assert G.is_directed() == dataset.metadata["is_directed"] -# TODO: test for loop -# @pytest.mark.parametrize("dataset", ALL_DATASETS) -# def test_has_loop(dataset): -# G = dataset.get_graph(download=True) -# check if it has a loop +@pytest.mark.parametrize("dataset", ALL_DATASETS) +def test_has_loop(dataset): + df = dataset.get_edgelist(download=True) + metadata_has_loop = dataset.metadata["has_loop"] + + assert has_loop(df) == metadata_has_loop + # TODO: test is symmetric # @pytest.mark.parametrize("dataset", ALL_DATASETS) From 4cfca0724184a95dcb8a10f818e27aa1e6f16df0 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Tue, 25 Jul 2023 14:05:42 -0700 Subject: [PATCH 47/57] Update notebooks: 'fetch' -> 'download' --- notebooks/algorithms/centrality/Betweenness.ipynb | 2 +- notebooks/algorithms/centrality/Centrality.ipynb | 2 +- notebooks/algorithms/centrality/Eigenvector.ipynb | 2 +- notebooks/algorithms/centrality/Katz.ipynb | 2 +- notebooks/algorithms/community/ECG.ipynb | 2 +- notebooks/algorithms/community/Louvain.ipynb | 2 +- notebooks/algorithms/community/Spectral-Clustering.ipynb | 2 +- notebooks/algorithms/community/Subgraph-Extraction.ipynb | 2 +- notebooks/algorithms/community/ktruss.ipynb | 2 +- notebooks/algorithms/components/ConnectedComponents.ipynb | 2 +- notebooks/algorithms/cores/core-number.ipynb | 2 +- notebooks/algorithms/cores/kcore.ipynb | 2 +- notebooks/algorithms/layout/Force-Atlas2.ipynb | 2 +- notebooks/algorithms/link_analysis/HITS.ipynb | 2 +- notebooks/algorithms/link_analysis/Pagerank.ipynb | 2 +- notebooks/algorithms/link_prediction/Jaccard-Similarity.ipynb | 2 +- notebooks/algorithms/link_prediction/Overlap-Similarity.ipynb | 2 +- notebooks/algorithms/link_prediction/Sorensen_coefficient.ipynb | 2 +- notebooks/algorithms/sampling/RandomWalk.ipynb | 2 +- notebooks/algorithms/traversal/BFS.ipynb | 2 +- notebooks/algorithms/traversal/SSSP.ipynb | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/notebooks/algorithms/centrality/Betweenness.ipynb b/notebooks/algorithms/centrality/Betweenness.ipynb index f9dabd4b139..29ad37ec254 100644 --- a/notebooks/algorithms/centrality/Betweenness.ipynb +++ b/notebooks/algorithms/centrality/Betweenness.ipynb @@ -151,7 +151,7 @@ "outputs": [], "source": [ "# Create a graph using the imported Dataset object\n", - "G = karate.get_graph(fetch=True)" + "G = karate.get_graph(download=True)" ] }, { diff --git a/notebooks/algorithms/centrality/Centrality.ipynb b/notebooks/algorithms/centrality/Centrality.ipynb index 306d6f40c31..d19dd646b15 100644 --- a/notebooks/algorithms/centrality/Centrality.ipynb +++ b/notebooks/algorithms/centrality/Centrality.ipynb @@ -225,7 +225,7 @@ "outputs": [], "source": [ "# Create a graph using the imported Dataset object\n", - "G = karate.get_graph(fetch=True)" + "G = karate.get_graph(download=True)" ] }, { diff --git a/notebooks/algorithms/centrality/Eigenvector.ipynb b/notebooks/algorithms/centrality/Eigenvector.ipynb index f126f2b1de5..2d06aa39708 100644 --- a/notebooks/algorithms/centrality/Eigenvector.ipynb +++ b/notebooks/algorithms/centrality/Eigenvector.ipynb @@ -194,7 +194,7 @@ "metadata": {}, "outputs": [], "source": [ - "karate.get_edgelist(fetch=True)" + "karate.get_edgelist(download=True)" ] }, { diff --git a/notebooks/algorithms/centrality/Katz.ipynb b/notebooks/algorithms/centrality/Katz.ipynb index f626e86964b..c94a14bb14a 100755 --- a/notebooks/algorithms/centrality/Katz.ipynb +++ b/notebooks/algorithms/centrality/Katz.ipynb @@ -166,7 +166,7 @@ "outputs": [], "source": [ "# Create a graph using the imported Dataset object\n", - "G = karate.get_graph(fetch=True)" + "G = karate.get_graph(download=True)" ] }, { diff --git a/notebooks/algorithms/community/ECG.ipynb b/notebooks/algorithms/community/ECG.ipynb index b1a26f78322..c6c5a7b1b03 100644 --- a/notebooks/algorithms/community/ECG.ipynb +++ b/notebooks/algorithms/community/ECG.ipynb @@ -128,7 +128,7 @@ "outputs": [], "source": [ "# You can also just get the edgelist\n", - "gdf = karate.get_edgelist(fetch=True)\n", + "gdf = karate.get_edgelist(download=True)\n", "\n", "# The algorithm also requires that there are vertex weights. Just use 1.0 \n", "gdf[\"data\"] = 1.0" diff --git a/notebooks/algorithms/community/Louvain.ipynb b/notebooks/algorithms/community/Louvain.ipynb index d57ce7685bd..a6a8cc363df 100755 --- a/notebooks/algorithms/community/Louvain.ipynb +++ b/notebooks/algorithms/community/Louvain.ipynb @@ -167,7 +167,7 @@ "outputs": [], "source": [ "# You can also just get the edgelist\n", - "gdf = karate.get_edgelist(fetch=True)\n", + "gdf = karate.get_edgelist(download=True)\n", "\n", "# The algorithm also requires that there are vertex weights. Just use 1.0 \n", "gdf[\"data\"] = 1.0" diff --git a/notebooks/algorithms/community/Spectral-Clustering.ipynb b/notebooks/algorithms/community/Spectral-Clustering.ipynb index 4db946b43ae..fa6f0e954c0 100755 --- a/notebooks/algorithms/community/Spectral-Clustering.ipynb +++ b/notebooks/algorithms/community/Spectral-Clustering.ipynb @@ -175,7 +175,7 @@ "metadata": {}, "outputs": [], "source": [ - "gdf = karate.get_edgelist(fetch=True)\n", + "gdf = karate.get_edgelist(download=True)\n", "\n", "# The algorithm requires that there are edge weights. In this case all the weights are being set to 1\n", "gdf[\"data\"] = cudf.Series(np.ones(len(gdf), dtype=np.float32))" diff --git a/notebooks/algorithms/community/Subgraph-Extraction.ipynb b/notebooks/algorithms/community/Subgraph-Extraction.ipynb index 499e833a326..8d94eddf878 100755 --- a/notebooks/algorithms/community/Subgraph-Extraction.ipynb +++ b/notebooks/algorithms/community/Subgraph-Extraction.ipynb @@ -116,7 +116,7 @@ "outputs": [], "source": [ "# You can also just get the edgelist\n", - "gdf = karate.get_edgelist(fetch=True)\n", + "gdf = karate.get_edgelist(download=True)\n", "\n", "# The louvain algorithm requires that there are vertex weights. Just use 1.0 \n", "gdf[\"data\"] = 1.0\n", diff --git a/notebooks/algorithms/community/ktruss.ipynb b/notebooks/algorithms/community/ktruss.ipynb index e163576e55e..cb838e304c3 100644 --- a/notebooks/algorithms/community/ktruss.ipynb +++ b/notebooks/algorithms/community/ktruss.ipynb @@ -124,7 +124,7 @@ "outputs": [], "source": [ "# Create a graph using the imported Dataset object\n", - "G = karate.get_graph(fetch=True)\n", + "G = karate.get_graph(download=True)\n", "G = G.to_undirected()" ] }, diff --git a/notebooks/algorithms/components/ConnectedComponents.ipynb b/notebooks/algorithms/components/ConnectedComponents.ipynb index b11dcc523e4..c41a004e704 100755 --- a/notebooks/algorithms/components/ConnectedComponents.ipynb +++ b/notebooks/algorithms/components/ConnectedComponents.ipynb @@ -163,7 +163,7 @@ "metadata": {}, "outputs": [], "source": [ - "G = netscience.get_graph(fetch=True)" + "G = netscience.get_graph(download=True)" ] }, { diff --git a/notebooks/algorithms/cores/core-number.ipynb b/notebooks/algorithms/cores/core-number.ipynb index c1fbab61803..cbb3e64311a 100755 --- a/notebooks/algorithms/cores/core-number.ipynb +++ b/notebooks/algorithms/cores/core-number.ipynb @@ -103,7 +103,7 @@ "metadata": {}, "outputs": [], "source": [ - "G = karate.get_graph(fetch=True)\n", + "G = karate.get_graph(download=True)\n", "G = G.to_undirected()" ] }, diff --git a/notebooks/algorithms/cores/kcore.ipynb b/notebooks/algorithms/cores/kcore.ipynb index a2ecb110f6b..ebb9cbe9c50 100755 --- a/notebooks/algorithms/cores/kcore.ipynb +++ b/notebooks/algorithms/cores/kcore.ipynb @@ -103,7 +103,7 @@ "metadata": {}, "outputs": [], "source": [ - "G = karate.get_graph(fetch=True)\n", + "G = karate.get_graph(download=True)\n", "G = G.to_undirected()" ] }, diff --git a/notebooks/algorithms/layout/Force-Atlas2.ipynb b/notebooks/algorithms/layout/Force-Atlas2.ipynb index 77cf860cd36..f457d3f38fc 100644 --- a/notebooks/algorithms/layout/Force-Atlas2.ipynb +++ b/notebooks/algorithms/layout/Force-Atlas2.ipynb @@ -115,7 +115,7 @@ "metadata": {}, "outputs": [], "source": [ - "G = netscience.get_graph(fetch=True)\n", + "G = netscience.get_graph(download=True)\n", "G.number_of_nodes(), G.number_of_edges()" ] }, diff --git a/notebooks/algorithms/link_analysis/HITS.ipynb b/notebooks/algorithms/link_analysis/HITS.ipynb index 0c0be19a7b5..7e4673ae2a9 100755 --- a/notebooks/algorithms/link_analysis/HITS.ipynb +++ b/notebooks/algorithms/link_analysis/HITS.ipynb @@ -218,7 +218,7 @@ "metadata": {}, "outputs": [], "source": [ - "G = karate.get_graph(fetch=True)" + "G = karate.get_graph(download=True)" ] }, { diff --git a/notebooks/algorithms/link_analysis/Pagerank.ipynb b/notebooks/algorithms/link_analysis/Pagerank.ipynb index 5d1bf9e773b..0e7d5b134a7 100755 --- a/notebooks/algorithms/link_analysis/Pagerank.ipynb +++ b/notebooks/algorithms/link_analysis/Pagerank.ipynb @@ -204,7 +204,7 @@ "metadata": {}, "outputs": [], "source": [ - "G = karate.get_graph(fetch=True)" + "G = karate.get_graph(download=True)" ] }, { diff --git a/notebooks/algorithms/link_prediction/Jaccard-Similarity.ipynb b/notebooks/algorithms/link_prediction/Jaccard-Similarity.ipynb index 6c20ca30e88..1e6cd032650 100755 --- a/notebooks/algorithms/link_prediction/Jaccard-Similarity.ipynb +++ b/notebooks/algorithms/link_prediction/Jaccard-Similarity.ipynb @@ -240,7 +240,7 @@ "source": [ "# Test file \n", "from cugraph.datasets import karate\n", - "gdf = karate.get_edgelist(fetch=True)" + "gdf = karate.get_edgelist(download=True)" ] }, { diff --git a/notebooks/algorithms/link_prediction/Overlap-Similarity.ipynb b/notebooks/algorithms/link_prediction/Overlap-Similarity.ipynb index 7216628f1ae..97f3874681b 100755 --- a/notebooks/algorithms/link_prediction/Overlap-Similarity.ipynb +++ b/notebooks/algorithms/link_prediction/Overlap-Similarity.ipynb @@ -261,7 +261,7 @@ "outputs": [], "source": [ "from cugraph.datasets import karate\n", - "gdf = karate.get_edgelist(fetch=True)" + "gdf = karate.get_edgelist(download=True)" ] }, { diff --git a/notebooks/algorithms/link_prediction/Sorensen_coefficient.ipynb b/notebooks/algorithms/link_prediction/Sorensen_coefficient.ipynb index 75cb54dced6..6fa83694c7d 100755 --- a/notebooks/algorithms/link_prediction/Sorensen_coefficient.ipynb +++ b/notebooks/algorithms/link_prediction/Sorensen_coefficient.ipynb @@ -169,7 +169,7 @@ "source": [ "# Test file \n", "from cugraph.experimental.datasets import karate\n", - "gdf = karate.get_edgelist(fetch=True)" + "gdf = karate.get_edgelist(download=True)" ] }, { diff --git a/notebooks/algorithms/sampling/RandomWalk.ipynb b/notebooks/algorithms/sampling/RandomWalk.ipynb index 81d0820c89c..011346a93af 100644 --- a/notebooks/algorithms/sampling/RandomWalk.ipynb +++ b/notebooks/algorithms/sampling/RandomWalk.ipynb @@ -57,7 +57,7 @@ "metadata": {}, "outputs": [], "source": [ - "gdf = karate.get_edgelist(fetch=True)" + "gdf = karate.get_edgelist(download=True)" ] }, { diff --git a/notebooks/algorithms/traversal/BFS.ipynb b/notebooks/algorithms/traversal/BFS.ipynb index 5962d4d28a3..4339ce26a70 100755 --- a/notebooks/algorithms/traversal/BFS.ipynb +++ b/notebooks/algorithms/traversal/BFS.ipynb @@ -105,7 +105,7 @@ "# Import a built-in dataset\n", "from cugraph.datasets import karate\n", "\n", - "gdf = karate.get_edgelist(fetch=True)" + "gdf = karate.get_edgelist(download=True)" ] }, { diff --git a/notebooks/algorithms/traversal/SSSP.ipynb b/notebooks/algorithms/traversal/SSSP.ipynb index eab8ee1d0db..4889ab399e8 100755 --- a/notebooks/algorithms/traversal/SSSP.ipynb +++ b/notebooks/algorithms/traversal/SSSP.ipynb @@ -87,7 +87,7 @@ "# Import a built-in dataset\n", "from cugraph.datasets import karate\n", "\n", - "gdf = karate.get_edgelist(fetch=True)" + "gdf = karate.get_edgelist(download=True)" ] }, { From 336f57c6ef0b4730992750dc9435a8f2ff5238c4 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Tue, 25 Jul 2023 14:06:16 -0700 Subject: [PATCH 48/57] Update naming scheme with all underscores --- python/cugraph/cugraph/datasets/__init__.py | 4 ++-- .../metadata/{email-Eu-core.yaml => email_Eu_core.yaml} | 2 +- .../cugraph/datasets/metadata/karate_asymmetric.yaml | 9 ++++----- .../{karate-disjoint.yaml => karate_disjoint.yaml} | 8 ++++---- 4 files changed, 11 insertions(+), 12 deletions(-) rename python/cugraph/cugraph/datasets/metadata/{email-Eu-core.yaml => email_Eu_core.yaml} (98%) rename python/cugraph/cugraph/datasets/metadata/{karate-disjoint.yaml => karate_disjoint.yaml} (69%) diff --git a/python/cugraph/cugraph/datasets/__init__.py b/python/cugraph/cugraph/datasets/__init__.py index 14c1ae101cb..d749b2a8341 100644 --- a/python/cugraph/cugraph/datasets/__init__.py +++ b/python/cugraph/cugraph/datasets/__init__.py @@ -28,10 +28,10 @@ cyber = Dataset(meta_path / "cyber.yaml") dolphins = Dataset(meta_path / "dolphins.yaml") -email_Eu_core = Dataset(meta_path / "email-Eu-core.yaml") +email_Eu_core = Dataset(meta_path / "email_Eu_core.yaml") karate = Dataset(meta_path / "karate.yaml") karate_asymmetric = Dataset(meta_path / "karate_asymmetric.yaml") -karate_disjoint = Dataset(meta_path / "karate-disjoint.yaml") +karate_disjoint = Dataset(meta_path / "karate_disjoint.yaml") ktruss_polbooks = Dataset(meta_path / "ktruss_polbooks.yaml") netscience = Dataset(meta_path / "netscience.yaml") polbooks = Dataset(meta_path / "polbooks.yaml") diff --git a/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml b/python/cugraph/cugraph/datasets/metadata/email_Eu_core.yaml similarity index 98% rename from python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml rename to python/cugraph/cugraph/datasets/metadata/email_Eu_core.yaml index eb2caa96bf8..002705858ac 100644 --- a/python/cugraph/cugraph/datasets/metadata/email-Eu-core.yaml +++ b/python/cugraph/cugraph/datasets/metadata/email_Eu_core.yaml @@ -1,4 +1,4 @@ -name: email-Eu-core +name: email_Eu_core file_type: .csv description: The network was generated using email data from a large European research institution. diff --git a/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml index d408734a485..54ce3c674e1 100644 --- a/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml +++ b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml @@ -1,10 +1,9 @@ -name: karate-asymmetric +name: karate_asymmetric file_type: .csv description: - This is the asymmetric variant of the Karate dataset. The graph "karate" - contains the network of friendships between the 34 members of a karate - club at a US university, as described by Wayne Zachary in 1977. -author: Zachary W. + This is an undirected and asymmetric variant of the Karate dataset. + The original dataset was created by Wayne Zachary in 1977. +author: Nvidia refs: W. W. Zachary, An information flow model for conflict and fission in small groups, Journal of Anthropological Research 33, 452-473 (1977). diff --git a/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml b/python/cugraph/cugraph/datasets/metadata/karate_disjoint.yaml similarity index 69% rename from python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml rename to python/cugraph/cugraph/datasets/metadata/karate_disjoint.yaml index 947d9a6e67c..66c142e35da 100644 --- a/python/cugraph/cugraph/datasets/metadata/karate-disjoint.yaml +++ b/python/cugraph/cugraph/datasets/metadata/karate_disjoint.yaml @@ -1,9 +1,9 @@ -name: karate-disjoint +name: karate_disjoint file_type: .csv description: - The graph "karate" contains the network of friendships between the 34 members - of a karate club at a US university, as described by Wayne Zachary in 1977. -author: Zachary W. + This is disjoint variant of the Karate dataset. + The original dataset was created by Wayne Zachary in 1977. +author: Nvidia refs: W. W. Zachary, An information flow model for conflict and fission in small groups, Journal of Anthropological Research 33, 452-473 (1977). From b89b36368b707b23fe0003e9d7598220082ea13b Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Tue, 25 Jul 2023 20:54:30 -0700 Subject: [PATCH 49/57] Unable to change 'name' field to adhere to underscore naming convention due to filenames originally having hyphens --- python/cugraph/cugraph/datasets/metadata/email_Eu_core.yaml | 2 +- python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml | 2 +- python/cugraph/cugraph/datasets/metadata/karate_disjoint.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/cugraph/cugraph/datasets/metadata/email_Eu_core.yaml b/python/cugraph/cugraph/datasets/metadata/email_Eu_core.yaml index 002705858ac..eb2caa96bf8 100644 --- a/python/cugraph/cugraph/datasets/metadata/email_Eu_core.yaml +++ b/python/cugraph/cugraph/datasets/metadata/email_Eu_core.yaml @@ -1,4 +1,4 @@ -name: email_Eu_core +name: email-Eu-core file_type: .csv description: The network was generated using email data from a large European research institution. diff --git a/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml index 54ce3c674e1..fe9b46509d9 100644 --- a/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml +++ b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml @@ -1,4 +1,4 @@ -name: karate_asymmetric +name: karate-asymmetric file_type: .csv description: This is an undirected and asymmetric variant of the Karate dataset. diff --git a/python/cugraph/cugraph/datasets/metadata/karate_disjoint.yaml b/python/cugraph/cugraph/datasets/metadata/karate_disjoint.yaml index 66c142e35da..904a22f7266 100644 --- a/python/cugraph/cugraph/datasets/metadata/karate_disjoint.yaml +++ b/python/cugraph/cugraph/datasets/metadata/karate_disjoint.yaml @@ -1,4 +1,4 @@ -name: karate_disjoint +name: karate-disjoint file_type: .csv description: This is disjoint variant of the Karate dataset. From c5195906caaf01cdf62e7c9bee60b0691b8ebea5 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Wed, 26 Jul 2023 06:55:09 -0700 Subject: [PATCH 50/57] Update Sorensen notebook to use stable --- .../algorithms/link_prediction/Sorensen_coefficient.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notebooks/algorithms/link_prediction/Sorensen_coefficient.ipynb b/notebooks/algorithms/link_prediction/Sorensen_coefficient.ipynb index 6fa83694c7d..5281f69d5dc 100755 --- a/notebooks/algorithms/link_prediction/Sorensen_coefficient.ipynb +++ b/notebooks/algorithms/link_prediction/Sorensen_coefficient.ipynb @@ -158,7 +158,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Use the cuGraph Datasets api to get the dataframe containing edge data\n" + "### Use the cuGraph Datasets API to get the dataframe containing edge data\n" ] }, { @@ -168,7 +168,7 @@ "outputs": [], "source": [ "# Test file \n", - "from cugraph.experimental.datasets import karate\n", + "from cugraph.datasets import karate\n", "gdf = karate.get_edgelist(download=True)" ] }, From 958af9797cfb62d4c96a9ea49ccbbc97ad52a74b Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Wed, 26 Jul 2023 08:29:26 -0700 Subject: [PATCH 51/57] Fix bulk sampling style --- python/cugraph/cugraph/tests/sampling/test_bulk_sampler.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/cugraph/cugraph/tests/sampling/test_bulk_sampler.py b/python/cugraph/cugraph/tests/sampling/test_bulk_sampler.py index 8651f16efe7..cbd8321a338 100644 --- a/python/cugraph/cugraph/tests/sampling/test_bulk_sampler.py +++ b/python/cugraph/cugraph/tests/sampling/test_bulk_sampler.py @@ -24,6 +24,7 @@ import shutil import re + @pytest.mark.sg def test_bulk_sampler_simple(scratch_dir): el = karate.get_edgelist().reset_index().rename(columns={"index": "eid"}) From fb9e75e54f3d1a7b6fa2ca2514e7a7bfde86ef96 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Wed, 26 Jul 2023 08:53:44 -0700 Subject: [PATCH 52/57] Remove ktruss_polbooks from cugraph.datasets and refactor test_k_truss unit test --- python/cugraph/cugraph/datasets/__init__.py | 1 - .../datasets/metadata/karate_asymmetric.yaml | 2 +- .../datasets/metadata/ktruss_polbooks.yaml | 27 ------------------- python/cugraph/cugraph/testing/__init__.py | 2 -- .../tests/community/test_k_truss_subgraph.py | 13 +++------ 5 files changed, 5 insertions(+), 40 deletions(-) delete mode 100644 python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml diff --git a/python/cugraph/cugraph/datasets/__init__.py b/python/cugraph/cugraph/datasets/__init__.py index d749b2a8341..7ba274c5960 100644 --- a/python/cugraph/cugraph/datasets/__init__.py +++ b/python/cugraph/cugraph/datasets/__init__.py @@ -32,7 +32,6 @@ karate = Dataset(meta_path / "karate.yaml") karate_asymmetric = Dataset(meta_path / "karate_asymmetric.yaml") karate_disjoint = Dataset(meta_path / "karate_disjoint.yaml") -ktruss_polbooks = Dataset(meta_path / "ktruss_polbooks.yaml") netscience = Dataset(meta_path / "netscience.yaml") polbooks = Dataset(meta_path / "polbooks.yaml") small_line = Dataset(meta_path / "small_line.yaml") diff --git a/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml index fe9b46509d9..c211f0362f2 100644 --- a/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml +++ b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml @@ -1,7 +1,7 @@ name: karate-asymmetric file_type: .csv description: - This is an undirected and asymmetric variant of the Karate dataset. + This is an undirected, asymmetric variant of the Karate dataset. The original dataset was created by Wayne Zachary in 1977. author: Nvidia refs: diff --git a/python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml b/python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml deleted file mode 100644 index 6a09be3b43b..00000000000 --- a/python/cugraph/cugraph/datasets/metadata/ktruss_polbooks.yaml +++ /dev/null @@ -1,27 +0,0 @@ -name: ktruss_polbooks -file_type: .csv -description: - A network of books about U.S. politics published close to the 2004 U.S. - presidential election, and sold by Amazon.com. Edges between books represent - frequent copurchasing of those books by the same buyers. -author: V. Krebs -refs: - V. Krebs, "The political books network", unpublished, - https://doi.org/10.2307/40124305 [@sci-hub] -delim: " " -header: None -col_names: - - src - - dst - - wgt -col_types: - - int32 - - int32 - - float32 -has_loop: false -is_directed: true -is_multigraph: false -is_symmetric: false -number_of_edges: 233 -number_of_nodes: 58 -url: https://data.rapids.ai/cugraph/datasets/ref/ktruss/polbooks.csv diff --git a/python/cugraph/cugraph/testing/__init__.py b/python/cugraph/cugraph/testing/__init__.py index de3eb5229d7..db841a9a865 100644 --- a/python/cugraph/cugraph/testing/__init__.py +++ b/python/cugraph/cugraph/testing/__init__.py @@ -17,7 +17,6 @@ dolphins, karate, karate_disjoint, - ktruss_polbooks, polbooks, netscience, small_line, @@ -46,7 +45,6 @@ dolphins, karate, karate_disjoint, - ktruss_polbooks, polbooks, netscience, small_line, 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 e5646261786..b0dcc2ede3d 100644 --- a/python/cugraph/cugraph/tests/community/test_k_truss_subgraph.py +++ b/python/cugraph/cugraph/tests/community/test_k_truss_subgraph.py @@ -19,12 +19,10 @@ import cugraph from cugraph.testing import utils -from cugraph.datasets import polbooks, ktruss_polbooks, karate_asymmetric +from cugraph.datasets import polbooks, karate_asymmetric from numba import cuda -DATASETS_KTRUSS = [(polbooks, ktruss_polbooks)] - # ============================================================================= # Pytest Setup / Teardown - called for each test function # ============================================================================= @@ -82,8 +80,7 @@ def test_unsupported_cuda_version(): """ k = 5 - graph_file = DATASETS_KTRUSS[0][0] - G = graph_file.get_graph(download=True) + G = polbooks.get_graph(download=True) if __cuda_version == __unsupported_cuda_version: with pytest.raises(NotImplementedError): cugraph.k_truss(G, k) @@ -111,11 +108,9 @@ def test_ktruss_subgraph_Graph(_, nx_ground_truth): (__cuda_version == __unsupported_cuda_version), reason="skipping on unsupported CUDA " f"{__unsupported_cuda_version} environment.", ) -@pytest.mark.parametrize("graph_file, nx_ground_truth", DATASETS_KTRUSS) -def test_ktruss_subgraph_Graph_nx(graph_file, nx_ground_truth): - +def test_ktruss_subgraph_Graph_nx(): k = 5 - dataset_path = graph_file.get_path() + dataset_path = polbooks.get_path() M = utils.read_csv_for_nx(dataset_path, read_weights_in_sp=True) G = nx.from_pandas_edgelist( M, source="0", target="1", edge_attr="weight", create_using=nx.Graph() From f173e13fdbce15ce9a76d5f2731dd3594433123c Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Wed, 26 Jul 2023 10:51:29 -0700 Subject: [PATCH 53/57] Add unit test to check for graph symmetry and update metadata YAML files --- .../cugraph/datasets/metadata/dolphins.yaml | 2 +- .../datasets/metadata/email_Eu_core.yaml | 2 +- .../datasets/metadata/karate_asymmetric.yaml | 2 +- .../datasets/metadata/karate_disjoint.yaml | 2 +- .../cugraph/datasets/metadata/small_tree.yaml | 2 +- .../cugraph/tests/utils/test_dataset.py | 46 +++++++++++-------- 6 files changed, 32 insertions(+), 24 deletions(-) diff --git a/python/cugraph/cugraph/datasets/metadata/dolphins.yaml b/python/cugraph/cugraph/datasets/metadata/dolphins.yaml index 79f4563c85c..096da5dff0e 100644 --- a/python/cugraph/cugraph/datasets/metadata/dolphins.yaml +++ b/python/cugraph/cugraph/datasets/metadata/dolphins.yaml @@ -19,7 +19,7 @@ col_types: has_loop: false is_directed: false is_multigraph: false -is_symmetric: false +is_symmetric: true number_of_edges: 159 number_of_nodes: 62 url: https://data.rapids.ai/cugraph/datasets/dolphins.csv diff --git a/python/cugraph/cugraph/datasets/metadata/email_Eu_core.yaml b/python/cugraph/cugraph/datasets/metadata/email_Eu_core.yaml index eb2caa96bf8..8853d72c1f2 100644 --- a/python/cugraph/cugraph/datasets/metadata/email_Eu_core.yaml +++ b/python/cugraph/cugraph/datasets/metadata/email_Eu_core.yaml @@ -24,7 +24,7 @@ col_types: has_loop: true is_directed: true is_multigraph: false -is_symmetric: true +is_symmetric: false number_of_edges: 25571 number_of_nodes: 1005 url: https://data.rapids.ai/cugraph/datasets/email-Eu-core.csv diff --git a/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml index c211f0362f2..ba52bd3a29d 100644 --- a/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml +++ b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml @@ -20,7 +20,7 @@ col_types: has_loop: false is_directed: false is_multigraph: false -is_symmetric: false +is_symmetric: true number_of_edges: 78 number_of_nodes: 34 url: https://data.rapids.ai/cugraph/datasets/karate-asymmetric.csv diff --git a/python/cugraph/cugraph/datasets/metadata/karate_disjoint.yaml b/python/cugraph/cugraph/datasets/metadata/karate_disjoint.yaml index 904a22f7266..93e31eb37b7 100644 --- a/python/cugraph/cugraph/datasets/metadata/karate_disjoint.yaml +++ b/python/cugraph/cugraph/datasets/metadata/karate_disjoint.yaml @@ -18,7 +18,7 @@ col_types: - int32 - float32 has_loop: false -is_directed: True +is_directed: true is_multigraph: false is_symmetric: true number_of_edges: 312 diff --git a/python/cugraph/cugraph/datasets/metadata/small_tree.yaml b/python/cugraph/cugraph/datasets/metadata/small_tree.yaml index 37baed448a1..825fc1e80e9 100644 --- a/python/cugraph/cugraph/datasets/metadata/small_tree.yaml +++ b/python/cugraph/cugraph/datasets/metadata/small_tree.yaml @@ -17,7 +17,7 @@ col_types: has_loop: false is_directed: true is_multigraph: false -is_symmetric: true +is_symmetric: false number_of_edges: 11 number_of_nodes: 9 url: https://data.rapids.ai/cugraph/datasets/small_tree.csv diff --git a/python/cugraph/cugraph/tests/utils/test_dataset.py b/python/cugraph/cugraph/tests/utils/test_dataset.py index 48d540b4adf..643d0468d46 100644 --- a/python/cugraph/cugraph/tests/utils/test_dataset.py +++ b/python/cugraph/cugraph/tests/utils/test_dataset.py @@ -20,6 +20,7 @@ import pytest +import cudf from cugraph.structure import Graph from cugraph.testing import ( RAPIDS_DATASET_ROOT_DIR_PATH, @@ -90,7 +91,7 @@ def setup_deprecation_warning_tests(): ############################################################################### -# Helper +# Helpers # check if there is a row where src == dst def has_loop(df): @@ -100,6 +101,24 @@ def has_loop(df): return res.notnull().values.any() +# check if dataset object is symmetric +def is_symmetric(dataset): + # undirected graphs are symmetric + if not dataset.metadata["is_directed"]: + return True + else: + df = dataset.get_edgelist(download=True) + df_a = df.sort_values("src") + df_b = df_a[["dst", "src", "wgt"]] + df_b.rename(columns={"dst": "src", "src": "dst"}, inplace=True) + # created a df by appending the two + res = cudf.concat([df_a, df_b]) + # sort/unique + res = res.drop_duplicates().sort_values("src") + + return len(df_a) == len(res) + + ############################################################################### # Tests @@ -276,16 +295,8 @@ def test_node_and_edge_count(dataset): download=True, create_using=Graph(directed=dataset_is_directed) ) - # these are the values read directly from .yaml file - meta_node_count = dataset.metadata["number_of_nodes"] - meta_edge_count = dataset.metadata["number_of_edges"] - - # value from the cugraph.Graph object - obj_node_count = G.number_of_nodes() - obj_edge_count = G.number_of_edges() - - assert obj_node_count == meta_node_count - assert obj_edge_count == meta_edge_count + assert G.number_of_nodes() == dataset.metadata["number_of_nodes"] + assert G.number_of_edges() == dataset.metadata["number_of_edges"] @pytest.mark.parametrize("dataset", ALL_DATASETS) @@ -301,23 +312,20 @@ def test_is_directed(dataset): @pytest.mark.parametrize("dataset", ALL_DATASETS) def test_has_loop(dataset): df = dataset.get_edgelist(download=True) - metadata_has_loop = dataset.metadata["has_loop"] - assert has_loop(df) == metadata_has_loop + assert has_loop(df) == dataset.metadata["has_loop"] -# TODO: test is symmetric -# @pytest.mark.parametrize("dataset", ALL_DATASETS) -# def test_is_symmetric(dataset): -# G = dataset.get_graph(download=True) +@pytest.mark.parametrize("dataset", ALL_DATASETS) +def test_is_symmetric(dataset): + assert is_symmetric(dataset) == dataset.metadata["is_symmetric"] @pytest.mark.parametrize("dataset", ALL_DATASETS) def test_is_multigraph(dataset): - dataset_is_multigraph = dataset.metadata["is_multigraph"] G = dataset.get_graph(download=True) - assert G.is_multigraph() == dataset_is_multigraph + assert G.is_multigraph() == dataset.metadata["is_multigraph"] # From 87dd18362fa713ab9f30bbe3494c035c9ba8907f Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Wed, 26 Jul 2023 19:40:00 -0700 Subject: [PATCH 54/57] Update metadata files based on feedback from @rlratzel --- .../cugraph/cugraph/datasets/metadata/dolphins.yaml | 12 +++++++++--- .../cugraph/datasets/metadata/email_Eu_core.yaml | 7 +++---- .../cugraph/datasets/metadata/karate_asymmetric.yaml | 4 ++-- .../cugraph/datasets/metadata/karate_disjoint.yaml | 4 ++-- .../cugraph/datasets/metadata/small_line.yaml | 3 ++- .../cugraph/datasets/metadata/small_tree.yaml | 3 ++- .../cugraph/cugraph/datasets/metadata/toy_graph.yaml | 3 ++- .../datasets/metadata/toy_graph_undirected.yaml | 2 +- 8 files changed, 23 insertions(+), 15 deletions(-) diff --git a/python/cugraph/cugraph/datasets/metadata/dolphins.yaml b/python/cugraph/cugraph/datasets/metadata/dolphins.yaml index 096da5dff0e..69fdad1b368 100644 --- a/python/cugraph/cugraph/datasets/metadata/dolphins.yaml +++ b/python/cugraph/cugraph/datasets/metadata/dolphins.yaml @@ -1,7 +1,13 @@ name: dolphins file_type: .csv -description: null -author: D. Lusseau +description: An undirected social network of frequent associations between 62 dolphins in a community living off Doubtful Sound, New Zealand, as compiled by Lusseau et al. (2003). +author: + - D. Lusseau + - K. Schneider + - O. J. Boisseau + - P. Haase + - E. Slooten + - S. M. Dawson refs: D. Lusseau, K. Schneider, O. J. Boisseau, P. Haase, E. Slooten, and S. M. Dawson, The bottlenose dolphin community of Doubtful Sound features a large proportion of @@ -13,7 +19,7 @@ col_names: - dst - wgt col_types: - - int32 + - int32 - int32 - float32 has_loop: false diff --git a/python/cugraph/cugraph/datasets/metadata/email_Eu_core.yaml b/python/cugraph/cugraph/datasets/metadata/email_Eu_core.yaml index 8853d72c1f2..444a823788b 100644 --- a/python/cugraph/cugraph/datasets/metadata/email_Eu_core.yaml +++ b/python/cugraph/cugraph/datasets/metadata/email_Eu_core.yaml @@ -1,10 +1,9 @@ name: email-Eu-core file_type: .csv description: - The network was generated using email data from a large European research institution. - We have anonymized information about all incoming and outgoing email between members - of the research institution. There is an edge (u, v) in the network if person u - sent person v at least one email. The e-mails only represent communication between + The network was generated using anonymized email data from a large European + research institution. There is an edge (u, v) in the network if person u sent + person v at least one email. The e-mails only represent communication between institution members (the core), and the dataset does not contain incoming messages from or outgoing messages to the rest of the world. author: Jure Leskovec diff --git a/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml index ba52bd3a29d..3b3a1e2478b 100644 --- a/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml +++ b/python/cugraph/cugraph/datasets/metadata/karate_asymmetric.yaml @@ -1,8 +1,8 @@ name: karate-asymmetric file_type: .csv description: - This is an undirected, asymmetric variant of the Karate dataset. - The original dataset was created by Wayne Zachary in 1977. + This is an undirected, asymmetric variant of the Karate dataset. The original dataset, which + this is based on, was created by Wayne Zachary in 1977. author: Nvidia refs: W. W. Zachary, An information flow model for conflict and fission in small diff --git a/python/cugraph/cugraph/datasets/metadata/karate_disjoint.yaml b/python/cugraph/cugraph/datasets/metadata/karate_disjoint.yaml index 93e31eb37b7..40cf59b3cfe 100644 --- a/python/cugraph/cugraph/datasets/metadata/karate_disjoint.yaml +++ b/python/cugraph/cugraph/datasets/metadata/karate_disjoint.yaml @@ -1,8 +1,8 @@ name: karate-disjoint file_type: .csv description: - This is disjoint variant of the Karate dataset. - The original dataset was created by Wayne Zachary in 1977. + This is disjoint variant of the Karate dataset. The original dataset, which + this is based on, was created by Wayne Zachary in 1977. author: Nvidia refs: W. W. Zachary, An information flow model for conflict and fission in small groups, diff --git a/python/cugraph/cugraph/datasets/metadata/small_line.yaml b/python/cugraph/cugraph/datasets/metadata/small_line.yaml index e5c8484a049..825e829f16b 100644 --- a/python/cugraph/cugraph/datasets/metadata/small_line.yaml +++ b/python/cugraph/cugraph/datasets/metadata/small_line.yaml @@ -1,7 +1,8 @@ name: small_line file_type: .csv description: - The `small_line` dataset was created by Nvidia for testing and demonstration purposes. + The `small_line` dataset was created by Nvidia for testing and demonstration + purposes, and consists of a small (10 nodes) path/linear graph. author: Nvidia refs: null delim: " " diff --git a/python/cugraph/cugraph/datasets/metadata/small_tree.yaml b/python/cugraph/cugraph/datasets/metadata/small_tree.yaml index 825fc1e80e9..30df37c4d47 100644 --- a/python/cugraph/cugraph/datasets/metadata/small_tree.yaml +++ b/python/cugraph/cugraph/datasets/metadata/small_tree.yaml @@ -1,7 +1,8 @@ name: small_tree file_type: .csv description: - The `small_tree` dataset was created by Nvidia for testing/demonstration purposes. + The `small_tree` dataset was created by Nvidia for testing/demonstration + purposes, and consists of a small (9 nodes) directed tree. author: Nvidia refs: null delim: " " diff --git a/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml b/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml index 89946fb281f..afe85c01a4e 100644 --- a/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml +++ b/python/cugraph/cugraph/datasets/metadata/toy_graph.yaml @@ -1,7 +1,8 @@ name: toy_graph file_type: .csv description: - The `toy_graph` dataset was created by Nvidia for testing and demonstration purposes. + The `toy_graph` dataset was created by Nvidia for testing and demonstration + purposes, and consists of a small (6 nodes) directed graph. author: null refs: null delim: " " diff --git a/python/cugraph/cugraph/datasets/metadata/toy_graph_undirected.yaml b/python/cugraph/cugraph/datasets/metadata/toy_graph_undirected.yaml index 19cd57518d0..20c1a56df9a 100644 --- a/python/cugraph/cugraph/datasets/metadata/toy_graph_undirected.yaml +++ b/python/cugraph/cugraph/datasets/metadata/toy_graph_undirected.yaml @@ -2,7 +2,7 @@ name: toy_graph_undirected file_type: .csv description: The `toy_graph_undirected` dataset was created by Nvidia for testing and - demonstration purposes. + demonstration purposes, and consists of a small (6 nodes) undirected graph. author: Nvidia refs: null delim: " " From e4754c66f8848932df1703ef9a810a68cacff39e Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Thu, 27 Jul 2023 08:48:07 -0700 Subject: [PATCH 55/57] Update github workflow pr.yaml and build.yaml --- .github/workflows/build.yaml | 1 + .github/workflows/pr.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4354ca40327..74838271093 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -27,6 +27,7 @@ concurrency: jobs: cpp-build: + node_type: cpu32 secrets: inherit uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-build.yaml@branch-23.08 with: diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 17d7ac48907..ea4d7c4c625 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -36,7 +36,7 @@ jobs: uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-build.yaml@branch-23.08 with: build_type: pull-request - node_type: cpu16 + node_type: cpu32 conda-cpp-tests: needs: conda-cpp-build secrets: inherit From 05182ef839a35bc45d75f73c766c0d5be9640ba9 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Thu, 27 Jul 2023 08:51:20 -0700 Subject: [PATCH 56/57] Add missing netscience import to test_batch_edge_betweenness_centrality.py --- .../centrality/test_batch_edge_betweenness_centrality_mg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/cugraph/cugraph/tests/centrality/test_batch_edge_betweenness_centrality_mg.py b/python/cugraph/cugraph/tests/centrality/test_batch_edge_betweenness_centrality_mg.py index da6d5faa275..154477a1a67 100644 --- a/python/cugraph/cugraph/tests/centrality/test_batch_edge_betweenness_centrality_mg.py +++ b/python/cugraph/cugraph/tests/centrality/test_batch_edge_betweenness_centrality_mg.py @@ -17,7 +17,7 @@ import numpy as np from cugraph.dask.common.mg_utils import is_single_gpu -from cugraph.datasets import karate +from cugraph.datasets import karate, netscience # Get parameters from standard betwenness_centrality_test # As tests directory is not a module, we need to add it to the path From 1fa04963a2fac5edea86a253234521049c6aa997 Mon Sep 17 00:00:00 2001 From: Ralph Liu Date: Thu, 27 Jul 2023 12:30:34 -0700 Subject: [PATCH 57/57] Fix YAML file formatting issue --- python/cugraph/cugraph/datasets/metadata/dolphins.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/cugraph/cugraph/datasets/metadata/dolphins.yaml b/python/cugraph/cugraph/datasets/metadata/dolphins.yaml index 69fdad1b368..bc7cb6cd486 100644 --- a/python/cugraph/cugraph/datasets/metadata/dolphins.yaml +++ b/python/cugraph/cugraph/datasets/metadata/dolphins.yaml @@ -19,7 +19,7 @@ col_names: - dst - wgt col_types: - - int32 + - int32 - int32 - float32 has_loop: false