Skip to content

docstring guidelines

Michael Mommert edited this page Aug 2, 2018 · 1 revision

Please use this template for sbpy function docstrings (replace everything in <...>):

"""
<A short introduction of the function>

Parameters
----------
<parameter1> : <data type(s)>
     <a quick overview on what this parameter is, what data types
     are required, and how the data should be formatted>
<parameter2> : <data type(s)>, optional
    <label optional parameters and clearly indicate their 
    default value:>. Default: <value>

Notes
-----
<this provides more space to explain what the function does, optional>

References
----------
<list relevant references for this function, optional>

Returns
-------
<two options: either
 <object type that is returned by this function (or None)>
    or
 <output parameter name : output parameter type
      short synopsis of the output parameter>>

Examples
--------
>>> <example code>
"""

Function and class references

If you reference a class or a function, please use, e.g., `~sbpy.data.Ephem.from_mpc` which will create a direct link to this class/function in the API and display from_mpc. If you want to display the full path within the document, just use `sbpy.data.Ephem.from_mpc`.

Links

  • external links: target name as it appears in the text <http://...>_
Clone this wiki locally