Skip to content

Implement Numpy Doc Processing for Help Command #8

@trevorflahardy

Description

@trevorflahardy

Note: for branch rewrite

Let's document all coroutines with @commands.command() with a numpy doc style doc string. We'll later process the doc strings and build a pretty help command for the user. This will allow source to be neater as well. I found this while looking through this source

Take a look at how this could be done:

from numpydoc.docscrape import NumpyDocString


class Photo():
    """
    Array with associated photographic information.


    Parameters
    ----------
    x : type
        Description of parameter `x`.
    y
        Description of parameter `y` (with type not specified)

    Attributes
    ----------
    exposure : float
        Exposure in seconds.

    Methods
    -------
    colorspace(c='rgb')
        Represent the photo in the given colorspace.
    gamma(n=1.0)
        Change the photo's gamma exposure.

    """

    def __init__(x, y):
        print("Snap!")

doc = NumpyDocString(Photo.__doc__)
print(doc["Summary"])
print(doc["Parameters"])
print(doc["Attributes"])
print(doc["Methods"])

Metadata

Metadata

Labels

documentationImprovements or additions to documentationenhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

Status

in progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions