hydromt_delwaq.components.DemissionGeometryComponent#

Summary of Methods and Attributes#

class hydromt_delwaq.components.DemissionGeometryComponent(model: Model, *, filename: str = 'config/B7_geometry.inc')[source]#

Bases: ModelComponent

Demission geometry component.

Inherits from the HydroMT-core ModelComponent. Handles the Demission geometry file as a Pandas DataFrame.

Columns of the DataFrame are:

  • TotArea: area of the segment

  • fPaved: fraction of the segment that is paved

  • fUnpaved: fraction of the segment that is unpaved

  • fOpenWater: fraction of the segment that is open water

Initialize a DemissionGeometryComponent.

Parameters:
  • model (Model) – HydroMT model instance

  • filename (str) – The path to use for reading and writing of component data by default. By default “config/B7_geometry.inc”.

property data: DataFrame#

Return the geometry DataFrame.

set(data: DataFrame) None[source]#

Add geometry data.

Parameters:

data (pd.DataFrame) – DataFrame with geometry data.

read() None[source]#

Read geometry file in ASCII format at <root>/filename.

write()[source]#

Write geometry at <root/config> in ASCII and binary format.

test_equal(other: ModelComponent) tuple[bool, dict[str, str]][source]#

Test if two geometry components are equal.

Parameters:

other (ModelComponent) – The component to compare against.

Returns:

True if the components are equal, and a dict with the associated errors per property checked.

Return type:

tuple[bool, dict[str, str]]

close() None#

Clean up all open datasets. Method to be called before finish_write.

property data_catalog: DataCatalog#

Return the data catalog of the model this component is associated with.

finish_write()#

Finish the write functionality after cleanup was called for all components in the model.

All DeferredFileClose objects can overwrite any lazy loaded files now.

property model: Model#

Return the model object this component is associated with.

property name_in_model: str#

Find the name of the component in the parent model components.

property root: ModelRoot#

Return the root of the model this component is associated with.