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
co2 emission PR is edited #748
co2 emission PR is edited #748
Conversation
for more information, see https://pre-commit.ci
…sa-earth into co2-emission_v2
for more information, see https://pre-commit.ci
Hello @Emre-Yorat89! A very nice work. I really like the structure and logic of your code. Have added a few small comments and questions. Generally, my feeling is that we are close to ready-for-merge :) |
@Emre-Yorat89 thanks for addressing all the points! Almost there :) The remained tasks:
After that, from my perspective this PR is ready to be merged. @pz-max or @davide-f would mind to review a final version? That is a very important PR which significantly changes control of decarbonisation modeling. It would be perfect to have your double-check for it. |
@Emre-Yorat89 great job! My feeling is that the PR is ready. I'll give merge it tomorrow unless @davide-f or @pz-max have any comments on that :) Thank you so much for the contribution! |
Hello :) I think that it may be interesting to add a description to this PR and the PR 618 |
My feeling is that the latest PR adjustments look really nice :) @Emre-Yorat89 great work! @davide-f this PR is re-implementation of #618. Have added a couple of lines into PR description to make clear it's purpose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @Emre-Yorat89 Great job!
The code has significantly improved, I've left some suggestions including code to finalize :) great revision!
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Emre-Yorat89 I've added some final (mainly documentation and CI-related comments).
Let me know if you can handle them of if you prefer us to jump in :)
The contribution is really great and you are crafting an amazing feature :)
It would be nice to see some testing and sensitivity on its usage, very nice! (not in this PR...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @Emre-Yorat89 :D
So, I've been closing past comments and this PR is almost ready :)
As last steps, there is the need to solve a merge conflicts.
The main conflict is related to this PR #823 that introduced the "parameters" into the snakemake.
In the following, we first fix the conflicts and then revise the code to account for the new feature
The easiest way for you to fix it would be:
- online on github, you see a button "Resolve conflicts", click on it
- you'll see the conflicts between the existing and your code in prepare_network. You can keep your code only and delete "<<<>>", select "mark as solved" and click on the button commit from github
- from your computer in your local repository, digit:
git fetch
git pull - after that, in the file prepare_network, you shall replace
snakemake.config["electricity"]["automatic_emission"]
intosnakemake.params["automatic_emission"]
note: config has been replaced into params - in the file "Snakemake", rule "prepare_network", you shall add
automatic_emission=snakemake.config["electricity"]["automatic_emission"],
under the params section - commit and push the changes of the last two steps
Great @Emre-Yorat89, the last round is here :D
If you encounter issues or need a help, I can jump in :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As CI works, this PR is ready to merge :)
History is a bit messy because of merges and pre-commits, but rewriting history is more messy than expected.
@Emre-Yorat89 , for next PRs, please make sure to enable the pre-commit:
- in vscode, view-Command palette->Python: Select Intepreter-> pypsa-earth environment
- once that is done, in the prompt of commands, digit "pre-commit install"
- before commiting, may be good to execute "pre-commit run --all" to make sure the code is compliant to pre-commit
50acf1d
to
f5994d7
Compare
@Emre-Yorat89 great contribution :D |
Amazing news 🤩 |
Congrats! Just thinking for the use in the sector coupled model. How would it work then? I can imagine that one could extract data for other sectors as well changing a few lines e.g. |
I really thank you to @ekatef and @davide-f for their supports and helps while reviewing and merging the PR. |
Closes #488.
Changes proposed in this Pull Request
Currently, the CO2 emissions for the 1990 base year are hard-coded in the config for Europe only. When the user wants to optimize only one country or a set of countries, they have to manually check and adjust the emissions for a base year according to the region of interest.
This pull request adds functionality to returns co2 emissions for given countries in an automated way. The used dataset is database Emissions Database for Global Atmospheric Research (EDGAR) provided by the Joint Research Center (JRC)
Note: this PR is re-implementation of #618 in a cleaner way
Checklist
envs/environment.yaml
anddoc/requirements.txt
.config.default.yaml
andconfig.tutorial.yaml
.test/
(note tests are changing the config.tutorial.yaml)doc/configtables/*.csv
and line references are adjusted indoc/configuration.rst
anddoc/tutorial.rst
.doc/release_notes.rst
is amended in the format of previous release notes, including reference to the requested PR.