Loading csst_proto/__init__.py +5 −0 Original line number Diff line number Diff line import os from .top_level_interface import * __version__ = "0.0.1" PACKAGE_PATH = os.path.dirname(__file__) csst_proto/data/data.csv 0 → 100644 +3 −0 Original line number Diff line number Diff line a, b, c 1,2,3 4,5,6 No newline at end of file csst_proto/flip_image.py +35 −0 Original line number Diff line number Diff line import numpy as np from astropy import table from . import PACKAGE_PATH # the main algorithm def flip_image(img: np.ndarray): """ flip an input image This function uses an awesome algorithm to flip an input image. Parameters ---------- img: the input image Returns ------- the flipped image """ try: assert img.ndim == 2 except AssertionError: raise AssertionError("The input image is {}D not 2D!".format(img.ndim)) return img[::-1, ::-1] # a demo on how to package data def print_data(): """ print out data """ fp_data = PACKAGE_PATH + "/data/data.csv" data = table.Table.read(fp_data) print(data) return csst_proto/data/your_data.txt→csst_proto/some_other_modules.py +0 −0 File moved. csst_proto/top_level_interface.py 0 → 100644 +4 −0 Original line number Diff line number Diff line from .flip_image import flip_image, print_data __all__ = ["flip_image", "print_data"] Loading
csst_proto/__init__.py +5 −0 Original line number Diff line number Diff line import os from .top_level_interface import * __version__ = "0.0.1" PACKAGE_PATH = os.path.dirname(__file__)
csst_proto/data/data.csv 0 → 100644 +3 −0 Original line number Diff line number Diff line a, b, c 1,2,3 4,5,6 No newline at end of file
csst_proto/flip_image.py +35 −0 Original line number Diff line number Diff line import numpy as np from astropy import table from . import PACKAGE_PATH # the main algorithm def flip_image(img: np.ndarray): """ flip an input image This function uses an awesome algorithm to flip an input image. Parameters ---------- img: the input image Returns ------- the flipped image """ try: assert img.ndim == 2 except AssertionError: raise AssertionError("The input image is {}D not 2D!".format(img.ndim)) return img[::-1, ::-1] # a demo on how to package data def print_data(): """ print out data """ fp_data = PACKAGE_PATH + "/data/data.csv" data = table.Table.read(fp_data) print(data) return
csst_proto/top_level_interface.py 0 → 100644 +4 −0 Original line number Diff line number Diff line from .flip_image import flip_image, print_data __all__ = ["flip_image", "print_data"]