1 LinkTable
LinkTable()Defines the connections between nodes.
1.1 Attributes
| Name | Description |
|---|---|
| df | |
| filepath | |
| model_config |
1.2 Methods
| Name | Description |
|---|---|
| add | Add an link between nodes. |
| columns | Retrieve column names. |
| diff | |
| model_dump | |
| plot | Plot the links of the model. |
| set_filepath | Set the filepath of this instance. |
| sort | |
| tablename | Retrieve tablename based on attached Schema. |
| tableschema | Retrieve Pandera Schema. |
1.2.1 add
LinkTable.add(
from_node,
to_node,
geometry=None,
name='',
link_id=None,
**kwargs,
)Add an link between nodes.
The type of the link (flow or control) is automatically inferred from the type of the from_node.
1.2.1.1 Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| from_node | NodeData | A node indexed by its node ID, e.g. model.basin[1] |
required |
| to_node | NodeData | A node indexed by its node ID, e.g. model.linear_resistance[1] |
required |
| geometry | LineString | MultiLineString | None | The geometry of a line. If not supplied, it creates a straight line between the nodes. | None |
| name | str | An optional name for the link. | '' |
| link_id | int | An optional non-negative link ID. If not supplied, it will be automatically generated. | None |
| **kwargs | Dict | {} |
1.2.2 columns
LinkTable.columns()Retrieve column names.
1.2.3 diff
LinkTable.diff(other, ignore_meta=False)1.2.4 model_dump
LinkTable.model_dump(**kwargs)1.2.5 plot
LinkTable.plot(**kwargs)Plot the links of the model.
1.2.5.1 Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| **kwargs | Dict | Supported: ‘ax’, ‘color_flow’, ‘color_control’ | {} |
1.2.6 set_filepath
LinkTable.set_filepath(filepath)Set the filepath of this instance.
Args: filepath (Path): The filepath to set.
1.2.7 sort
LinkTable.sort()1.2.8 tablename
LinkTable.tablename()Retrieve tablename based on attached Schema.
NodeSchema -> Node TabularRatingCurveStaticSchema -> TabularRatingCurve / static
1.2.9 tableschema
LinkTable.tableschema()Retrieve Pandera Schema.
The type of the field df is known to always be an DataFrame[TableT]]] | None