Reuse legacy RGA/GAR configuration files

Create model from RGA/GAR files

Unlike rameau that relies on a TOML configuration file, previous (legacy) versions of the Gardenia model relied on configuration files with custom extensions *.rga and *.gar.

In order to guarantee backward compatibility with older versions of GARDENIA, there is a utility that allows to create a Model from those files.

import rameau.utils as rmu

model = rmu.create_model_from_rga_gar(
    'model.rga', 'model.gar', gardenia_version='8.8.1'
)

Run a simulation

Once the Model instance is created, it will behave exactly as if it was created from a TOML configuration file. For example, we can run a simulation and plot the outputs.

sim = model.run_simulation()
ax = sim.get_output('riverflow').plot(ylabel='streamflow [m$^3$.s$^{-1}$]')
Matplotlib is building the font cache; this may take a moment.
../../_images/535b2c530369b6216bcca7713c1722eab9dd2f4f1f31fac312be883f62079ed3.png
ax = sim.get_output('watertable').plot(ylabel='piezometric level [m]')
../../_images/c2075c2ca8d5c23d364440a502cb9428676f58c4cb6aa49c76e7772beb93c8c9.png