Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in-code documentation via docstrings #15

Open
niketagrawal opened this issue Mar 10, 2022 · 1 comment
Open

Add in-code documentation via docstrings #15

niketagrawal opened this issue Mar 10, 2022 · 1 comment
Assignees

Comments

@niketagrawal
Copy link
Collaborator

Consider using module-level, class-level and function-level docstrings for describing the purpose of the module, description of the class or a function (especially when the function name and arguments can't convey what the function does).

Using the numpydoc documentation style for writing a docstring is recommended.

Required for function docstring:

  • One line description of what the function does
  • Description of the input parameters and their type
  • Description of the return parameters and their type

Examples:

def multiplication_table(zero_out_multiples=None):
    """Creates a multiplication table.
    Returns a two-dimensional NumPy array that contains the multiplication 
    table from 1 to 12.  
    
    Parameters
    -----------
    zero_out_multiples : int, optional
        When this parameter is set to an integer number, then the 
        multiplication table that is returned by the function will have all
        multiples of the given number set to zero. The default value of this 
        parameter is None.
    Returns
    -------
    array : ndarray
        A two-dimensional NumPy array that contains the multiplication table 
        from 1 to 12 with the multiples of zero_out_multiples paramaters 
        passed as argument set to zero. 
    """
@c-salmi
Copy link
Collaborator

c-salmi commented Jul 26, 2022

There has been progress on this issue, but it must still be verified. We need to make sure that at least all interfaces to users are well documented.

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

No branches or pull requests

3 participants