-
Notifications
You must be signed in to change notification settings - Fork 89
Description
This issue will serve as a central point to discuss merging the issues from the SWITCH WECC repo.
As of now the plan is as follows.
Action plan
- Move the SWITCH WECC latest version into a
weccbranch in this repo. - Move all
weccspecific files into aweccpackage. - Create branches
master-with-black-formatted-historyandwecc-with-black-formatted-historywhich are themasterandweccbranches rewritten but with their history modified such that every commit is formatted according toblack. This reduces merge conflicts in the next step (see notes on how this was done below). - Merge
masterintowecc - Create merge requests one after another to include the changes from the
weccbranch into the main branch as small features. These merge requests will have to be merged more or less in order. See chart below.
WECC features to include into master
- Graph generation (status: not started)
- Auto input data loading (status: not started)
- Tracking of other GHGs (status: not started)
- Variable scaling for numerical properties (status: not started)
- Addition of documentation (status: not started)
- Addition of
switch droptool (status: not started) - Addition on some dual values in the output (status: not started)
- Improving README and docs (e.g. switch to .md format) (status: not started)
- Include
weccfolder for others to see / use (status: not started) - New policy modules (status: not started)
- Add
switch compare(status: not started)
master features to include in WECC
- Specification of
dimenin set definition
Conflicting changes
- Changes related to simultaneous upgrade to latest version of Pyomo
- Use of
ordered=Falseinweccbutunique_listinmaster -
weccspecific examples e.g.ca_policiesorstochasticexample -
config.yamlapproach to generating scenarios
Notes
Process for creating master-with-black-formatted-history and wecc-with-black-formatted-history
This is achieved with the following commands in Powershell.
-
Run
git merge-base wecc masterto find the commit where the two branches first diverged. -
Checkout that commit on a new branch called
common-wecc-parent. -
Reformat the code with
black --fast -t py310 --extend-exclude 'switch_wecc/wecc' ./switch_modeland make a new commit. -
Checkout
masteron switch to a new branchmaster-with-black-formatted-history. -
Run
git rebase --rebase-merges --exec "black --fast -t py310 --extend-exclude 'switch_wecc/wecc' ./switch_model; git commit -a --amend --allow-empty" common-wecc-parent
a. The--rebase-mergesensures we keep the topography of the merges
b. The--exec "black --fast -t py310 --extend-exclude 'switch_wecc/wecc' ./switch_model; git commit -a --amend --allow-empty"means that after every commit, we amend the commit such that the switch_model files are reformatted. -
This will generate significant merge conflicts. For each one run
a.git restore --theirs -s REBASE_HEAD .to update the local files to the commit that is being applied.
b.black --fast -t py310 --extend-exclude 'switch_wecc/wecc' ./switch_modelto reformat the files.
c.git add .to mark any conflicts as resolved.
d.git rebase --continueto continue with the rebase. To avoid the popup to edit the commit message see instructions here.
To make these commands automatically run up to 100 times in a loop, in Powershell simply run
1..10 | % {git restore --theirs -s REBASE_HEAD . ; black --fast -t py310 --extend-exclude 'switch_wecc/wecc' ./switch_model ; git add . ; git rebase --continue} -
Check that there are no differences between
master-with-black-formatted-historyandmaster(you might need to run black onmaster) -
Redo step 4 to 7 but for the
weccbranch.