Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

NumpyDoc: Default value can be specified as part of the type #69

Copy link
Copy link
@lars-reimann

Description

@lars-reimann
Issue body actions

At the moment, the NumpydocParser only looks at the description of a parameter to find its default value (relevant code).

However, the numpydoc style guide also allows specifying the default value as part of the type (source):

Optional keyword parameters have default values, which are displayed as part of the function signature. They can also be detailed in the description: [...] or as part of the type, instead of optional. If the default value would not be used as a value, optional is preferred. These are all equivalent:

copy : bool, default True
copy : bool, default=True
copy : bool, default: True

This is, for example, used by scikit-learn.

Moreover, the default value should be removed from the type_name property of DocstringParam, just like optional.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.