1 Model
Model()A model of inland water resources systems.
1.1 Attributes
1.2 Methods
| Name | Description |
|---|---|
| model_post_init | |
| node_table | Compute the full sorted NodeTable from all node types. |
| plot | Plot the nodes, links and allocation networks of the model. |
| plot_control_listen | Plot the implicit listen links of the model. |
| read | Read a model from a TOML file. |
| set_crs | Set the coordinate reference system of the data in the model. |
| set_filepath | Set the filepath of this instance. |
| to_crs | |
| to_xugrid | Convert the network to a xugrid.UgridDataset. |
| write | Write the contents of the model to disk and save it as a TOML configuration file. |
1.2.1 model_post_init
Model.model_post_init(__context)1.2.2 node_table
Model.node_table()Compute the full sorted NodeTable from all node types.
1.2.3 plot
Model.plot(ax=None, indicate_subnetworks=True, aspect_ratio_bound=0.33)Plot the nodes, links and allocation networks of the model.
1.2.3.1 Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| ax | matplotlib.pyplot.Artist | Axes on which to draw the plot. | None |
| indicate_subnetworks | bool | Whether to indicate subnetworks with a convex hull backdrop. | True |
| aspect_ratio_bound | float | The maximal aspect ratio in (0,1). The smaller this number, the further the figure shape is allowed to be from a square | 0.33 |
1.2.3.2 Returns
| Name | Type | Description |
|---|---|---|
| ax | matplotlib.pyplot.Artist | Axis on which the plot is drawn. |
1.2.4 plot_control_listen
Model.plot_control_listen(ax)Plot the implicit listen links of the model.
1.2.5 read
Model.read(filepath)Read a model from a TOML file.
1.2.5.1 Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| filepath | str | PathLike[str] | The path to the TOML file. | required |
1.2.6 set_crs
Model.set_crs(crs)Set the coordinate reference system of the data in the model.
1.2.6.1 Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| crs | str | Coordinate reference system, like “EPSG:4326” for WGS84 latitude longitude. | required |
1.2.7 set_filepath
Model.set_filepath(filepath)Set the filepath of this instance.
Args: filepath (Path): The filepath to set.
1.2.8 to_crs
Model.to_crs(crs)1.2.9 to_xugrid
Model.to_xugrid(add_flow=False, add_allocation=False)Convert the network to a xugrid.UgridDataset.
Either the flow or the allocation data can be added, but not both simultaneously. This method will throw ImportError if the optional dependency xugrid isn’t installed.
1.2.9.1 Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| add_flow | bool | add flow results (Optional, defaults to False) | False |
| add_allocation | bool | add allocation results (Optional, defaults to False) | False |
1.2.10 write
Model.write(filepath)Write the contents of the model to disk and save it as a TOML configuration file.
If filepath.parent does not exist, it is created before writing.
1.2.10.1 Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| filepath | str | PathLike[str] | A file path with .toml extension. | required |