DocstringsΒΆ
The docstrings should use the numpydoc format. The descriptions should not start with "this" and should use imperative mood. Docstrings should not contain type hints, since they are already specified in the code. Refer to the subsections below for more details on how to document specific API elements.
ModulesΒΆ
All modules should have
- A one-line description (short summary).
- A longer description if needed (extended summary).
Example:
ClassesΒΆ
All public classes should have
- A one-line description (short summary).
- A longer description if needed (extended summary).
- A description of the parameters of their
__init__method (Parameterssection). Specify a name and a description, with a colon to separate them. Omit types and default values. - Examples that show how to use them correctly (
Examplessection).
Example:
"""
A row is a collection of named values.
Parameters
----------
data:
The data. If None, an empty row is created.
Examples
--------
>>> from safeds.data.tabular.containers import Row
>>> row = Row({"a": 1, "b": 2})
"""
FunctionsΒΆ
All public functions should have
- A one-line description (short summary).
- A longer description if needed (extended summary).
- A description of their parameters (
Parameterssection). Specify a name and a description, with a colon to separate them. Omit types and default values. - A description of their results (
Returnssection). Specify a name and a description, with a colon to separate them. Omit types. - A description of any exceptions that may be raised and under which conditions that may
happen (
Raisessection). - A description of any warnings that may be issued and under which conditions that may
happen (
Warnssection). - Examples that show how to use them correctly (
Examplessection).
Example:
"""
Return the value of a specified column.
Parameters
----------
column_name:
The column name.
Returns
-------
value:
The column value.
Raises
------
UnknownColumnNameError
If the row does not contain the specified column.
Examples
--------
>>> from safeds.data.tabular.containers import Row
>>> row = Row({"a": 1, "b": 2})
>>> row.get_cell("a")
1
"""