dummy_v1

Version 1 of the dummy model serves as a temporary placeholder model. In each simulation step, it simply sums up its inputs and hands the resulting value to the downstream node without modifications.

Integration tests

Note

When new to HydPy, consider reading section How to understand 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_v1 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_v1.Model[source]

Bases: AdHocModel

The HydPy-Dummy model.

The following “inlet update methods” are called in the given sequence at the beginning of each simulation step:
  • Pick_Q_V1 Query 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_V1 Uptdate the outlet link sequence.

class hydpy.models.dummy_v1.FluxSequences(master: Sequences, cls_fastaccess: Type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)

Bases: FluxSequences

Flux sequences of model dummy_v1.

The following classes are selected:
  • Q() Abfluss [m³/s].

class hydpy.models.dummy_v1.InletSequences(master: Sequences, cls_fastaccess: Type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)

Bases: InletSequences

Inlet sequences of model dummy_v1.

The following classes are selected:
  • Q() Abfluss (runoff) [m³/s].

class hydpy.models.dummy_v1.OutletSequences(master: Sequences, cls_fastaccess: Type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)

Bases: OutletSequences

Outlet sequences of model dummy_v1.

The following classes are selected:
  • Q() Abfluss (runoff) [m³/s].