diff --git a/config/scenario_config.csv b/config/scenario_config.csv index 851c9193411514debe95bb69f3893f61566f4bfb..c46b4c093ff3f0070f2ed73f3a74f74ab66b1d06 100644 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -1,4 +1,4 @@ -title;start;cm_rcp_scen;cm_iterative_target_adj;carbonprice;cm_co2_tax_2020;climate;optimization;cm_emiscen;cm_startyear;path_gdx;path_gdx_ref -BAU_Nash;1;none;0;none;-1;off;nash;1;2005;./config/input.gdx; -RCP37;1;rcp37;5;exponential;30;off;nash;9;2015;./config/input.gdx;BAU_Nash -RCP26;1;rcp26;5;exponential;30;off;nash;9;2015;./config/input.gdx;BAU_Nash +title;start;cm_rcp_scen;cm_iterative_target_adj;carbonprice;cm_co2_tax_2020;climate;optimization;cm_emiscen;cm_startyear;path_gdx;path_gdx_ref;path_gdx_bau +BAU_Nash;1;none;0;none;-1;off;nash;1;2005;./config/input.gdx;; +RCP37;1;rcp37;5;exponential;30;off;nash;9;2015;./config/input.gdx;BAU_Nash; +RCP26;1;rcp26;5;exponential;30;off;nash;9;2015;./config/input.gdx;BAU_Nash; diff --git a/tutorials/0_Git_and_GitHub_workflow.md b/tutorials/0_Git_and_GitHub_workflow.md new file mode 100644 index 0000000000000000000000000000000000000000..6f513f3d1d41c9bf39abda8196bb9d9ae5a6adbc --- /dev/null +++ b/tutorials/0_Git_and_GitHub_workflow.md @@ -0,0 +1,111 @@ +Using git and GitHub to manage your REMIND code +================ +David Klein (<dklein@pik-potsdam.de>), Kristine Karstens (<karstens@pik-potsdam.de>) +15 February, 2020 + +# 1 Introduction + +REMIND and related R packages are published as open source software on GitHub. +There are various workflows, how to use GitHub for collaborative +software development. We want to give some general remarks on our +prefered one. Note the following: + + - **Git** is a free and open source distributed version control system + designed to handle everything from small to very large projects with + speed and efficiency (from: <https://git-scm.com/> - very good help, + documentation, tutorial page for git). + + - **GitHub** is an US American company (owned by Microsoft) that provides + hosting for software development version control using Git. (GitLab, + SourceForge and various more are open-source alternatives to + GitHub.) + + +### Learning objectives + +The goal of this exercise is to set up REMIND for collaborative working. +After completion of this exercise, you'll be able to: + +1. Fork and clone your personal REMIND repository +2. Keep your personal repository upto date with the REMIND main repository +3. Understand the basic workflow including pull requests and branches. +4. Have heard some very basic git commands and know where to find more help. + +# 2 GitHub workflow + +## 2.1 Fork (on the GitHub server) + +<img src="figures/git-1-setup.png" width="100%" style="display: block; margin: auto;" /> + +Every code development (even bugfixes) will be merged into our main +repository under <https://github.com/remindmodel/remind> with the help +of so called pull requests. Pull requests give us control over the +changes entering our branches. To create a pull request, we use personal +or institutional forks. They have to be kept up-to-date with our +upstream repository (the original remindmodel fork). + +> **Exercise**: Visit us on <https://github.com/remindmodel/remind> and +> create your own fork by clicking at 'fork' (at the upper right). + +## 2.2 Clone (download your personal repository) + +It is basically possible to change the code just using the GitHub +interface, but since you want to test and run your code locally you have +to clone the repository from your fork anyway. This can be done using +the 'https' or 'ssh' adresse of your fork together with the `git clone` +command (cmd/bash/GUI) at your machine. We recommand to upload an +ssh-key and use ssh to connect to GitHub. + +> **Exercise**: Visit your fork and clone the repository at your +> machine. + +## 2.3 Push (to your personal repository) + +<img src="figures/git-2-pushing.png" width="100%" style="display: block; margin: auto;" /> + +When you start making your first changes to the code at your local copy, +we strongly recommend to do a tutorial to get familiar with the basic +commands in git. We have compiled a typical workflow at the end of this tutorial (section 3) (you can also have a look on 'git cheat sheets' like +<https://about.gitlab.com/images/press/git-cheat-sheet.pdf>). + +After you have added your changes locally, push (upload) them to your personal remote repository. + +## 2.4 Pull (updates from the main repository) + +To keep your fork up-to-date with the upstream repository you can use +the GitHub interface. Via `Compare` you are able to check, if the +upstream is some commits ahead. If so merge these new changes into +your fork. + +<img src="figures/git-3-add-main.png" width="100%" style="display: block; margin: auto;" /> +<img src="figures/git-4-pull-main.png" width="100%" style="display: block; margin: auto;" /> + +You can also do this merging procedure in your local copy by adding +both your fork and the upstream repository as so called 'remotes' to +your local repository. + +> **Exercise**: Check, if there is anything to merge from the upstream +> repository into your fork. If so, merge it into the local clone of your +> personal fork. + +## 2.5 Pull request + +After you have commited your changes locally, merged the latest updates from the remote main repository and +pushed the result to your remote personal repository it is time to get it integrated +into the remote main repository. Insted of pushing them directly into the remote main repository we use so called +pull requests. Pull requests are proposed changes to a repository submitted by you and accepted or rejected by a +repository's collaborators. Like issues, pull requests each have their own discussion forum. + +<img src="figures/git-5-pull-request.png" width="100%" style="display: block; margin: auto;" /> +<img src="figures/git-7-pull-request-github-1.png" width="100%" style="display: block; margin: auto;" /> +<img src="figures/git-8-pull-request-github-2.png" width="100%" style="display: block; margin: auto;" /> + +## 2.6 All steps in one figure + +<img src="figures/git-6-all-in-one.png" width="100%" style="display: block; margin: auto;" /> +<img src="figures/git-11-rules.png" width="100%" style="display: block; margin: auto;" /> + +# 3 Incorporate your code changes by using branches + +<img src="figures/git-9-branching.png" width="100%" style="display: block; margin: auto;" /> +<img src="figures/git-10-branching-advanced.png" width="100%" style="display: block; margin: auto;" /> diff --git a/tutorials/figures/git-1-setup.png b/tutorials/figures/git-1-setup.png new file mode 100644 index 0000000000000000000000000000000000000000..9053df5c924a6f58497dd1331f87fcb7ce35645f Binary files /dev/null and b/tutorials/figures/git-1-setup.png differ diff --git a/tutorials/figures/git-10-branching-advanced.PNG b/tutorials/figures/git-10-branching-advanced.PNG new file mode 100644 index 0000000000000000000000000000000000000000..0475fac9db1313f24ac3631ebf9e8b58a38eb992 Binary files /dev/null and b/tutorials/figures/git-10-branching-advanced.PNG differ diff --git a/tutorials/figures/git-11-rules.PNG b/tutorials/figures/git-11-rules.PNG new file mode 100644 index 0000000000000000000000000000000000000000..c977d22acea9433b9e0c31e8ba9e70ddb3f61db7 Binary files /dev/null and b/tutorials/figures/git-11-rules.PNG differ diff --git a/tutorials/figures/git-2-pushing.PNG b/tutorials/figures/git-2-pushing.PNG new file mode 100644 index 0000000000000000000000000000000000000000..b97977cbc840d00acfe43b75febb2a30fa69688a Binary files /dev/null and b/tutorials/figures/git-2-pushing.PNG differ diff --git a/tutorials/figures/git-3-add-main.PNG b/tutorials/figures/git-3-add-main.PNG new file mode 100644 index 0000000000000000000000000000000000000000..e1ef7709957c8d2a18173e4da42de664805e2bda Binary files /dev/null and b/tutorials/figures/git-3-add-main.PNG differ diff --git a/tutorials/figures/git-4-pull-main.PNG b/tutorials/figures/git-4-pull-main.PNG new file mode 100644 index 0000000000000000000000000000000000000000..ddd4bdf9cbf56cd2b367aca19b4606dd5f8f4a80 Binary files /dev/null and b/tutorials/figures/git-4-pull-main.PNG differ diff --git a/tutorials/figures/git-5-pull-request.PNG b/tutorials/figures/git-5-pull-request.PNG new file mode 100644 index 0000000000000000000000000000000000000000..5ee241088b42ca65cc8625d9c541917b2b45f1be Binary files /dev/null and b/tutorials/figures/git-5-pull-request.PNG differ diff --git a/tutorials/figures/git-6-all-in-one.PNG b/tutorials/figures/git-6-all-in-one.PNG new file mode 100644 index 0000000000000000000000000000000000000000..c4c520bf01912b2f0af88a43be719c6ccd609973 Binary files /dev/null and b/tutorials/figures/git-6-all-in-one.PNG differ diff --git a/tutorials/figures/git-7-pull-request-github-1.PNG b/tutorials/figures/git-7-pull-request-github-1.PNG new file mode 100644 index 0000000000000000000000000000000000000000..82b258cd3f5423404ca014d40a678abf766f3719 Binary files /dev/null and b/tutorials/figures/git-7-pull-request-github-1.PNG differ diff --git a/tutorials/figures/git-8-pull-request-github-2.PNG b/tutorials/figures/git-8-pull-request-github-2.PNG new file mode 100644 index 0000000000000000000000000000000000000000..8f2634ae92e2b478188b8b0fc23f3b8b6faba5cf Binary files /dev/null and b/tutorials/figures/git-8-pull-request-github-2.PNG differ diff --git a/tutorials/figures/git-9-branching.PNG b/tutorials/figures/git-9-branching.PNG new file mode 100644 index 0000000000000000000000000000000000000000..9384c21043546dc9e32ee62405d23e5fcafd01e3 Binary files /dev/null and b/tutorials/figures/git-9-branching.PNG differ