Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Numpy Doc Processing for Help Command #8

Open
trevorflahardy opened this issue Feb 28, 2022 · 0 comments
Open

Implement Numpy Doc Processing for Help Command #8

trevorflahardy opened this issue Feb 28, 2022 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@trevorflahardy
Copy link
Contributor

trevorflahardy commented Feb 28, 2022

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"])
@trevorflahardy trevorflahardy added the enhancement New feature or request label Feb 28, 2022
@trevorflahardy trevorflahardy self-assigned this Feb 28, 2022
@LeoCx1000 LeoCx1000 added the documentation Improvements or additions to documentation label Feb 28, 2022
@LeoCx1000 LeoCx1000 removed their assignment Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
Status: in progress
Development

No branches or pull requests

2 participants