From f0e3b0faf05e03743853ca839b0178545a591edf Mon Sep 17 00:00:00 2001 From: jnke2016 Date: Sun, 12 Jan 2025 17:44:43 -0800 Subject: [PATCH] fix style --- .../dask/sampling/biased_random_walks.py | 19 ++++++------------- .../dask/sampling/node2vec_random_walks.py | 15 ++++++--------- .../dask/sampling/uniform_random_walks.py | 19 ++++++------------- 3 files changed, 18 insertions(+), 35 deletions(-) diff --git a/python/cugraph/cugraph/dask/sampling/biased_random_walks.py b/python/cugraph/cugraph/dask/sampling/biased_random_walks.py index 9a70ab658c..277dce6894 100644 --- a/python/cugraph/cugraph/dask/sampling/biased_random_walks.py +++ b/python/cugraph/cugraph/dask/sampling/biased_random_walks.py @@ -32,10 +32,8 @@ def convert_to_cudf( - cp_paths: cp.ndarray, - number_map=None, - is_vertex_paths: bool = False - ) -> cudf.Series: + cp_paths: cp.ndarray, number_map=None, is_vertex_paths: bool = False +) -> cudf.Series: """ Creates cudf Series from cupy arrays from pylibcugraph wrapper """ @@ -55,12 +53,8 @@ def convert_to_cudf( def _call_plc_biased_random_walks( - sID: bytes, - mg_graph_x, - st_x: cudf.Series, - max_depth: int, - random_state: int - ) -> Tuple[cp.ndarray, cp.ndarray]: + sID: bytes, mg_graph_x, st_x: cudf.Series, max_depth: int, random_state: int +) -> Tuple[cp.ndarray, cp.ndarray]: return pylibcugraph_biased_random_walks( resource_handle=ResourceHandle(Comms.get_handle(sID).getHandle()), @@ -73,10 +67,9 @@ def _call_plc_biased_random_walks( def biased_random_walks( input_graph, - start_vertices: Union[int, list, cudf.Series, cudf.DataFrame, cudf.Series - ] = None, + start_vertices: Union[int, list, cudf.Series, cudf.DataFrame, cudf.Series] = None, max_depth: int = 1, - random_state: int = None + random_state: int = None, ) -> Tuple[Union[dask_cudf.Series, dask_cudf.DataFrame], dask_cudf.Series, int]: """ compute random walks under the biased sampling framework for each nodes in diff --git a/python/cugraph/cugraph/dask/sampling/node2vec_random_walks.py b/python/cugraph/cugraph/dask/sampling/node2vec_random_walks.py index d3e84c4c42..96582cdd7d 100644 --- a/python/cugraph/cugraph/dask/sampling/node2vec_random_walks.py +++ b/python/cugraph/cugraph/dask/sampling/node2vec_random_walks.py @@ -31,10 +31,8 @@ def convert_to_cudf( - cp_paths: cp.ndarray, - number_map=None, - is_vertex_paths: bool = False - ) -> cudf.Series: + cp_paths: cp.ndarray, number_map=None, is_vertex_paths: bool = False +) -> cudf.Series: """ Creates cudf Series from cupy arrays from pylibcugraph wrapper """ @@ -58,9 +56,9 @@ def _call_plc_node2vec_random_walks( mg_graph_x, st_x: cudf.Series, max_depth: int, - p: float, + p: float, q: float, - random_state: int + random_state: int, ) -> Tuple[cp.ndarray, cp.ndarray]: return pylibcugraph_node2vec_random_walks( @@ -76,12 +74,11 @@ def _call_plc_node2vec_random_walks( def node2vec_random_walks( input_graph, - start_vertices: Union[int, list, cudf.Series, cudf.DataFrame, cudf.Series - ] = None, + start_vertices: Union[int, list, cudf.Series, cudf.DataFrame, cudf.Series] = None, max_depth: int = 1, p: float = 1.0, q: float = 1.0, - random_state: int = None + random_state: int = None, ) -> Tuple[Union[dask_cudf.Series, dask_cudf.DataFrame], dask_cudf.Series, int]: """ compute random walks under the node2vec sampling framework for each nodes in diff --git a/python/cugraph/cugraph/dask/sampling/uniform_random_walks.py b/python/cugraph/cugraph/dask/sampling/uniform_random_walks.py index 429ec00ae0..dd2a069ff8 100644 --- a/python/cugraph/cugraph/dask/sampling/uniform_random_walks.py +++ b/python/cugraph/cugraph/dask/sampling/uniform_random_walks.py @@ -32,10 +32,8 @@ def convert_to_cudf( - cp_paths: cp.ndarray, - number_map=None, - is_vertex_paths: bool = False - ) -> cudf.Series: + cp_paths: cp.ndarray, number_map=None, is_vertex_paths: bool = False +) -> cudf.Series: """ Creates cudf Series from cupy arrays from pylibcugraph wrapper """ @@ -55,12 +53,8 @@ def convert_to_cudf( def _call_plc_uniform_random_walks( - sID: bytes, - mg_graph_x, - st_x: cudf.Series, - max_depth: int, - random_state: int - ) -> Tuple[cp.ndarray, cp.ndarray]: + sID: bytes, mg_graph_x, st_x: cudf.Series, max_depth: int, random_state: int +) -> Tuple[cp.ndarray, cp.ndarray]: return pylibcugraph_uniform_random_walks( resource_handle=ResourceHandle(Comms.get_handle(sID).getHandle()), @@ -73,10 +67,9 @@ def _call_plc_uniform_random_walks( def uniform_random_walks( input_graph, - start_vertices: Union[int, list, cudf.Series, cudf.DataFrame, cudf.Series - ] = None, + start_vertices: Union[int, list, cudf.Series, cudf.DataFrame, cudf.Series] = None, max_depth: int = 1, - random_state: int = None + random_state: int = None, ) -> Tuple[Union[dask_cudf.Series, dask_cudf.DataFrame], dask_cudf.Series, int]: """ compute random walks under the uniform sampling framework for each nodes in