-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Labels
docA documentation issueA documentation issue
Description
We started to use mypy for python, but IMHO, I think we should also rely on it for the documentation generation.
For example, in the dealunay_complex.py, we say:
def __init__(
self,
points: Sequence[Sequence[float]] = [],
weights: Optional[Sequence[float]] = None,
precision: Literal["fast", "safe", "exact"] = "safe",
):
"""Args:
points (Sequence[Sequence[float]]): A list of points in d-Dimension.
weights (Optional[Sequence[float]]): A list of weights. If set, the number of weights must correspond to
the number of points.
precision (str): Complex precision can be `'fast'`, `'safe'` or `'exact'`. Default is `'safe'`.
:raises ValueError: In case of inconsistency between the number of points and weights.
"""which gives the following documentation:
But, if we rely on mypy for the arguments type detection when sphinx generates the documentation (here I remove the arguments types in between parenthesis):
def __init__(
self,
points: Sequence[Sequence[float]] = [],
weights: Optional[Sequence[float]] = None,
precision: Literal["fast", "safe", "exact"] = "safe",
):
"""Args:
points: A list of points in d-Dimension.
weights: A list of weights. If set, the number of weights must correspond to
the number of points.
precision: Complex precision can be `'fast'`, `'safe'` or `'exact'`. Default is `'safe'`.
:raises ValueError: In case of inconsistency between the number of points and weights.
"""The documentation looks like:

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
docA documentation issueA documentation issue