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

How to exclude an API member from being processed by numpydoc #479

Open
HealthyPear opened this issue Jul 24, 2023 · 0 comments
Open

How to exclude an API member from being processed by numpydoc #479

HealthyPear opened this issue Jul 24, 2023 · 0 comments

Comments

@HealthyPear
Copy link

Context

I need type annotations and this project doesn't support this yet (#196, #356)- I tested out successfully sphinx.ext.napoleon, but that project doesn't provide a validator (crazy, right?), so here I am, awkwardly in the middle of two lovers.

Feature request

Regardless if during Sphinx build or from the pre-commit hook, I would like to specify a list of API members to ignore.

Numpydoc already provides numpydoc_validation_exclude, but that is indeed for validation, not the whole thing.

In fact what I get if I use the following configuration,

extensions = [
    "numpydoc",
    "sphinx.ext.autodoc",
    "sphinx_automodapi.automodapi",
    "sphinx.ext.napoleon",
]
napoleon_numpy_docstring = True
numpydoc_show_class_members = False
# Report warnings for all validation checks except those specified after "all"
numpydoc_validation_checks = {"all", "ES01", "SA01", "EX01", "RT02"}
# for why we currently ignore "RT02" see https://github.com/numpy/numpydoc/issues/244
numpydoc_validation_exclude = {
    "my_module.greeting",
}

with the following function,

def greeting(name: str) -> str:
    """
    Perform a greeting.

    Parameters
    ----------
    name
        Name to use.

    Returns
    -------
    greeting
        The greeting.
    """
    greeting = "Hello " + name
    return greeting

Is this (see that the Parameters section is doubled)?

image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant