neogen icon indicating copy to clipboard operation
neogen copied to clipboard

Numpydoc class attributes missing type in templating

Open daria-shaw opened this issue 1 year ago • 0 comments

The numpydoc style guide lists non-method class attributes with type and description, similar to function parameter docstrings.

eg

Attributes
----------
x : float
    Description of attribute `x`.
y : float
    Description of attribute `y`.

It looks like at the moment the numpydoc template only templates out type for function parameters.

When running :Neogen on the my dummy class I get the following docstring:

class DummyClass:
    """[TODO:description]

    Attributes
    ----------
    x : [TODO:attribute]
    y : [TODO:attribute]

    """
    x: int
    y: float

Ideally I'd like to see

"""
...
    Attributes
    ----------
    x : int
        [TODO:description]
    y : float
        [TODO:description]
...
"""

Should type be a part of class attribute docstrings?

daria-shaw avatar Aug 27 '24 06:08 daria-shaw