localPlannerBench icon indicating copy to clipboard operation
localPlannerBench copied to clipboard

Add in-code documentation via docstrings

Open niketagrawal opened this issue 2 years ago • 1 comments

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. 
    """

niketagrawal avatar Mar 10 '22 10:03 niketagrawal

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.

c-salmi avatar Jul 26 '22 07:07 c-salmi