hydromt.model.components.TablesComponent#
- class hydromt.model.components.TablesComponent(model: Model, filename: str = 'tables/{name}.csv')[source]#
TablesComponent contains data as a dictionary of pandas.DataFrame.
It is well suited to represent non-geospatial tabular model data.
Initialize a TablesComponent.
- Parameters:
model (
Model
) – HydroMT model instancefilename (
str
) – The default place that should be used for reading and writing unless the user overrides it. If a relative path is given it will be used as being relative to the model root. By default tables/{name}.csv for this component, and can be either relative or absolute.
- __init__(model: Model, filename: str = 'tables/{name}.csv')[source]#
Initialize a TablesComponent.
- Parameters:
model (
Model
) – HydroMT model instancefilename (
str
) – The default place that should be used for reading and writing unless the user overrides it. If a relative path is given it will be used as being relative to the model root. By default tables/{name}.csv for this component, and can be either relative or absolute.
Methods
__init__
(model[, filename])Initialize a TablesComponent.
get_tables_merged
()Return all tables of a model merged into one dataframe.
read
([filename])Read tables at provided or default filepath if none is provided.
set
(tables[, name])Add (a) table(s) <pandas.DataFrame> to model.
test_equal
(other)Test if two components are equal.
write
([filename])Write tables at provided or default filepath if none is provided.
Attributes
Model tables.
Return the data catalog of the model this component is associated with.
Return the model object this component is associated with.
Return the root of the model this component is associated with.