diff --git a/doc/conf.py b/doc/conf.py index 315bac73..7369abdf 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 2f9753c5..839750d8 100644 --- a/doc/format.rst +++ b/doc/format.rst @@ -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:: diff --git a/doc/install.rst b/doc/install.rst index 480bd59a..867dfcbd 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -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.