Skip to content

Commit

Permalink
tidy up doc
Browse files Browse the repository at this point in the history
  • Loading branch information
goktug97 committed Apr 13, 2021
1 parent 247cf19 commit 9c5042b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
extensions = [
'sphinx_rtd_theme',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.coverage',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode'
Expand Down
25 changes: 18 additions & 7 deletions docs/reference.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
Reference
=========

.. autoclass:: pipcs.InvalidChoiceError
.. currentmodule:: pipcs
.. autosummary::
:nosignatures:

Config
Choices
Condition
required
InvalidChoiceError
RequiredError

.. autoclass:: Config
:members:
.. autoclass:: pipcs.RequiredError
:exclude-members: update
.. autoclass:: Choices
:members:
.. autoclass:: pipcs.required
.. autoclass:: Condition
:members:
.. autoclass:: pipcs.Condition
.. autoclass:: required
:members:
.. autoclass:: pipcs.Choices
.. autoclass:: InvalidChoiceError
:members:
.. autoclass:: pipcs.Config
.. autoclass:: RequiredError
:members:
:exclude-members: update
4 changes: 2 additions & 2 deletions pipcs/pipcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class required:


class Condition(Generic[T]):
"""To mark a variable as only valid if the condition is hold. It is used combined with :class:`pipcs.Choices`.
"""Mark a variable as valid, only if the condition is hold. It is used combined with :class:`pipcs.Choices`.
Args:
value (T): Value of the variable.
Expand Down Expand Up @@ -93,7 +93,7 @@ def __invert__(self):


class Choices(Generic[T]):
"""A class to specify valid choices for the configuration variable. :class:`pipcs.InvalidChoiceError` error will be raised when the user tries to set the variable to a non-valid choice in the inherited configuration.
"""Specify valid choices for a variable. :class:`pipcs.InvalidChoiceError` error will be raised when the user tries to set the variable to a non-valid choice in the inherited configuration.
Args:
choices (List[T]): Valid choices for the configuration variable.
Expand Down

0 comments on commit 9c5042b

Please sign in to comment.