class documentation
class NumpyDocstring(GoogleDocstring): (source)
Convert NumPy style docstrings to reStructuredText.
Example
>>> from pydoctor.napoleon import NumpyDocstring >>> docstring = '''One line summary. ... ... Extended description. ... ... Parameters ... ---------- ... arg1 : int ... Description of `arg1` ... arg2 : str ... Description of `arg2` ... Returns ... ------- ... str ... Description of return value. ... ''' >>> print(NumpyDocstring(docstring)) One line summary. Extended description. :param arg1: Description of `arg1` :type arg1: int :param arg2: Description of `arg2` :type arg2: str :returns: Description of return value. :returntype: str >>> print(NumpyDocstring(docstring, process_type_fields=True)) One line summary. Extended description. :param arg1: Description of `arg1` :type arg1: `int` :param arg2: Description of `arg2` :type arg2: `str` :returns: Description of return value. :returntype: `str`
Method | _consume |
No summary |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _convert |
Same as _convert_type , but can raise FreeFormException . |
Method | _escape |
Undocumented |
Method | _is |
Undocumented |
Method | _is |
Undocumented |
Method | _parse |
Derived from the NumpyDoc implementation of _parse_see_also. |
Method | _parse |
Undocumented |
Inherited from GoogleDocstring
:
Method | __init__ |
No summary |
Method | __str__ |
Return the parsed docstring in reStructuredText format. |
Method | lines |
Return the parsed lines of the docstring in reStructuredText format. |
Instance Variable | warnings |
Warning messages triggered during the conversion. |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _convert |
Tokenize the string type and convert it with additional markup and auto linking, with L{TypeDocstring}. |
Method | _dedent |
Undocumented |
Method | _fix |
Undocumented |
Method | _format |
Undocumented |
Method | _format |
Undocumented |
Method | _format |
Undocumented |
Method | _format |
Undocumented |
Method | _format |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _indent |
Undocumented |
Method | _is |
Undocumented |
Method | _is |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _partition |
Undocumented |
Method | _partition |
Partition multiple lines on colon. If the type or name span multiple lines, they will be automatically joined. |
Method | _strip |
Undocumented |
Class Variable | _name |
Undocumented |
Instance Variable | _is |
Undocumented |
Instance Variable | _is |
Undocumented |
Instance Variable | _line |
Undocumented |
Instance Variable | _parsed |
Undocumented |
Instance Variable | _process |
Undocumented |
Instance Variable | _section |
Undocumented |
Instance Variable | _sections |
Undocumented |
def _consume_field(self, parse_type=True, prefer_type=False, allow_free_form=False, **kwargs):
(source)
¶
Parameters | |
parsebool | Undocumented |
preferbool | Undocumented |
allowbool | Undocumented |
**kwargs:Any | Undocumented |
Returns | |
Field | Undocumented |
Raises | |
FreeFormException | If allow_free_form=True and the type do not match is_type check.
See _convert_type_and_maybe_consume_free_form_field . |
def _convert_type_and_maybe_consume_free_form_field(self, _name, _type, allow_free_form=False):
(source)
¶
Same as _convert_type
, but can raise FreeFormException
.
Parameters | |
_name:str | Undocumented |
_type:str | Undocumented |
allowbool | Undocumented |
Returns | |
str | Undocumented |
Raises | |
FreeFormException | If allow_free_form=True and _type do not match is_type check. |
Derived from the NumpyDoc implementation of _parse_see_also.
Parses this kind of see also sections:
See Also -------- func_name : Descriptive text continued text another_func_name : Descriptive text func_name1, func_name2, `func_name`, func_name3
Parameters | |
content:List[ | Undocumented |
Returns | |
List[ | Undocumented |