Description
When using the HydPy gland_gr6 model, two flow concentration submodels (rconcmodel_routingstore and rconcmodel_directflow) must be defined. Following the GR6 model concept implemented in HydPy, rconc_uh models with different parametrization are typically used for both. This issue likely also affects the HydPy gland_gr4 model due to its similar submodel structure, though this has not been explicitly tested yet.
When attempting to store the fluxes using hp.save_fluxes(), HydPy throws a registration error because both submodel instances attempt to write to the same NetCDF file (rconc_uh_flux_inflow.nc) using the same sequence names, despite having different data.
Error Traceback
When trying to log the time series of sequence `inflow` of element `xxx` of model `rconc_uh` for writing, the following error occurred:
Sequence `inflow` of element `xxx` of model `rconc_uh` is already registered under the same column name(s) but with different time series data.
The Problem
Both submodels attempt to write the inflow sequence (which contains different values) for the same elements into the same file. Currently, HydPy does not seem to distinguish between different instances of the same model type during the NetCDF export process.
Proposed Solutions
We need a mechanism to handle sequences from all submodel instances without naming conflicts.
Option 1: Explicit Aliasing
Allow the definition of alias submodel names during configuration. These aliases would be used to name the output files.
- Example:
rconc_uh_routing_store and rconc_uh_directflow.
Option 2: Automatic Naming Convention (Attribute + Model Type)
Automatically generate the NetCDF filename using a combination of the submodel's attribute name (the role) and the model type.
- Example:
rconcmodel_routingstore_rconc_uh and rconcmodel_directflow_rconc_uh.
This would ensure that sequences from all models can be stored independently without manual intervention. I would prefer the second option as a general mechanism.
Description
When using the HydPy gland_gr6 model, two flow concentration submodels (
rconcmodel_routingstoreandrconcmodel_directflow) must be defined. Following the GR6 model concept implemented in HydPy, rconc_uh models with different parametrization are typically used for both. This issue likely also affects the HydPy gland_gr4 model due to its similar submodel structure, though this has not been explicitly tested yet.When attempting to store the fluxes using
hp.save_fluxes(), HydPy throws a registration error because both submodel instances attempt to write to the same NetCDF file (rconc_uh_flux_inflow.nc) using the same sequence names, despite having different data.Error Traceback
The Problem
Both submodels attempt to write the
inflowsequence (which contains different values) for the same elements into the same file. Currently, HydPy does not seem to distinguish between different instances of the same model type during the NetCDF export process.Proposed Solutions
We need a mechanism to handle sequences from all submodel instances without naming conflicts.
Option 1: Explicit Aliasing
Allow the definition of alias submodel names during configuration. These aliases would be used to name the output files.
rconc_uh_routing_storeandrconc_uh_directflow.Option 2: Automatic Naming Convention (Attribute + Model Type)
Automatically generate the NetCDF filename using a combination of the submodel's attribute name (the role) and the model type.
rconcmodel_routingstore_rconc_uhandrconcmodel_directflow_rconc_uh.This would ensure that sequences from all models can be stored independently without manual intervention. I would prefer the second option as a general mechanism.