spine-tools / Spine-Toolbox

Spine Toolbox is an open source Python package to manage data, scenarios and workflows for modelling and simulation. You can have your local workflow, but work as a team through version control and SQL databases.
https://www.tools-for-energy-system-modelling.org/
GNU Lesser General Public License v3.0
72 stars 17 forks source link

Add rows for mandatory parameters automatically #2710

Open nelliputkonen opened 6 months ago

nelliputkonen commented 6 months ago

Some rows can be mandatory: either because they are mandatory always or another parameter requires the parameter. This is not yet supported in Spine DB structure, but will be - and then needs to be added in the database editor.

There is a further challenge to consider alternatives - the correctness of input data takes finally place only at the scenario level (particular alternative can be incomplete, but a scenario should not be).

This will also allow to highlight missing data.

nelliputkonen commented 6 months ago

Could the practical selections for the user be: 1) When creating or editing an entity class, define if there are any mandatory parameters for that entity class (e.g. by additional column in Add entity classes) 2) When creating or editing a parameter definition, define if this parameter is has a parent parameter or child parameter (see: https://github.com/spine-tools/Spine-Toolbox/issues/2793). Child parameter rows appear automatically if a certain parameter value of the parent issue is selected. There can also be codependence without hierarchy. (This could be done by adding a new column to Parameter definition "preconditions" which would open a new dialog window if set to 'yes'. The dialog would have settings for the necessary if-conditions.)

(Don't check for alternative correctness at this point, only the existence or all the right parameters in database.)