Model

class rameau.core.Model(tree, inputs, init_states=None, simulation_settings=None, optimization_settings=None, forecast_settings=None, output_settings=None)[source]

Define a rameau model.

Parameters:
Returns:

Model

Examples

Constructing model from Tree and inputs.InputCollection.

>>> data = np.array([0.1, 0.2, 0.3])
>>> model = rm.Model(
...     tree=rm.Tree(watersheds=[{}]),
...     inputs=rm.inputs.InputCollection(rainfall=data, pet=data)
... )
>>> model.inputs.rainfall.data
array([[0.1],
       [0.2],
       [0.3]], dtype=float32)

Constructing model from dict.

>>> model = rm.Model(
...     tree=dict(watersheds=[{}]),
...     inputs=dict(rainfall=data, pet=data)
... )
>>> model.inputs.rainfall.data
array([[0.1],
       [0.2],
       [0.3]], dtype=float32)

Methods

create_simulation(**kwargs)

Create a simulation.

from_toml(path[, load_inputs])

Load a model from a TOML file.

get_input([variable])

Get model input data.

run_forecast([emission_date, scope, ...])

Start a forecast run.

run_optimization([maxit, starting_date, ...])

Start an optimisation run.

run_simulation([name, starting_date, ...])

Start a simulation run.

to_toml(path[, tree])

Dump the model to a TOML file.

Attributes

forecast_settings

Settings related to an forecast run.

init_states

Model initial states.

inputs

Model input data.

optimization_settings

Settings related to an optimization run.

output_settings

Settings related to simulation outputs.

simulation_settings

Settings related to a simulation run.

tree

Watershed connection tree of the model.