Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing energy totals rescale function #990

Merged
merged 4 commits into from
May 20, 2024
Merged

Fixing energy totals rescale function #990

merged 4 commits into from
May 20, 2024

Conversation

toniseibold
Copy link
Contributor

@toniseibold toniseibold commented Mar 25, 2024

Changes proposed in this Pull Request

Closes #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

  • I tested my contribution locally and it seems to work fine.
  • Code and workflow changes are sufficiently documented.
  • Changed dependencies are added to envs/environment.yaml.
  • Changes in configuration options are added in all of config.default.yaml.
  • Changes in configuration options are also documented in doc/configtables/*.csv.
  • A release note doc/release_notes.rst is added.

@toniseibold toniseibold requested review from lindnemi and fneum March 25, 2024 14:11
@toniseibold toniseibold marked this pull request as ready for review March 25, 2024 15:49
@FabianHofmann
Copy link
Contributor

@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"] =

@toniseibold
Copy link
Contributor Author

Thanks @FabianHofmann - missed that one.

@fneum fneum added this to the v0.11.0 milestone May 12, 2024
@fneum fneum merged commit d09df8a into master May 20, 2024
5 checks passed
@fneum
Copy link
Member

fneum commented May 20, 2024

I had to make some changes, but they were difficult to trace, so no worries!

f25c594

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.

@toniseibold toniseibold deleted the fix_energy_totals branch June 18, 2024 07:34
tgi-climact pushed a commit to Climact/pypsa-eur-climact that referenced this pull request Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

energy_totals: subcategories do not sum correctly
3 participants