Skip to content
how_to_write_docstring.py 436 B
Newer Older
BO ZHANG's avatar
BO ZHANG committed
import numpy as np


BO ZHANG's avatar
BO ZHANG committed
# a function to be finished
BO ZHANG's avatar
BO ZHANG committed
def cos_to_be_finished(x):
    # TODO: to be finished
    return


# a function with a simple docstring
def _cos(x):
    """ this is a cosine function """
    return np.cos(x)


# a function with a complete docstring
def cos(x: float = 0.):
    """ cosine function

    Parameters
    ----------
    x :
        x values

    Returns
    -------
    cos(x)

    """
    return np.cos(x)