flexmeasures icon indicating copy to clipboard operation
flexmeasures copied to clipboard

Migrate attribute names to use dashed to separate words

Open victorgarcia98 opened this issue 1 year ago • 1 comments

In general, we are using underscore for the DB entities attributes and deserialized attributes and dashed for serialized data.

However, DB attributes are in a serialized form (e.g. we could store quantities as string and convert them back to ur.Quantities) so it might be more consistent to separate words with dashed.

This looks like a trivial task but bear with me that it isn't. Some things to consider are:

  • Migrate old attributes replacing underscores by dashes. (also the down revision ("-" -> "_"). Can we do this in general or are there DB attributes using dashes?
  • Look for the use of the attributes through the code and do the replacement.

Non flexmeasures core tasks

  • Make existing plugins to use/set the new asset attributes

victorgarcia98 avatar Nov 24 '23 09:11 victorgarcia98

I propose to tackle, within the same scope, moving units from attribute keys to attribute values. For example: "min_soc_in_mwh": 0.1 should become "soc-min": "100 kWh". Likewise for "max_soc_in_mwh". Afterwards each fallback attribute should have the same format as its corresponding flex-model/flex-config field.

Flix6x avatar Mar 01 '24 14:03 Flix6x