nbdev_template icon indicating copy to clipboard operation
nbdev_template copied to clipboard

Doctoring formatting?

Open dsm-72 opened this issue 3 years ago • 0 comments

Here is an example of an nbdev project I have created: https://dsm-72.github.io/sugar/

I am using what I believe to be proper docstrings, e.g.

def validate_sigma(
    sigma:SigmaType, 
    logger:Optional[logging.Logger]=None
) -> None:
    '''
    Notes:
    ---------
        - `sigma` (Gaussian kernel bandwidth)
            + `"std"`: standard deviation of the distances
            + `"knn"`: adaptive bandwidth, eg kth neighbor distance
            + `"minmax"`: min-max on the distance matrix
            + `"median"`: the median of the distances
            + `callable`: a function, f, such that f(d) returns a scalar or N-length vector
                where d is an NxN distance matrix
            + `scalar`: pre-computed bandwidth

    Arguments:
    ----------
        sigma (str | Callable): The type of sigma function to use or a user defined function. 
            Valid `sigma` values include `"minmax"`, `"median"`, `"std"`, `"knn"`. Defaults to 
            `"knn"`.
            
        logger (logging.Logger): The logger to which to log to. Defaults to `None`.
    
    Returns:
    ----------
        None
    '''

but it renders weird on pages. What style guide should I be using for documentation?

dsm-72 avatar May 30 '22 19:05 dsm-72