pypsa-eur
pypsa-eur copied to clipboard
Fixing energy totals rescale function
Changes proposed in this Pull Request
Closes https://github.com/PyPSA/pypsa-eur/issues/985.
Bug fix in the function rescale_idees_from_eurostat():
So far, the sum of agriculture and transport did not add up to total agriculture and total transport since there are two different rescaling factors for electricity and total.
@lindnemi: the sectors residential and services is not adding up since it's taking data from JRC IDEES from multiple sheets.
Minor changes so no change in the environment, configuration and release notes.
Checklist
- [x] I tested my contribution locally and it seems to work fine.
- [x] Code and workflow changes are sufficiently documented.
- [x] Changed dependencies are added to
envs/environment.yaml. - [x] Changes in configuration options are added in all of
config.default.yaml. - [x] Changes in configuration options are also documented in
doc/configtables/*.csv. - [x] A release note
doc/release_notes.rstis added.
@toniseibold watch out the warning regarding the assignment of values after a .loc and getitem https://github.com/PyPSA/pypsa-eur/actions/runs/8422950562/job/23063439670#step:8:1124
Instead of
energy.loc[country, :]["total road"] =
you should probably go for
energy.loc[country, "total road"] =
Thanks @FabianHofmann - missed that one.
I had to make some changes, but they were difficult to trace, so no worries!
https://github.com/PyPSA/pypsa-eur/commit/f25c594a07d21ea207421dd35b168707b7342433
The "total" includes electricity for the transport sector, so the entries with "electricity" shouldn't be included in the sum. The mismatch in the totals seemed to come from the missing entry "total heavy duty road freight" in the rescaling.