From f98b9bba02983b02593e6ddcc073478be99e1f59 Mon Sep 17 00:00:00 2001 From: BO ZHANG Date: Tue, 23 Aug 2022 21:33:34 +0800 Subject: [PATCH] updated docstring --- csst_proto/flip_image.py | 8 +++++--- csst_proto/some_other_modules.py | 3 +++ csst_proto/top_level_interface.py | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/csst_proto/flip_image.py b/csst_proto/flip_image.py index b8cb643..f49510f 100644 --- a/csst_proto/flip_image.py +++ b/csst_proto/flip_image.py @@ -4,7 +4,7 @@ from . import PACKAGE_PATH # the main algorithm -def flip_image(img: np.ndarray): +def flip_image(img: np.ndarray) -> np.ndarray: """ flip an input image This function uses an awesome algorithm to flip an input image. @@ -16,14 +16,16 @@ def flip_image(img: np.ndarray): Returns ------- - the flipped image + img_flipped: np.ndarray + the flipped image """ try: assert img.ndim == 2 + img_flipped = img[::-1, ::-1] + return img_flipped except AssertionError: raise AssertionError("The input image is {}D not 2D!".format(img.ndim)) - return img[::-1, ::-1] # a demo on how to read test image diff --git a/csst_proto/some_other_modules.py b/csst_proto/some_other_modules.py index e69de29..9be71bf 100644 --- a/csst_proto/some_other_modules.py +++ b/csst_proto/some_other_modules.py @@ -0,0 +1,3 @@ +def some_arbitrary_functions(): + """ an arbitrary function """ + return diff --git a/csst_proto/top_level_interface.py b/csst_proto/top_level_interface.py index d5b7afb..8c9ad77 100644 --- a/csst_proto/top_level_interface.py +++ b/csst_proto/top_level_interface.py @@ -1,4 +1,5 @@ from .flip_image import flip_image, read_test_image +from .some_other_modules import some_arbitrary_functions -__all__ = ["flip_image", "read_test_image"] +__all__ = ["flip_image", "read_test_image", "some_arbitrary_functions"] -- GitLab