You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The intended behaviour of control files is as follows: If parameters are stored in a control file and have not been previously set, the parameter is automatically set to "?" in the control files. Attempting to read these control files will result in a syntax error, reminding the user to set these parameters.
But: no error will be thrown when reading control files if the parameter is set to None (in the control files this parameter is stored with empty brackets). This happens when, for example, an empty list or dictionary is assigned. The control files can be loaded without error, even if this parameterisation would result in a non-executable model.
Setting parameters of type Parameter or SeasonalParameter to empty lists or dictionaries in control files will result in arrays of zeros which could lead to unintentional parameterisation, perhaps we can add some safety mechanisms here.
Even more critical is the assignment of empty lists or dictionaries in control files to e.g. interpolator parameters, the simulation will abort without an ErrorCode.
Using model.parameters.verify() could help to catch this error for e.g. interpolator parameters like waterlevel2flooddischarge. Therefore, automatically applying verify() to the model parameters, after reading models from control files would be a good improvement.
This parameter verification issue is closely related to issue #55
The text was updated successfully, but these errors were encountered:
Could you please give short examples for "Setting parameters of type Parameter or SeasonalParameter to empty lists or dictionaries in control files will result in arrays of zeros"? (both for Parameter and SeasonalParameter). And also for the "interpolator parameters" (does this problem occur both for SimpleInterpolator and SeasonalInterpolator subtypes?)
For consistency, we could do the verification while writing the control files. This would also be more efficient, because reading control files happens more often than writing them.
Perhaps I have chosen an inaccurate formulation saying "Setting parameters of type Parameter or SeasonalParameter to empty lists or dictionaries in control files will result in arrays of zeros", so let me add the following explanantion:
In my case, I wanted to associate the parameters with a dictionary with toy keys that I automatically generated from an input database. Since the underlying database was missing information it happened that I generated empty dictionaries. Simplified I did the following:
The intended behaviour of control files is as follows: If parameters are stored in a control file and have not been previously set, the parameter is automatically set to "?" in the control files. Attempting to read these control files will result in a syntax error, reminding the user to set these parameters.
But: no error will be thrown when reading control files if the parameter is set to None (in the control files this parameter is stored with empty brackets). This happens when, for example, an empty list or dictionary is assigned. The control files can be loaded without error, even if this parameterisation would result in a non-executable model.
Setting parameters of type
Parameter
orSeasonalParameter
to empty lists or dictionaries in control files will result in arrays of zeros which could lead to unintentional parameterisation, perhaps we can add some safety mechanisms here.Even more critical is the assignment of empty lists or dictionaries in control files to e.g. interpolator parameters, the simulation will abort without an ErrorCode.
Using model.parameters.verify() could help to catch this error for e.g. interpolator parameters like waterlevel2flooddischarge. Therefore, automatically applying verify() to the model parameters, after reading models from control files would be a good improvement.
This parameter verification issue is closely related to issue #55
The text was updated successfully, but these errors were encountered: