jdavidrcamacho / Gedi

The use of Gaussian processes in the analysis of radial velocity measurements if you are into those things.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Documentation for your functions

DanielAndreasen opened this issue · comments

Hi João,

I recommend you put the documentations, that you have been so careful to write, on top of each function, but not outside them. Something like this

def add(a, b):
    '''This will add to numbers
    Inputs:
      a : float
    etc...
    '''

Now, if you import this function into e.g. IPython you can do either add? or doc(add) to actually see the documentation. Nobody wants to read the source code unless necessary :)
You can try it yourself with

import numpy as np
np.random?

The ? only works for IPython and not a regular python shell.

I'll do that! Thanks :D

And then you can also sphix-autodoc to auto build the documentation of the classes and functions.

The napoleon extension allow you to use the google or numpy style when generating the auto-docs instead of having to put them as ReStructuredText . (Examples of the styles are shown in napoleon link)