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/39d50b07c08e565759651169221d570b568ebf39769adf4d959bd5db81390008.png
ax = sim.get_output('watertable').plot(ylabel='piezometric level [m]')
../../_images/3e70b003a902f241c577da2c550062a5db8a49bdbad8324e7f2816950121a80e.png