Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address k_truss_subgraph(use_weights=) deprecation #4389

Merged
merged 4 commits into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions python/cugraph/cugraph/community/ktruss_subgraph.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -174,8 +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)
"""

_ensure_compatible_cuda_version()
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)

Expand Down
Loading