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

Demand workflow #219

Merged
merged 49 commits into from
Aug 30, 2023
Merged

Demand workflow #219

merged 49 commits into from
Aug 30, 2023

Conversation

hazemakhalek
Copy link
Collaborator

Closes # 79

Changes proposed in this Pull Request

This PR downloads the energy balances from UNSD, filters them by the chosen base year and country and processes the data to the sectors and carriers included in the model. The main output is: energy_totals for any country of the world for any historic year.

Following PR will project the energy_balances to the future (planning_horizons) year.

Checklist

  • I tested my contribution locally and it seems to work fine.
  • Code and workflow changes are sufficiently documented.
  • Newly introduced dependencies are added to envs/environment.yaml and envs/environment.docs.yaml.
  • Changes in configuration options are added in all of config.default.yaml, config.tutorial.yaml, and test/config.test1.yaml.
  • Changes in configuration options are also documented in doc/configtables/*.csv and line references are adjusted in doc/configuration.rst and doc/tutorial.rst.
  • A note for the release notes doc/release_notes.rst is amended in the format of previous release notes, including reference to the requested PR.

@hazemakhalek
Copy link
Collaborator Author

@energyLS @davide-f we have a new package here: py7zr. Should I issue a pypsa-earth PR for this?

@davide-f
Copy link
Member

Yeah, please :)
Add a Pr to add the dependency

@energyLS
Copy link
Collaborator

@hazemakhalek could you either add the UNSD to the data/ folder or provide a snakemake rule which downloads it? Currently the rule points to a only locally available file.

@hazemakhalek
Copy link
Collaborator Author

@davide-f, will do

@hazemakhalek
Copy link
Collaborator Author

@energyLS , will do. Also finishing up the projection feature. Will ping you when ready

@hazemakhalek
Copy link
Collaborator Author

@davide-f I issued the PR for the new dependency.

@davide-f
Copy link
Member

davide-f commented Aug 23, 2023

I'm updating the submodule to the latest version of the repo: #228

That should fix the issue once complete. I expect no breaking changes except the revision of the cutout name

@hazemakhalek
Copy link
Collaborator Author

hazemakhalek commented Aug 24, 2023

Next steps:

  • change the custom demand sectors to default
    • Residential (all carriers)
    • Services
    • Agriculture

Copy link
Collaborator

@energyLS energyLS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First testing shows: 2030 works, 2040 throws error, 2050 works but has the same values as 2030. What is the issue here?

config.default.yaml Outdated Show resolved Hide resolved
data/demand/efficiency_gains copy.csv Outdated Show resolved Hide resolved
data/demand/growth_factors copy.csv Outdated Show resolved Hide resolved
data/energy_totals_DF_2030.csv Show resolved Hide resolved
data/energy_totals_XX_2030.csv Outdated Show resolved Hide resolved
data/energy_totals_XX_2038.csv Outdated Show resolved Hide resolved
scripts/prepare_sector_network.py Show resolved Hide resolved
scripts/build_base_energy_totals.py Outdated Show resolved Hide resolved
scripts/build_base_energy_totals.py Show resolved Hide resolved
scripts/build_base_energy_totals.py Show resolved Hide resolved
@hazemakhalek
Copy link
Collaborator Author

hazemakhalek commented Aug 29, 2023

First testing shows: 2030 works, 2040 throws error, 2050 works but has the same values as 2030. What is the issue here?
@energyLS
"2030 and 2050 are similar": Any time horizon you choose will be based on the parameters of the new csv files (growth factors, efficiency gains and fuel shares). These are not scenario specific, so the user needs to change them when the change the year to to complete the scenario definition.
"2040 throwing an error": Maybe this is an issue of the costs file not existing for 2040, or do you mean the script itself fails?

@energyLS
Copy link
Collaborator

@hazemakhalek I have checked this again, this error for e.g. appears due to missing config factors of e.g. fuell cell share. So this would just needed to be added to the config, but this could be done user specific and does not have to be part of the PR. One important thing though: since efficiency_gains is currently for 2030 only, could you rename it to e.g. efficiency_gains_2030 to avoid confusion? The implementation of yearly efficiency gains could be done in a seperate PR :)

First testing shows: 2030 works, 2040 throws error, 2050 works but has the same values as 2030. What is the issue here?
@energyLS
"2030 and 2050 are similar": Any time horizon you choose will be based on the parameters of the new csv files (growth factors, efficiency gains and fuel shares). These are not scenario specific, so the user needs to change them when the change the year to to complete the scenario definition.
"2040 throwing an error": Maybe this is an issue of the costs file not existing for 2040, or do you mean the script itself fails?

@hazemakhalek
Copy link
Collaborator Author

@energyLS
I actually didn't want to leave something for later so I implemented the cagr now. Let's see what the CI says about it :)

@energyLS
Copy link
Collaborator

@energyLS I actually didn't want to leave something for later so I implemented the cagr now. Let's see what the CI says about it :)

Fantastic, thanks!

@energyLS energyLS merged commit 2d59186 into main Aug 30, 2023
3 checks passed
@davide-f davide-f deleted the demand_workflow branch February 5, 2024 18:29
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.

3 participants