From 64fb16d46332cc5872d2a8bccc0c919b1fac8e12 Mon Sep 17 00:00:00 2001 From: Chin-Yun Yu Date: Tue, 2 Apr 2024 10:54:07 +0000 Subject: [PATCH] doc: unify docstring style --- kamui/utils.py | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/kamui/utils.py b/kamui/utils.py index d1c66e1..b590b14 100644 --- a/kamui/utils.py +++ b/kamui/utils.py @@ -10,12 +10,17 @@ def get_2d_edges_and_simplices( """ Compute the edges and simplices for a 2D grid. - Args: - shape (Tuple[int, int]): The shape of the grid. - cyclical_axis (Union[int, Tuple[int, int]], optional): The axis/axes that should be treated as cyclical. Defaults to (). + Parameters + ---------- + shape : Tuple[int, int] + The shape of the grid. + cyclical_axis : Union[int, Tuple[int, int]], optional + The axis/axes that should be treated as cyclical. Defaults to (). - Returns: - Tuple[np.ndarray, Iterable[Iterable[int]]]: A tuple containing the edges and simplices of the grid. + Returns + ------- + Tuple[np.ndarray, Iterable[Iterable[int]]] + A tuple containing the edges and simplices of the grid. """ nodes = np.arange(np.prod(shape)).reshape(shape) if type(cyclical_axis) is int: @@ -83,12 +88,17 @@ def get_3d_edges_and_simplices( """ Compute the edges and simplices for a 3D grid. - Args: - shape (Tuple[int, int, int]): The shape of the grid. - cyclical_axis (Union[int, Tuple[int, int]], optional): The axis/axes that should be treated as cyclical. Defaults to (). + Parameters + ---------- + shape : Tuple[int, int, int] + The shape of the grid. + cyclical_axis : Union[int, Tuple[int, int]], optional + The axis/axes that should be treated as cyclical. Defaults to (). - Returns: - Tuple[np.ndarray, Iterable[Iterable[int]]]: A tuple containing the edges and simplices of the grid. + Returns + ------- + Tuple[np.ndarray, Iterable[Iterable[int]]] + A tuple containing the edges and simplices of the grid. """ nodes = np.arange(np.prod(shape)).reshape(shape) if type(cyclical_axis) is int: