Class Automatic Documentation not appearing

Answered

Hi!. I'm in the same situation as the person in this post: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360006865800-Auto-template-for-function-class-documentation-

When I type """ in the start of the class, with methods and attributes declared nothing happens. I've checked my Settings and NumpyDoc is selected, but when I try to do it inside the methods it appears correctly.

What can I do to fix it?

 

0
2 comments

Hi,
What kind of docstring do you expect to be generated for a class?

The docstring generated for a function has the following:

Returns
-------

Since a class itself doesn't return anything, there is no such section.

If you are expecting the attributes, then please vote for the following ticket https://youtrack.jetbrains.com/issue/PY-22464

0
Avatar
Permanently deleted user

From what I've seen on this page https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard
I expected something like this (retrieved from that page):

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

    ...

    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.

    """
I would expect an autocompleted attributes & methods docstring lines based on what is on the class
0

Please sign in to leave a comment.