quintel / etlocal

Regional data analysis tool for the Energy Transition Model
https://data.energytransitionmodel.com/
MIT License
2 stars 2 forks source link

Rename interface elements for all datasets due to heat improvements modelling changes #484

Closed redekok closed 1 year ago

redekok commented 1 year ago

Due to the heat improvements modelling project a lot of dataset keys (or interface elements) have been renamed. For instance, energy_heat_burner_coal has been renamed to energy_heat_burner_ht_coal. Also, new keys have been added (e.g. energy_heat_burner_mt_coal) but those are out of scope of this issue.

On the heat-2023 branch these interface elements have been renamed yet, e.g. see here.

For all new keys (so not the ones that should be renamed but the entirely new ones, such as energy_heat_burner_mt_coal in the example above) I have created a migration. The data.csv file in the corresponding folder contains all new interface elements and their values, not the ones that are to be renamed. I did create an overview in the migration script of the keys that have to be renamed.

At first, I wanted to include the rename operation in the existing migration. But on second thought it might seem like a better (and neater?) idea to create a separate migration for this. What do you think @thomas-qah?

As for your question on Slack about the DatasetEdits I'm not sure whether this is the case. Perhaps @noracato can help you out here?

thomas-qah commented 1 year ago

As just discussed with @redekok I think creating a separate migration for the renaming of the keys is indeed a bit neater.

Before implementing a method to rename the keys I've searched to see whether this was done previously and this seemed to be the case numerous times, most recently here. For my eyes this seems to be a rather database-expensive manner of renaming however, looking up DatasetEdits through Commits and Datasets. I've therefore changed this to be a bit more efficient and just directly search for DatasetEdits containing the keys to change here.

thomas-qah commented 1 year ago

This issue was resolved through this migration.