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: hydpy.core.modeltools.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: hydpy.core.sequencetools.Sequences, cls_fastaccess: Optional[Type[FastAccessType]] = None, cymodel: Optional[hydpy.core.typingtools.CyModelProtocol] = None)

Bases: hydpy.core.sequencetools.OutputSequences[FluxSequence]

Flux sequences of model dummy_v1.

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

class hydpy.models.dummy_v1.InletSequences(master: hydpy.core.sequencetools.Sequences, cls_fastaccess: Optional[Type[FastAccessType]] = None, cymodel: Optional[hydpy.core.typingtools.CyModelProtocol] = None)

Bases: hydpy.core.sequencetools.LinkSequences[InletSequence]

Inlet sequences of model dummy_v1.

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

class hydpy.models.dummy_v1.OutletSequences(master: hydpy.core.sequencetools.Sequences, cls_fastaccess: Optional[Type[FastAccessType]] = None, cymodel: Optional[hydpy.core.typingtools.CyModelProtocol] = None)

Bases: hydpy.core.sequencetools.LinkSequences[OutletSequence]

Outlet sequences of model dummy_v1.

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