Commit 70025824 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

tweaks to fit Numpydoc standards

parent ef7266b8
Pipeline #174 passed with stages
in 13 seconds
import numpy as np import numpy as np
from astropy import table
from . import PACKAGE_PATH from . import PACKAGE_PATH
# the main algorithm # the main algorithm
def flip_image(img: np.ndarray) -> np.ndarray: def flip_image(img: np.ndarray) -> np.ndarray:
""" flip an input image """
Flip an input image.
This function uses an awesome algorithm to flip an input image. This function uses an awesome algorithm to flip an input image.
Parameters Parameters
---------- ----------
img: img : np.ndarray
the input image The input image.
Returns Returns
------- -------
img_flipped: np.ndarray np.ndarray
the flipped image The flipped image.
Examples
--------
>>> flip_image(np.array([1, 2], [3, 4]))
""" """
try: try:
assert img.ndim == 2 assert img.ndim == 2
...@@ -30,7 +33,20 @@ def flip_image(img: np.ndarray) -> np.ndarray: ...@@ -30,7 +33,20 @@ def flip_image(img: np.ndarray) -> np.ndarray:
# a demo on how to read test image # a demo on how to read test image
def read_test_image(): def read_test_image():
""" read test image """ """
Read test image.
This function reads the test image associated with this package.
Returns
-------
np.ndarray
The test image.
Examples
--------
>>> test_image = read_test_image()
"""
fp_img = PACKAGE_PATH + "/data/test_image.txt" fp_img = PACKAGE_PATH + "/data/test_image.txt"
print("reading file {} ...".format(fp_img)) print("reading file {} ...".format(fp_img))
return np.loadtxt(fp_img, dtype=int) return np.loadtxt(fp_img, dtype=int)
def a_demo_function(*args): def a_demo_function(*args):
""" a demo function """ """
A demo function.
This function is a demo.
Parameters
----------
*args : any
The argument list.
Examples
--------
>>> a_demo_function(None)
"""
return None return None
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment