spine-tools / SpineOpt.jl

A highly adaptable modelling framework for multi-energy systems
https://www.tools-for-energy-system-modelling.org/
GNU General Public License v3.0
57 stars 13 forks source link

Improve and advance data structure checks #381

Closed mihlema closed 1 year ago

mihlema commented 3 years ago

Currently, new users are often challenged with a plethora of cryptic error messages, when missing essential elements to SpineOpt. The goal of this issue is to identify common pitfalls, and capture those with explanatory Errors (or warnings if SpineOpt applies some defaults).

Generally, we can divide input errors into two categories: parameter and object/relationship input errors.

For parameter input errors, the main way forward is to check whether the entered parameter type corresponds to the required parameter type (e.g. duration value for the roll_forward parameter etc.). From toolbox side, this functionality has recently been added (@manuelma?). On top of that there are some logical checks can be added:

For object/relationship classes, especially fundamental relationship can be checked:

*Alternatively, the output objects could be native to the template - users would need to delete undesired outputs)

Tasqu commented 3 years ago

On the SpineOpt telco on the 2021-08-25, @KristofPhillips95 asked for some more ideas for potential input data checks, so here are my immediate thoughts after browsing through the SpineOpt template. Note that some of these might already have checks in place! I didn't bother to check the code.

Object classes

For most of these, it's probably worth to check if any exist and are connected to at least one model object via any appropriate relationships. I don't have much to add to suggestions by @mihlema above.

Relationship classes

Personally, I'm not sure if I would auto-generate any stochastic structures, but if we want to go the extra mile, why not. As long as a warning is thrown so that things aren't done without informing the user.

For the temporal/stochastic structure, every node, units_on, units_invested etc. must be connected to both a stochastic_structure and at least one temporal_block. That, or a default must be in place via the model_default_... relationships.

Object parameters

In general, a lot of investment parameters lose their meaning, unless the entity in question has investments enabled. Anyway, here's a list of things that came to mind:

Relationship parameters

In general, ramp and reserve parameters are meaningless without ramp/reserves enabled. (not sure if they are separately enabled somewhere?)

KristofPhillips95 commented 3 years ago

Also add checks for duration/Datetime values

clizbe commented 1 year ago

Closing due to stale status.

clizbe commented 1 year ago

Closing because stale.