From 390e9845f44f10cdc57a1c5bc2b75c7f4e77c079 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Fri, 22 Mar 2024 13:26:35 -0700 Subject: [PATCH 1/4] Enable FutureWarnings and Deprecations as errors in cugraph --- python/cugraph/cugraph/community/egonet.py | 4 +-- .../cugraph/community/ktruss_subgraph.py | 8 ++--- .../cugraph/gnn/data_loading/bulk_sampler.py | 32 ++++++++++------- .../graph_implementation/simpleGraph.py | 36 ++++++++++--------- .../tests/community/test_k_truss_subgraph.py | 4 +-- .../community/test_subgraph_extraction.py | 12 +++---- .../cugraph/tests/generators/test_rmat.py | 4 +-- .../tests/link_prediction/test_overlap.py | 4 ++- .../tests/link_prediction/test_sorensen.py | 4 ++- .../cugraph/tests/sampling/test_egonet.py | 5 +-- .../cugraph/tests/utils/test_utils_mg.py | 4 +-- python/cugraph/pytest.ini | 2 ++ 12 files changed, 68 insertions(+), 51 deletions(-) diff --git a/python/cugraph/cugraph/community/egonet.py b/python/cugraph/cugraph/community/egonet.py index b7341ca3bae..452f89a78d3 100644 --- a/python/cugraph/cugraph/community/egonet.py +++ b/python/cugraph/cugraph/community/egonet.py @@ -199,10 +199,10 @@ def batched_ego_graphs(G, seeds, radius=1, center=True, undirected=None, distanc -------- >>> from cugraph.datasets import karate >>> G = karate.get_graph(download=True) - >>> b_ego_graph, offsets = cugraph.batched_ego_graphs(G, seeds=[1,5], + >>> b_ego_graph, offsets = cugraph.batched_ego_graphs(G, seeds=[1,5], # doctest: +SKIP ... radius=2) - """ + """ # noqa:E501 warning_msg = "This function is deprecated. Batched support for multiple vertices \ will be added to `ego_graph`" warnings.warn(warning_msg, DeprecationWarning) diff --git a/python/cugraph/cugraph/community/ktruss_subgraph.py b/python/cugraph/cugraph/community/ktruss_subgraph.py index 15a10007610..c9547e95ad5 100644 --- a/python/cugraph/cugraph/community/ktruss_subgraph.py +++ b/python/cugraph/cugraph/community/ktruss_subgraph.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2023, NVIDIA CORPORATION. +# Copyright (c) 2019-2024, 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 @@ -95,11 +95,11 @@ def k_truss( G, isNx = ensure_cugraph_obj_for_nx(G) if isNx is True: - k_sub = ktruss_subgraph(G, k) + k_sub = ktruss_subgraph(G, k, use_weights=False) S = cugraph_to_nx(k_sub) return S else: - return ktruss_subgraph(G, k) + return ktruss_subgraph(G, k, use_weights=False) # FIXME: merge this function with k_truss @@ -174,7 +174,7 @@ def ktruss_subgraph( -------- >>> from cugraph.datasets import karate >>> G = karate.get_graph(download=True) - >>> k_subgraph = cugraph.ktruss_subgraph(G, 3) + >>> k_subgraph = cugraph.ktruss_subgraph(G, 3, use_weights=False) """ diff --git a/python/cugraph/cugraph/gnn/data_loading/bulk_sampler.py b/python/cugraph/cugraph/gnn/data_loading/bulk_sampler.py index ff72e0ea2d6..be978905533 100644 --- a/python/cugraph/cugraph/gnn/data_loading/bulk_sampler.py +++ b/python/cugraph/cugraph/gnn/data_loading/bulk_sampler.py @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, 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 @@ -259,18 +259,24 @@ def flush(self) -> None: start_time_sample_call = time.perf_counter() # Call uniform neighbor sample - output = sample_fn( - self.__graph, - **self.__sample_call_args, - start_list=self.__batches[[self.start_col_name, self.batch_col_name]][ - batch_id_filter - ], - with_batch_ids=True, - with_edge_properties=True, - return_offsets=True, - renumber=self.__renumber, - # use_legacy_names=False, - ) + with warnings.catch_warnings(): + # TODO: Address the following uniform_neighbor_sample deprecations + # with_edge_properties + # include_hop_column + # use_legacy_names + warnings.simplefilter("ignore", FutureWarning) + output = sample_fn( + self.__graph, + **self.__sample_call_args, + start_list=self.__batches[[self.start_col_name, self.batch_col_name]][ + batch_id_filter + ], + with_batch_ids=True, + with_edge_properties=True, + return_offsets=True, + renumber=self.__renumber, + # use_legacy_names=False, + ) if self.__renumber: samples, offsets, renumber_map = output diff --git a/python/cugraph/cugraph/structure/graph_implementation/simpleGraph.py b/python/cugraph/cugraph/structure/graph_implementation/simpleGraph.py index 99934e02b10..953c1bd8a30 100644 --- a/python/cugraph/cugraph/structure/graph_implementation/simpleGraph.py +++ b/python/cugraph/cugraph/structure/graph_implementation/simpleGraph.py @@ -131,7 +131,7 @@ def __from_edgelist( edge_id=None, edge_type=None, renumber=True, - legacy_renum_only=True, + legacy_renum_only=False, store_transposed=False, ): if legacy_renum_only: @@ -261,14 +261,16 @@ def __from_edgelist( # will be dropped unless the graph is a MultiGraph(Not Implemented yet) # TODO: Update Symmetrize to work on Graph and/or DataFrame if edge_attr is not None: - source_col, dest_col, value_col = symmetrize( - elist, - source, - destination, - edge_attr, - multi=self.properties.multi_edge, # Deprecated parameter - symmetrize=not self.properties.directed, - ) + with warnings.catch_warnings(): + warnings.filterwarnings("ignore", "Multi is deprecated", FutureWarning) + source_col, dest_col, value_col = symmetrize( + elist, + source, + destination, + edge_attr, + multi=self.properties.multi_edge, # Deprecated parameter + symmetrize=not self.properties.directed, + ) if isinstance(value_col, cudf.DataFrame): value_dict = {} @@ -277,13 +279,15 @@ def __from_edgelist( value_col = value_dict else: value_col = None - source_col, dest_col = symmetrize( - elist, - source, - destination, - multi=self.properties.multi_edge, # Deprecated parameter - symmetrize=not self.properties.directed, - ) + with warnings.catch_warnings(): + warnings.filterwarnings("ignore", "Multi is deprecated", FutureWarning) + source_col, dest_col = symmetrize( + elist, + source, + destination, + multi=self.properties.multi_edge, # Deprecated parameter + symmetrize=not self.properties.directed, + ) if isinstance(value_col, dict): value_col = { 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 c1f8f4c3546..063d7fc735f 100644 --- a/python/cugraph/cugraph/tests/community/test_k_truss_subgraph.py +++ b/python/cugraph/cugraph/tests/community/test_k_truss_subgraph.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, 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 @@ -98,7 +98,7 @@ def test_ktruss_subgraph_Graph(_, nx_ground_truth): k = 5 G = polbooks.get_graph(download=True, create_using=cugraph.Graph(directed=False)) - k_subgraph = cugraph.ktruss_subgraph(G, k) + k_subgraph = cugraph.ktruss_subgraph(G, k, use_weights=False) compare_k_truss(k_subgraph, k, nx_ground_truth) diff --git a/python/cugraph/cugraph/tests/community/test_subgraph_extraction.py b/python/cugraph/cugraph/tests/community/test_subgraph_extraction.py index 8abab3179fe..a66d4a327e2 100644 --- a/python/cugraph/cugraph/tests/community/test_subgraph_extraction.py +++ b/python/cugraph/cugraph/tests/community/test_subgraph_extraction.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2023, NVIDIA CORPORATION. +# Copyright (c) 2019-2024, 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 @@ -51,7 +51,7 @@ def cugraph_call(M, verts, directed=True): G.from_cudf_edgelist(cu_M, source="0", destination="1", edge_attr="weight") cu_verts = cudf.Series(verts) - return cugraph.subgraph(G, cu_verts) + return cugraph.induced_subgraph(G, cu_verts) def nx_call(M, verts, directed=True): @@ -116,7 +116,7 @@ def test_subgraph_extraction_Graph_nx(graph_file): nx_sub = nx.subgraph(G, verts) cu_verts = cudf.Series(verts) - cu_sub = cugraph.subgraph(G, cu_verts) + cu_sub = cugraph.induced_subgraph(G, cu_verts) for (u, v) in cu_sub.edges(): assert nx_sub.has_edge(u, v) @@ -147,12 +147,12 @@ def test_subgraph_extraction_multi_column(graph_file): verts_G1["v_0"] = verts verts_G1["v_1"] = verts + 1000 - sG1 = cugraph.subgraph(G1, verts_G1) + sG1 = cugraph.induced_subgraph(G1, verts_G1) G2 = cugraph.Graph() G2.from_cudf_edgelist(cu_M, source="src_0", destination="dst_0", edge_attr="weight") - sG2 = cugraph.subgraph(G2, verts) + sG2 = cugraph.induced_subgraph(G2, verts) # FIXME: Replace with multi-column view_edge_list() edgelist_df = sG1.edgelist.edgelist_df @@ -180,7 +180,7 @@ def test_subgraph_extraction_graph_not_renumbered(): G.from_cudf_edgelist( gdf, source="src", destination="dst", edge_attr="wgt", renumber=False ) - Sg = cugraph.subgraph(G, sverts) + Sg = cugraph.induced_subgraph(G, sverts) assert Sg.number_of_vertices() == 3 assert Sg.number_of_edges() == 3 diff --git a/python/cugraph/cugraph/tests/generators/test_rmat.py b/python/cugraph/cugraph/tests/generators/test_rmat.py index 9b8353a4ca5..1cee0461686 100644 --- a/python/cugraph/cugraph/tests/generators/test_rmat.py +++ b/python/cugraph/cugraph/tests/generators/test_rmat.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2023, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, 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 @@ -17,7 +17,7 @@ import cudf import cugraph from cugraph.generators import rmat -from cupy.sparse import coo_matrix, triu, tril +from cupyx.scipy.sparse import coo_matrix, triu, tril import numpy as np import cupy as cp diff --git a/python/cugraph/cugraph/tests/link_prediction/test_overlap.py b/python/cugraph/cugraph/tests/link_prediction/test_overlap.py index 11ef0047b63..4b00330b6c9 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_overlap.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_overlap.py @@ -182,7 +182,9 @@ def test_directed_graph_check(graph_file, use_weight): vertex_pair = vertex_pair[:5] with pytest.raises(ValueError): - cugraph.overlap(G1, vertex_pair, use_weight) + cugraph.overlap( + G1, vertex_pair, do_expensive_check=False, use_weight=use_weight + ) @pytest.mark.sg diff --git a/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py b/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py index 8806f135302..6345187a376 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py @@ -219,7 +219,9 @@ def test_directed_graph_check(read_csv, use_weight): vertex_pair = vertex_pair[:5] with pytest.raises(ValueError): - cugraph.sorensen(G1, vertex_pair, use_weight) + cugraph.sorensen( + G1, vertex_pair, do_expensive_check=False, use_weight=use_weight + ) @pytest.mark.sg diff --git a/python/cugraph/cugraph/tests/sampling/test_egonet.py b/python/cugraph/cugraph/tests/sampling/test_egonet.py index 1ae7fcc0c88..4f8053bb37b 100644 --- a/python/cugraph/cugraph/tests/sampling/test_egonet.py +++ b/python/cugraph/cugraph/tests/sampling/test_egonet.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2023, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, 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 @@ -63,7 +63,8 @@ def test_batched_ego_graphs(graph_file, seeds, radius): ) # cugraph - df, offsets = cugraph.batched_ego_graphs(Gnx, seeds, radius=radius) + with pytest.warns(DeprecationWarning): + df, offsets = cugraph.batched_ego_graphs(Gnx, seeds, radius=radius) for i in range(len(seeds)): ego_nx = nx.ego_graph(Gnx, seeds[i], radius=radius) ego_df = df[offsets[i] : offsets[i + 1]] diff --git a/python/cugraph/cugraph/tests/utils/test_utils_mg.py b/python/cugraph/cugraph/tests/utils/test_utils_mg.py index 23ff17aa00b..2945b216384 100644 --- a/python/cugraph/cugraph/tests/utils/test_utils_mg.py +++ b/python/cugraph/cugraph/tests/utils/test_utils_mg.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2023, NVIDIA CORPORATION. +# Copyright (c) 2018-2024, 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 @@ -50,7 +50,7 @@ def test_from_edgelist(dask_client, directed): chunksize = dcg.get_chunksize(input_data_path) ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], diff --git a/python/cugraph/pytest.ini b/python/cugraph/pytest.ini index ebbd6a7eaad..04f266c5e5e 100644 --- a/python/cugraph/pytest.ini +++ b/python/cugraph/pytest.ini @@ -59,5 +59,7 @@ python_functions = filterwarnings = error:::cudf + error::FutureWarning + error::DeprecationWarning # Called via dask. Not obviously addressable in cugraph. ignore:The behavior of array concatenation with empty entries is deprecated:FutureWarning:cudf From 706f46d61b2e6aa2a7d25957d3311863fa004ae8 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Fri, 22 Mar 2024 16:55:45 -0700 Subject: [PATCH 2/4] Change chunksize to blocksize --- python/cugraph/cugraph/testing/utils.py | 6 +++--- python/cugraph/cugraph/tests/comms/test_comms_mg.py | 6 +++--- python/cugraph/cugraph/tests/community/test_leiden_mg.py | 6 +++--- python/cugraph/cugraph/tests/community/test_louvain_mg.py | 6 +++--- .../cugraph/tests/community/test_triangle_count_mg.py | 4 ++-- .../cugraph/tests/components/test_connectivity_mg.py | 4 ++-- python/cugraph/cugraph/tests/core/test_core_number_mg.py | 6 +++--- python/cugraph/cugraph/tests/core/test_k_core_mg.py | 6 +++--- .../cugraph/tests/data_store/test_property_graph_mg.py | 4 ++-- .../cugraph/cugraph/tests/internals/test_renumber_mg.py | 4 ++-- .../cugraph/cugraph/tests/link_analysis/test_hits_mg.py | 6 +++--- .../cugraph/tests/link_analysis/test_pagerank_mg.py | 8 ++++---- .../cugraph/tests/link_prediction/test_jaccard_mg.py | 4 ++-- .../cugraph/tests/link_prediction/test_overlap_mg.py | 4 ++-- .../cugraph/tests/link_prediction/test_sorensen_mg.py | 4 ++-- python/cugraph/cugraph/tests/sampling/test_egonet_mg.py | 4 ++-- .../cugraph/tests/sampling/test_random_walks_mg.py | 4 ++-- .../tests/sampling/test_uniform_neighbor_sample_mg.py | 6 +++--- python/cugraph/cugraph/tests/structure/test_graph.py | 4 ++-- python/cugraph/cugraph/tests/structure/test_graph_mg.py | 6 +++--- python/cugraph/cugraph/tests/traversal/test_bfs_mg.py | 8 ++++---- python/cugraph/cugraph/tests/traversal/test_sssp_mg.py | 4 ++-- 22 files changed, 57 insertions(+), 57 deletions(-) diff --git a/python/cugraph/cugraph/testing/utils.py b/python/cugraph/cugraph/testing/utils.py index 6d58076e6fe..82bbfe0ecac 100644 --- a/python/cugraph/cugraph/testing/utils.py +++ b/python/cugraph/cugraph/testing/utils.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, 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 @@ -245,7 +245,7 @@ def read_dask_cudf_csv_file(csv_file, read_weights_in_sp=True, single_partition= chunksize = os.path.getsize(csv_file) return dask_cudf.read_csv( csv_file, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "weight"], dtype=["int32", "int32", "float32"], @@ -264,7 +264,7 @@ def read_dask_cudf_csv_file(csv_file, read_weights_in_sp=True, single_partition= chunksize = os.path.getsize(csv_file) return dask_cudf.read_csv( csv_file, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "weight"], dtype=["int32", "int32", "float32"], diff --git a/python/cugraph/cugraph/tests/comms/test_comms_mg.py b/python/cugraph/cugraph/tests/comms/test_comms_mg.py index 747ef935e01..75462924c9d 100644 --- a/python/cugraph/cugraph/tests/comms/test_comms_mg.py +++ b/python/cugraph/cugraph/tests/comms/test_comms_mg.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, 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 @@ -53,7 +53,7 @@ def test_dask_mg_pagerank(dask_client, directed): ddf1 = dask_cudf.read_csv( input_data_path1, - chunksize=chunksize1, + blocksize=chunksize1, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], @@ -66,7 +66,7 @@ def test_dask_mg_pagerank(dask_client, directed): ddf2 = dask_cudf.read_csv( input_data_path2, - chunksize=chunksize2, + blocksize=chunksize2, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], diff --git a/python/cugraph/cugraph/tests/community/test_leiden_mg.py b/python/cugraph/cugraph/tests/community/test_leiden_mg.py index 69fccdae260..b1908ae10a2 100644 --- a/python/cugraph/cugraph/tests/community/test_leiden_mg.py +++ b/python/cugraph/cugraph/tests/community/test_leiden_mg.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, 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 @@ -67,7 +67,7 @@ def daskGraphFromDataset(request, dask_client): chunksize = dcg.get_chunksize(dataset) ddf = dask_cudf.read_csv( dataset, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], @@ -96,7 +96,7 @@ def uddaskGraphFromDataset(request, dask_client): chunksize = dcg.get_chunksize(dataset) ddf = dask_cudf.read_csv( dataset, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], diff --git a/python/cugraph/cugraph/tests/community/test_louvain_mg.py b/python/cugraph/cugraph/tests/community/test_louvain_mg.py index 5318262fe26..19fffe96b5c 100644 --- a/python/cugraph/cugraph/tests/community/test_louvain_mg.py +++ b/python/cugraph/cugraph/tests/community/test_louvain_mg.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, 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 @@ -67,7 +67,7 @@ def daskGraphFromDataset(request, dask_client): chunksize = dcg.get_chunksize(dataset) ddf = dask_cudf.read_csv( dataset, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], @@ -96,7 +96,7 @@ def uddaskGraphFromDataset(request, dask_client): chunksize = dcg.get_chunksize(dataset) ddf = dask_cudf.read_csv( dataset, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], 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 0f7bb14581f..0a052845cf8 100644 --- a/python/cugraph/cugraph/tests/community/test_triangle_count_mg.py +++ b/python/cugraph/cugraph/tests/community/test_triangle_count_mg.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -88,7 +88,7 @@ def input_expected_output(dask_client, input_combo): chunksize = dcg.get_chunksize(input_data_path) ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], diff --git a/python/cugraph/cugraph/tests/components/test_connectivity_mg.py b/python/cugraph/cugraph/tests/components/test_connectivity_mg.py index 217c9f0f09f..26e8ed17bcb 100644 --- a/python/cugraph/cugraph/tests/components/test_connectivity_mg.py +++ b/python/cugraph/cugraph/tests/components/test_connectivity_mg.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, 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 @@ -48,7 +48,7 @@ def test_dask_mg_wcc(dask_client, directed): ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], 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 23214b5f51b..f771ce513eb 100644 --- a/python/cugraph/cugraph/tests/core/test_core_number_mg.py +++ b/python/cugraph/cugraph/tests/core/test_core_number_mg.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -78,7 +78,7 @@ def input_expected_output(dask_client, input_combo): chunksize = dcg.get_chunksize(input_data_path) ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], @@ -143,7 +143,7 @@ def test_core_number_invalid_input(input_expected_output): chunksize = dcg.get_chunksize(input_data_path) ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], 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 32c4f4553a2..b2ac18cf3a9 100644 --- a/python/cugraph/cugraph/tests/core/test_k_core_mg.py +++ b/python/cugraph/cugraph/tests/core/test_k_core_mg.py @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, 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 @@ -98,7 +98,7 @@ def input_expected_output(dask_client, input_combo): chunksize = dcg.get_chunksize(input_data_path) ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], @@ -164,7 +164,7 @@ def test_dask_mg_k_core_invalid_input(dask_client): chunksize = dcg.get_chunksize(input_data_path) ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], 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 dd48fc72e36..db4ab0a2ac1 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 @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2023, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, 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 @@ -372,7 +372,7 @@ def net_MGPropertyGraph(dask_client): chunksize = dcg.get_chunksize(input_data_path) ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], diff --git a/python/cugraph/cugraph/tests/internals/test_renumber_mg.py b/python/cugraph/cugraph/tests/internals/test_renumber_mg.py index e9521f16594..45a3c46309d 100644 --- a/python/cugraph/cugraph/tests/internals/test_renumber_mg.py +++ b/python/cugraph/cugraph/tests/internals/test_renumber_mg.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2023, NVIDIA CORPORATION. +# Copyright (c) 2019-2024, 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 @@ -140,7 +140,7 @@ def test_dask_mg_pagerank(dask_client, directed): ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], 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 73ec13c674c..6e68059bcc7 100644 --- a/python/cugraph/cugraph/tests/link_analysis/test_hits_mg.py +++ b/python/cugraph/cugraph/tests/link_analysis/test_hits_mg.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -81,7 +81,7 @@ def input_expected_output(input_combo): chunksize = dcg.get_chunksize(input_data_path) ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], @@ -162,7 +162,7 @@ def test_dask_mg_hits_transposed_false(dask_client): ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], 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 63dbf31ca5e..c65863aefb4 100644 --- a/python/cugraph/cugraph/tests/link_analysis/test_pagerank_mg.py +++ b/python/cugraph/cugraph/tests/link_analysis/test_pagerank_mg.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, 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 create_distributed_karate_graph(store_transposed=True): ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], @@ -103,7 +103,7 @@ def test_dask_mg_pagerank( ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], @@ -184,7 +184,7 @@ def test_pagerank_invalid_personalization_dtype(dask_client): chunksize = dcg.get_chunksize(input_data_path) ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], 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 ee739c9f236..98f64906564 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_jaccard_mg.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_jaccard_mg.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -102,7 +102,7 @@ def input_expected_output(input_combo): chunksize = dcg.get_chunksize(input_data_path) ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], 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 87407d7b59c..9afe7dd842f 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_overlap_mg.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_overlap_mg.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -102,7 +102,7 @@ def input_expected_output(input_combo): chunksize = dcg.get_chunksize(input_data_path) ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], 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 66832d08427..6c24fa5af13 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_sorensen_mg.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_sorensen_mg.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -103,7 +103,7 @@ def input_expected_output(input_combo): chunksize = dcg.get_chunksize(input_data_path) ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], diff --git a/python/cugraph/cugraph/tests/sampling/test_egonet_mg.py b/python/cugraph/cugraph/tests/sampling/test_egonet_mg.py index e2f77700958..9bc4caf0e8e 100644 --- a/python/cugraph/cugraph/tests/sampling/test_egonet_mg.py +++ b/python/cugraph/cugraph/tests/sampling/test_egonet_mg.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -90,7 +90,7 @@ def input_expected_output(input_combo): chunksize = dcg.get_chunksize(input_data_path) ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], 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 03658c7a06e..29c15a7d7c6 100644 --- a/python/cugraph/cugraph/tests/sampling/test_random_walks_mg.py +++ b/python/cugraph/cugraph/tests/sampling/test_random_walks_mg.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -182,7 +182,7 @@ def input_graph(request): chunksize = dcg.get_chunksize(input_data_path) ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], 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 32413d3c88d..c65535f98a2 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 @@ -87,7 +87,7 @@ def input_combo(request): chunksize = dcg.get_chunksize(input_data_path) ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", indices_type], @@ -224,7 +224,7 @@ def test_mg_uniform_neighbor_sample_tree(dask_client, directed): ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], @@ -1256,7 +1256,7 @@ def bench_uniform_neighbor_sample_email_eu_core(gpubenchmark, dask_client, n_sam ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "int32"], diff --git a/python/cugraph/cugraph/tests/structure/test_graph.py b/python/cugraph/cugraph/tests/structure/test_graph.py index de306309ca4..c0524fcfe77 100644 --- a/python/cugraph/cugraph/tests/structure/test_graph.py +++ b/python/cugraph/cugraph/tests/structure/test_graph.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2023, NVIDIA CORPORATION. +# Copyright (c) 2019-2024, 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 @@ -386,7 +386,7 @@ def test_consolidation(graph_file): ddf = dask_cudf.read_csv( graph_file, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["source", "target", "weight"], dtype=["int32", "int32", "float32"], diff --git a/python/cugraph/cugraph/tests/structure/test_graph_mg.py b/python/cugraph/cugraph/tests/structure/test_graph_mg.py index 7837916ae53..f23d4ec026d 100644 --- a/python/cugraph/cugraph/tests/structure/test_graph_mg.py +++ b/python/cugraph/cugraph/tests/structure/test_graph_mg.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -68,7 +68,7 @@ def input_combo(request): chunksize = dcg.get_chunksize(input_data_path) ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], @@ -285,7 +285,7 @@ def test_graph_repartition(dask_client): ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], diff --git a/python/cugraph/cugraph/tests/traversal/test_bfs_mg.py b/python/cugraph/cugraph/tests/traversal/test_bfs_mg.py index 5eafc231141..62deb581d6d 100644 --- a/python/cugraph/cugraph/tests/traversal/test_bfs_mg.py +++ b/python/cugraph/cugraph/tests/traversal/test_bfs_mg.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, 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 @@ -48,7 +48,7 @@ def test_dask_mg_bfs(dask_client, directed): ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], @@ -114,7 +114,7 @@ def test_dask_mg_bfs_invalid_start(dask_client, directed): el = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], @@ -150,7 +150,7 @@ def test_dask_mg_bfs_multi_column_depthlimit(dask_client, directed): ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src_a", "dst_a", "value"], dtype=["int32", "int32", "float32"], diff --git a/python/cugraph/cugraph/tests/traversal/test_sssp_mg.py b/python/cugraph/cugraph/tests/traversal/test_sssp_mg.py index 55bd320c2f1..9877a127700 100644 --- a/python/cugraph/cugraph/tests/traversal/test_sssp_mg.py +++ b/python/cugraph/cugraph/tests/traversal/test_sssp_mg.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, 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 @@ -47,7 +47,7 @@ def test_dask_mg_sssp(dask_client, directed): ddf = dask_cudf.read_csv( input_data_path, - chunksize=chunksize, + blocksize=chunksize, delimiter=" ", names=["src", "dst", "value"], dtype=["int32", "int32", "float32"], From cd0d2b3784a29df3b7e83b2ff10c7104b3b441cf Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Tue, 2 Apr 2024 16:35:46 -0700 Subject: [PATCH 3/4] Index tuple results --- .../tests/community/test_subgraph_extraction.py | 12 ++++++------ python/cugraph/cugraph/tests/core/test_k_core_mg.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/python/cugraph/cugraph/tests/community/test_subgraph_extraction.py b/python/cugraph/cugraph/tests/community/test_subgraph_extraction.py index a66d4a327e2..05fd432e12f 100644 --- a/python/cugraph/cugraph/tests/community/test_subgraph_extraction.py +++ b/python/cugraph/cugraph/tests/community/test_subgraph_extraction.py @@ -74,7 +74,7 @@ def test_subgraph_extraction_DiGraph(graph_file): verts[0] = 0 verts[1] = 1 verts[2] = 17 - cu_sg = cugraph_call(M, verts, True) + cu_sg = cugraph_call(M, verts, True)[0] nx_sg = nx_call(M, verts, True) assert compare_edges(cu_sg, nx_sg) @@ -88,7 +88,7 @@ def test_subgraph_extraction_Graph(graph_file): verts[0] = 0 verts[1] = 1 verts[2] = 17 - cu_sg = cugraph_call(M, verts, False) + cu_sg = cugraph_call(M, verts, False)[0] nx_sg = nx_call(M, verts, False) assert compare_edges(cu_sg, nx_sg) @@ -155,11 +155,11 @@ def test_subgraph_extraction_multi_column(graph_file): sG2 = cugraph.induced_subgraph(G2, verts) # FIXME: Replace with multi-column view_edge_list() - edgelist_df = sG1.edgelist.edgelist_df - edgelist_df_res = sG1.unrenumber(edgelist_df, "src") - edgelist_df_res = sG1.unrenumber(edgelist_df_res, "dst") + edgelist_df = sG1[0].edgelist.edgelist_df + edgelist_df_res = sG1[0].unrenumber(edgelist_df, "src") + edgelist_df_res = sG1[0].unrenumber(edgelist_df_res, "dst") for i in range(len(edgelist_df_res)): - assert sG2.has_edge( + assert sG2[0].has_edge( edgelist_df_res["0_src"].iloc[i], edgelist_df_res["0_dst"].iloc[i] ) 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 b2ac18cf3a9..857c773744f 100644 --- a/python/cugraph/cugraph/tests/core/test_k_core_mg.py +++ b/python/cugraph/cugraph/tests/core/test_k_core_mg.py @@ -87,7 +87,7 @@ def input_expected_output(dask_client, input_combo): dstCol = sg_k_core_graph.destination_columns wgtCol = sg_k_core_graph.weight_column sg_k_core_results = ( - symmetrize_df(sg_k_core_results, srcCol, dstCol, wgtCol) + symmetrize_df(sg_k_core_results, srcCol, dstCol, wgtCol, multi=True) .sort_values([srcCol, dstCol]) .reset_index(drop=True) ) From 5a282d45a081e97321a8fee83ff2261bae72e8bb Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Tue, 2 Apr 2024 16:44:24 -0700 Subject: [PATCH 4/4] fix more docstrings --- python/cugraph/cugraph/community/subgraph_extraction.py | 4 ++-- .../cugraph/dask/centrality/betweenness_centrality.py | 6 +++--- .../cugraph/dask/centrality/eigenvector_centrality.py | 4 ++-- python/cugraph/cugraph/dask/centrality/katz_centrality.py | 4 ++-- python/cugraph/cugraph/dask/community/leiden.py | 2 +- python/cugraph/cugraph/dask/community/louvain.py | 2 +- python/cugraph/cugraph/dask/components/connectivity.py | 4 ++-- python/cugraph/cugraph/dask/cores/k_core.py | 4 ++-- python/cugraph/cugraph/dask/link_analysis/hits.py | 4 ++-- python/cugraph/cugraph/dask/link_analysis/pagerank.py | 2 +- python/cugraph/cugraph/dask/traversal/bfs.py | 4 ++-- python/cugraph/cugraph/dask/traversal/sssp.py | 4 ++-- python/cugraph/cugraph/structure/symmetrize.py | 6 +++--- 13 files changed, 25 insertions(+), 25 deletions(-) diff --git a/python/cugraph/cugraph/community/subgraph_extraction.py b/python/cugraph/cugraph/community/subgraph_extraction.py index 77b28d4daff..ad038b499df 100644 --- a/python/cugraph/cugraph/community/subgraph_extraction.py +++ b/python/cugraph/cugraph/community/subgraph_extraction.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2023, NVIDIA CORPORATION. +# Copyright (c) 2019-2024, 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 @@ -64,7 +64,7 @@ def subgraph( >>> verts[1] = 1 >>> verts[2] = 2 >>> sverts = cudf.Series(verts) - >>> Sg = cugraph.subgraph(G, sverts) + >>> Sg = cugraph.subgraph(G, sverts) # doctest: +SKIP """ diff --git a/python/cugraph/cugraph/dask/centrality/betweenness_centrality.py b/python/cugraph/cugraph/dask/centrality/betweenness_centrality.py index 6aa708ea585..43891f487c1 100644 --- a/python/cugraph/cugraph/dask/centrality/betweenness_centrality.py +++ b/python/cugraph/cugraph/dask/centrality/betweenness_centrality.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -204,7 +204,7 @@ def betweenness_centrality( >>> # Download dataset from https://github.com/rapidsai/cugraph/datasets/.. >>> chunksize = dcg.get_chunksize(datasets_path / "karate.csv") >>> ddf = dask_cudf.read_csv(datasets_path / "karate.csv", - ... chunksize=chunksize, delimiter=" ", + ... blocksize=chunksize, delimiter=" ", ... names=["src", "dst", "value"], ... dtype=["int32", "int32", "float32"]) >>> dg = cugraph.Graph(directed=True) @@ -362,7 +362,7 @@ def edge_betweenness_centrality( >>> # Download dataset from https://github.com/rapidsai/cugraph/datasets/.. >>> chunksize = dcg.get_chunksize(datasets_path / "karate.csv") >>> ddf = dask_cudf.read_csv(datasets_path / "karate.csv", - ... chunksize=chunksize, delimiter=" ", + ... blocksize=chunksize, delimiter=" ", ... names=["src", "dst", "value"], ... dtype=["int32", "int32", "float32"]) >>> dg = cugraph.Graph(directed=True) diff --git a/python/cugraph/cugraph/dask/centrality/eigenvector_centrality.py b/python/cugraph/cugraph/dask/centrality/eigenvector_centrality.py index 0dcd2b38546..7dfe3df7030 100644 --- a/python/cugraph/cugraph/dask/centrality/eigenvector_centrality.py +++ b/python/cugraph/cugraph/dask/centrality/eigenvector_centrality.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -104,7 +104,7 @@ def eigenvector_centrality(input_graph, max_iter=100, tol=1.0e-6): >>> # Download dataset from https://github.com/rapidsai/cugraph/datasets/.. >>> chunksize = dcg.get_chunksize(datasets_path / "karate.csv") >>> ddf = dask_cudf.read_csv(datasets_path / "karate.csv", - ... chunksize=chunksize, delimiter=" ", + ... blocksize=chunksize, delimiter=" ", ... names=["src", "dst", "value"], ... dtype=["int32", "int32", "float32"]) >>> dg = cugraph.Graph() diff --git a/python/cugraph/cugraph/dask/centrality/katz_centrality.py b/python/cugraph/cugraph/dask/centrality/katz_centrality.py index 3891c04f5aa..a11be3b6870 100644 --- a/python/cugraph/cugraph/dask/centrality/katz_centrality.py +++ b/python/cugraph/cugraph/dask/centrality/katz_centrality.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -133,7 +133,7 @@ def katz_centrality( >>> # Download dataset from https://github.com/rapidsai/cugraph/datasets/.. >>> chunksize = dcg.get_chunksize(datasets_path / "karate.csv") >>> ddf = dask_cudf.read_csv(datasets_path / "karate.csv", - ... chunksize=chunksize, delimiter=" ", + ... blocksize=chunksize, delimiter=" ", ... names=["src", "dst", "value"], ... dtype=["int32", "int32", "float32"]) >>> dg = cugraph.Graph(directed=True) diff --git a/python/cugraph/cugraph/dask/community/leiden.py b/python/cugraph/cugraph/dask/community/leiden.py index 24a077d1845..bdcf9edc7bb 100644 --- a/python/cugraph/cugraph/dask/community/leiden.py +++ b/python/cugraph/cugraph/dask/community/leiden.py @@ -132,7 +132,7 @@ def leiden( >>> # Download dataset from https://github.com/rapidsai/cugraph/datasets/.. >>> chunksize = dcg.get_chunksize(datasets_path / "karate.csv") >>> ddf = dask_cudf.read_csv(datasets_path / "karate.csv", - ... chunksize=chunksize, delimiter=" ", + ... blocksize=chunksize, delimiter=" ", ... names=["src", "dst", "value"], ... dtype=["int32", "int32", "float32"]) >>> dg = cugraph.Graph() diff --git a/python/cugraph/cugraph/dask/community/louvain.py b/python/cugraph/cugraph/dask/community/louvain.py index 2d894d9665f..8ad3e6c2cf3 100644 --- a/python/cugraph/cugraph/dask/community/louvain.py +++ b/python/cugraph/cugraph/dask/community/louvain.py @@ -136,7 +136,7 @@ def louvain( >>> # Download dataset from https://github.com/rapidsai/cugraph/datasets/.. >>> chunksize = dcg.get_chunksize(datasets_path / "karate.csv") >>> ddf = dask_cudf.read_csv(datasets_path / "karate.csv", - ... chunksize=chunksize, delimiter=" ", + ... blocksize=chunksize, delimiter=" ", ... names=["src", "dst", "value"], ... dtype=["int32", "int32", "float32"]) >>> dg = cugraph.Graph() diff --git a/python/cugraph/cugraph/dask/components/connectivity.py b/python/cugraph/cugraph/dask/components/connectivity.py index 7adaa2cd509..5a92fe004ee 100644 --- a/python/cugraph/cugraph/dask/components/connectivity.py +++ b/python/cugraph/cugraph/dask/components/connectivity.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2023, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -78,7 +78,7 @@ def weakly_connected_components(input_graph): >>> # Download dataset from https://github.com/rapidsai/cugraph/datasets/.. >>> chunksize = dcg.get_chunksize(datasets_path / "karate.csv") >>> ddf = dask_cudf.read_csv(datasets_path / "karate.csv", - ... chunksize=chunksize, delimiter=" ", + ... blocksize=chunksize, delimiter=" ", ... names=["src", "dst", "value"], ... dtype=["int32", "int32", "float32"]) >>> dg = cugraph.Graph(directed=False) diff --git a/python/cugraph/cugraph/dask/cores/k_core.py b/python/cugraph/cugraph/dask/cores/k_core.py index 4cc1ffc9f9b..0d799e3ee06 100644 --- a/python/cugraph/cugraph/dask/cores/k_core.py +++ b/python/cugraph/cugraph/dask/cores/k_core.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -109,7 +109,7 @@ def k_core(input_graph, k=None, core_number=None, degree_type="bidirectional"): >>> # Download dataset from https://github.com/rapidsai/cugraph/datasets/.. >>> chunksize = dcg.get_chunksize(datasets_path / "karate.csv") >>> ddf = dask_cudf.read_csv(datasets_path / "karate.csv", - ... chunksize=chunksize, delimiter=" ", + ... blocksize=chunksize, delimiter=" ", ... names=["src", "dst", "value"], ... dtype=["int32", "int32", "float32"]) >>> dg = cugraph.Graph(directed=False) diff --git a/python/cugraph/cugraph/dask/link_analysis/hits.py b/python/cugraph/cugraph/dask/link_analysis/hits.py index 3de69e1518b..13357ebb996 100644 --- a/python/cugraph/cugraph/dask/link_analysis/hits.py +++ b/python/cugraph/cugraph/dask/link_analysis/hits.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -118,7 +118,7 @@ def hits(input_graph, tol=1.0e-5, max_iter=100, nstart=None, normalized=True): >>> # Download dataset from https://github.com/rapidsai/cugraph/datasets/.. >>> chunksize = dcg.get_chunksize(datasets_path / "karate.csv") >>> ddf = dask_cudf.read_csv(datasets_path / "karate.csv", - ... chunksize=chunksize, delimiter=" ", + ... blocksize=chunksize, delimiter=" ", ... names=["src", "dst", "value"], ... dtype=["int32", "int32", "float32"]) >>> dg = cugraph.Graph(directed=True) diff --git a/python/cugraph/cugraph/dask/link_analysis/pagerank.py b/python/cugraph/cugraph/dask/link_analysis/pagerank.py index 62ae9109624..4b592a2583c 100644 --- a/python/cugraph/cugraph/dask/link_analysis/pagerank.py +++ b/python/cugraph/cugraph/dask/link_analysis/pagerank.py @@ -295,7 +295,7 @@ def pagerank( >>> # Download dataset from https://github.com/rapidsai/cugraph/datasets/.. >>> chunksize = dcg.get_chunksize(datasets_path / "karate.csv") >>> ddf = dask_cudf.read_csv(datasets_path / "karate.csv", - ... chunksize=chunksize, delimiter=" ", + ... blocksize=chunksize, delimiter=" ", ... names=["src", "dst", "value"], ... dtype=["int32", "int32", "float32"]) >>> dg = cugraph.Graph(directed=True) diff --git a/python/cugraph/cugraph/dask/traversal/bfs.py b/python/cugraph/cugraph/dask/traversal/bfs.py index 412fd851ad6..f1b26472ee0 100644 --- a/python/cugraph/cugraph/dask/traversal/bfs.py +++ b/python/cugraph/cugraph/dask/traversal/bfs.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2023, NVIDIA CORPORATION. +# Copyright (c) 2019-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -106,7 +106,7 @@ def bfs(input_graph, start, depth_limit=None, return_distances=True, check_start >>> # Download dataset from https://github.com/rapidsai/cugraph/datasets/.. >>> chunksize = dcg.get_chunksize(datasets_path / "karate.csv") >>> ddf = dask_cudf.read_csv(datasets_path / "karate.csv", - ... chunksize=chunksize, delimiter=" ", + ... blocksize=chunksize, delimiter=" ", ... names=["src", "dst", "value"], ... dtype=["int32", "int32", "float32"]) >>> dg = cugraph.Graph(directed=True) diff --git a/python/cugraph/cugraph/dask/traversal/sssp.py b/python/cugraph/cugraph/dask/traversal/sssp.py index 053a93fb42a..04c4376a500 100644 --- a/python/cugraph/cugraph/dask/traversal/sssp.py +++ b/python/cugraph/cugraph/dask/traversal/sssp.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2023, NVIDIA CORPORATION. +# Copyright (c) 2019-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -89,7 +89,7 @@ def sssp(input_graph, source, cutoff=None, check_source=True): >>> # Download dataset from https://github.com/rapidsai/cugraph/datasets/.. >>> chunksize = dcg.get_chunksize(datasets_path / "karate.csv") >>> ddf = dask_cudf.read_csv(datasets_path / "karate.csv", - ... chunksize=chunksize, delimiter=" ", + ... blocksize=chunksize, delimiter=" ", ... names=["src", "dst", "value"], ... dtype=["int32", "int32", "float32"]) >>> dg = cugraph.Graph(directed=True) diff --git a/python/cugraph/cugraph/structure/symmetrize.py b/python/cugraph/cugraph/structure/symmetrize.py index 30c6394ade9..27e8fb3e616 100644 --- a/python/cugraph/cugraph/structure/symmetrize.py +++ b/python/cugraph/cugraph/structure/symmetrize.py @@ -73,7 +73,7 @@ def symmetrize_df( >>> # Download dataset from https://github.com/rapidsai/cugraph/datasets/.. >>> M = cudf.read_csv(datasets_path / 'karate.csv', delimiter=' ', ... dtype=['int32', 'int32', 'float32'], header=None) - >>> sym_df = symmetrize_df(M, '0', '1') + >>> sym_df = symmetrize_df(M, '0', '1', multi=True) """ if not isinstance(src_name, list): @@ -159,7 +159,7 @@ def symmetrize_ddf( >>> # Init a DASK Cluster >>> # Download dataset from https://github.com/rapidsai/cugraph/datasets/.. >>> # chunksize = dcg.get_chunksize(datasets / 'karate.csv') - >>> # ddf = dask_cudf.read_csv(datasets/'karate.csv', chunksize=chunksize, + >>> # ddf = dask_cudf.read_csv(datasets/'karate.csv', blocksize=chunksize, >>> # delimiter=' ', >>> # names=['src', 'dst', 'weight'], >>> # dtype=['int32', 'int32', 'float32']) @@ -256,7 +256,7 @@ def symmetrize( >>> df['sources'] = cudf.Series(M['0']) >>> df['destinations'] = cudf.Series(M['1']) >>> df['values'] = cudf.Series(M['2']) - >>> src, dst, val = symmetrize(df, 'sources', 'destinations', 'values') + >>> src, dst, val = symmetrize(df, 'sources', 'destinations', 'values', multi=True) """