Loading csst_proto/flip_image.py +5 −3 Original line number Diff line number Diff line Loading @@ -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. Loading @@ -16,14 +16,16 @@ def flip_image(img: np.ndarray): Returns ------- 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 Loading csst_proto/some_other_modules.py +3 −0 Original line number Diff line number Diff line def some_arbitrary_functions(): """ an arbitrary function """ return csst_proto/top_level_interface.py +2 −1 Original line number Diff line number Diff line 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"] Loading
csst_proto/flip_image.py +5 −3 Original line number Diff line number Diff line Loading @@ -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. Loading @@ -16,14 +16,16 @@ def flip_image(img: np.ndarray): Returns ------- 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 Loading
csst_proto/some_other_modules.py +3 −0 Original line number Diff line number Diff line def some_arbitrary_functions(): """ an arbitrary function """ return
csst_proto/top_level_interface.py +2 −1 Original line number Diff line number Diff line 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"]