abnowack / pytracer

Active Neutron Interrogation modelling program
MIT License
1 stars 3 forks source link

Add Documentation #2

Open abnowack opened 9 years ago

abnowack commented 9 years ago

Most classes, methods, functions do not have any docstrings for documentation. PEP 0257 describes the standard format

Single line

def kos_root():
    """Return the pathname of the KOS root directory."""

Multi-Line

def complex(real=0.0, imag=0.0):
    """Form a complex number.

    Keyword arguments:
    real -- the real part (default 0.0)
    imag -- the imaginary part (default 0.0)
    """
    if imag == 0.0 and real == 0.0:
        return complex_zero
abnowack commented 9 years ago

Several formats are available which describe what text to write (args, return values, descriptions) Most popular are

Additionally meta text format specifiers are also used, such as Markdown and reStructuredText (reST) Sphinx is a common documentation generator and uses reST. In general reST is more popular than Markdown for python docstrings