HydPy-Dummy-Node2Node (dummy model passing data from inlet to outlet nodes)¶
dummy_node2node serves as a placeholder model. In each simulation step, it simply
sums up its inputs and hands the resulting value to the downstream node without
modifications.
In HydPy, it is fairly easy to introduce additional Element objects and thus bring
new models of arbitrary types into existing network structures. Hence, there is
typically no need to define dummy elements or models in anticipation of possible future
changes. However, application model dummy_node2node can help to more closely reflect
the actual network structures of other model systems as LARSIM, which are more
restrictive regarding future changes and network complexity.
Integration test¶
Note
When new to HydPy, consider reading section Integration Tests first.
We prepare a simulation period of three days:
>>> from hydpy import pub >>> pub.timegrids = "2000-01-01", "2000-01-04", "1d"The model object does not require any parameter information:
>>> from hydpy.models.dummy_node2node import * >>> parameterstep()We add the model object to an element connected to two inlet nodes and one outlet node and prepare a runnable test object:
>>> from hydpy import Element, IntegrationTest >>> element = Element("element", ... inlets=("inlet1", "inlet2"), ... outlets="outlet") >>> element.model = model >>> test = IntegrationTest(element)After defining two input series, we can demonstrate that each pair of values of the inlet nodes is summed up and handed to the outlet node:
>>> element.inlets.inlet1.sequences.sim.series = 0.0, 1.0, 2.0 >>> element.inlets.inlet2.sequences.sim.series = 0.0, 2.0, -4.0 >>> test() | date | q | inlet1 | inlet2 | outlet | --------------------------------------------------------- | 2000-01-01 00:00:00 | 0.0 | 0.0 | 0.0 | 0.0 | | 2000-01-02 00:00:00 | 3.0 | 1.0 | 2.0 | 3.0 | | 2000-01-03 00:00:00 | -2.0 | 2.0 | -4.0 | -2.0 |
- class hydpy.models.dummy_node2node.Model[source]¶
Bases:
AdHocModelHydPy-Dummy-Node2Node (dummy model passing data from inlet to outlet nodes).
- The following “inlet update methods” are called in the given sequence at the beginning of each simulation step:
Pick_Q_V1Query the current inflow from all inlet nodes.
- The following “outlet update methods” are called in the given sequence at the end of each simulation step:
Pass_Q_V1Update the outlet link sequence.
- REUSABLE_METHODS: ClassVar[tuple[type[ReusableMethod], ...]] = ()¶
- class hydpy.models.dummy_node2node.FluxSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
FluxSequencesFlux sequences of model dummy_node2node.
- The following classes are selected:
Q()Abfluss [m³/s].
- class hydpy.models.dummy_node2node.InletSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
InletSequencesInlet sequences of model dummy_node2node.
- The following classes are selected:
Q()Abfluss (runoff) [m³/s].
- class hydpy.models.dummy_node2node.OutletSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
OutletSequencesOutlet sequences of model dummy_node2node.
- The following classes are selected:
Q()Abfluss (runoff) [m³/s].