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
71 stars 17 forks source link

New parameter type: entity_class #2494

Open jkiviluo opened 9 months ago

jkiviluo commented 9 months ago

Parameter value can be chosen from the entities of a particular entity_class.

It could be UNIQUE (only one entity can be chosen for an entity - hard to enforce due to alternatives --> should be checked that uniqueness is not violated for any scenario) or ONE-TO-MANY.

Implementation idea: Use actual nD entity_classes to store the information (just don't show the entity_class in the tree - unless specifically chosen to do so). This way we can keep referential integrity.

soininen commented 9 months ago

How would the uniqueness work if more than one parameter was of entity_class type in an entity? What if you built an array or a map of entity_class?

jkiviluo commented 9 months ago

How would the uniqueness work if more than one parameter was of entity_class type in an entity? Good question.

Maybe we can see how this works without the UNIQUE constraint first.