# Python API¶

## Pumping Station Mixin¶

class rtctools_hydraulic_structures.pumping_station_mixin.Pump(optimization_problem, symbol)[source]

Bases: rtctools_hydraulic_structures.util._ObjectParameterWrapper

Python Pump object as an interface to the Pump object in the model.

discharge()[source]

Get the state corresponding to the pump discharge.

Returns: MX expression of the pump discharge.
head()[source]

Get the state corresponding to the pump head. This depends on the head_option that was specified by the user.

Returns: MX expression of the pump head.
class rtctools_hydraulic_structures.pumping_station_mixin.Resistance(optimization_problem, symbol)[source]

Bases: rtctools_hydraulic_structures.util._ObjectParameterWrapper

Python Resistance object as an interface to the Resistance object in the model.

discharge()[source]

Get the state corresponding to the discharge through the resistance.

Returns: MX expression of the discharge.
head_loss()[source]

Get the state corresponding to the head loss over the resistance.

Returns: MX expression of the head loss.
class rtctools_hydraulic_structures.pumping_station_mixin.PumpingStation(optimization_problem, symbol, pump_symbols=None, **kwargs)[source]

Bases: rtctools_hydraulic_structures.util._ObjectParameterWrapper

Python PumpingStation object as an interface to the PumpingStation object in the model.

__init__(optimization_problem, symbol, pump_symbols=None, **kwargs)[source]

Initialize the pumping station object.

Parameters: optimization_problem – OptimizationProblem instance. symbol – Symbol name of the pumping station in the model. pump_symbols – Symbol names of the pumps in the pumping station.
pumps()[source]

Get a list of Pump objects that are part of this pumping station in the model.

Returns: List of Pump objects.
resistances()[source]

Get a list of Resistance objects that are part of this pumping station in the model.

Returns: List of Resistance objects.
class rtctools_hydraulic_structures.pumping_station_mixin.PumpingStationMixin(*args, **kwargs)[source]

Relevant parameters and variables are read from the model, and from this data a set of constraints and objectives are automatically generated to minimize cost.

pumping_stations()[source]

User problem returns list of PumpingStation objects.

Returns: A list of pumping stations.
rtctools_hydraulic_structures.pumping_station_mixin.plot_operating_points(optimization_problem, output_folder, plot_expanded_working_area=True)[source]

Plot the working area of each pump with its operating points.

## Weir Mixin¶

class rtctools_hydraulic_structures.weir_mixin.Weir(optimization_problem, name)[source]

Bases: rtctools_hydraulic_structures.util._ObjectParameterWrapper

Python Weir object as an interface to the Weir object in the model.

In the optimization, the weir flow is implemented as constraints. It means that the optimization calculated a flow (not weir height!), that is forced by the constraints to be a physically possible weir flow.

discharge()[source]

Get the state corresponding to the weir discharge.

Returns: MX expression of the weir discharge.
class rtctools_hydraulic_structures.weir_mixin.WeirMixin(*args, **kwargs)[source]

weirs()[source]
User problem returns list of Weir objects.