diff --git a/doc/conf.py b/doc/conf.py index ca41a854..4454ecd4 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -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"} diff --git a/doc/format.rst b/doc/format.rst index ecdd1d4f..610b7039 100644 --- a/doc/format.rst +++ b/doc/format.rst @@ -212,6 +212,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:: diff --git a/doc/install.rst b/doc/install.rst index c72d777f..d2990199 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -91,7 +91,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.