Skip to content
This repository has been archived by the owner on Jul 2, 2019. It is now read-only.

Write docstrings for all functions in inferenceTools #94

Open
nrweir opened this issue Nov 27, 2018 · 1 comment
Open

Write docstrings for all functions in inferenceTools #94

nrweir opened this issue Nov 27, 2018 · 1 comment

Comments

@nrweir
Copy link
Collaborator

nrweir commented Nov 27, 2018

Write docstrings for all functions

We need to begin writing docstrings for all of the functions in the package.

Important components:

  • Single-line (<80 character) one-line summary.
  • Description of each argument, including type, possible value(s), whether or not the argument is required, and any other important information for the user to understand how to use that argument.
  • Description of what the function returns, including type and any other information required to understand the outputs.
  • Any further description needed to understand usage.

Example:

def rescale_image(image_input, lower_limit=0, upper_limit=255):
    """Re-scale image intensities.
    
    Arguments:
    ------------
    image_input (numpy array of ints, required): An image in numpy array format. Values should be 
        integers.
    lower_limit (int, optional): Lower limit for original pixel intensity values. Defaults to 0.
    upper_limit(int, optional): Upper limit for original pixel intensity values. Defaults to 255.

    Returns:
    ---------
    A numpy array of the same dtype with values in the range (lower_limit, upper_limit)
    rescaled to [0, 255].
    """
    
    (Function defined here)

Format: If authors want to add docstrings in whatever format you like, feel free, but these will eventually need to be formatted according to Sphinx formats, so if you put in the work to use that style you'll be cutting out future re-structuring effort.

@nrweir nrweir self-assigned this Nov 27, 2018
@nrweir nrweir added this to the v4.0 milestone Nov 27, 2018
@nrweir nrweir changed the title Write docstrings for all functions Write docstrings for all functions in inferenceTools Dec 3, 2018
@nrweir
Copy link
Collaborator Author

nrweir commented Dec 3, 2018

Going to focus on inferenceTools as the starting example. Building off of #106 to include sphinx-formatted stuff.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant