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

DOC: include positional-only and keyword-only parameters in standard #367

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
9 changes: 8 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,14 @@
# master_doc = "index" # NOTE: will be changed to `root_doc` in sphinx 4

numpydoc_xref_param_type = True
numpydoc_xref_ignore = {"optional", "type_without_description", "BadException"}
numpydoc_xref_ignore = {
"optional",
"type_without_description",
"BadException",
"keyword-only",
"positional-only",
}

# Run docstring validation as part of build process
numpydoc_validation_checks = {"all", "GL01", "SA04", "RT03"}

Expand Down
7 changes: 7 additions & 0 deletions doc/format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,13 @@ used as a value, ``optional`` is preferred. These are all equivalent::
copy : bool, default=True
copy : bool, default: True

Use ``positional-only`` for positional-only parameters, and ``keyword-only``
for keyword-only parameters::

x : int, positional-only
y : int, keyword-only
z : int, keyword-only, optional

When a parameter can only assume one of a fixed set of values,
those values can be listed in braces, with the default appearing first::

Expand Down
2 changes: 1 addition & 1 deletion doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ numpydoc_xref_ignore : set or ``"all"``
used in parameter type descriptions that may be confused for
classes of the same name. For example::

numpydoc_xref_ignore = {'type', 'optional', 'default'}
numpydoc_xref_ignore = {'type', 'optional', 'default', 'keyword-only', 'positional-only'}

The default is an empty set.

Expand Down
Loading