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
73 stars 18 forks source link

Parameters trigger visibility of other parameters #2498

Open jkiviluo opened 10 months ago

jkiviluo commented 10 months ago

When user makes a choice based on a parameter_value_list, it could influence what parameters are enabled for the entity. E.g. choose 'binary_startup' for a unit and you get to use 'startup_cost' parameter (which was disabled before - indicated by being greyed out).

This should work also when the parameter to be filtered is a parameter of another entity_class.

Here are the relevant changes for the DB structure: image

soininen commented 10 months ago

A bit of nitpicking: I would rather go with enabled/disabled than visible/hidden.

jkiviluo commented 10 months ago

Ok, nit has been removed.

DillonJ commented 10 months ago

How would this work with copy/paste? Will we get an error if we paste in a sub-value before the parent value is added?

I'm afraid the functionality here is based on a user chronologically entering data... but it has to work for pasting stuff in and writing parameter values via script also.

If it's just a UI visibility thing I guess it's ok.

Also, maybe it's not a good example - but you might still want start up costs even with non-binary start ups (If I understand correctly what these mean).

jkiviluo commented 10 months ago

The data can be still there and can be edited (through UI or through scripts). The point is to show the user what data is needed/in use.

jkiviluo commented 1 month ago

Bit of duplicate of: https://github.com/spine-tools/Spine-Toolbox/issues/2793