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
wecc
branch in this repo. - Move all
wecc
specific files into awecc
package. - Create branches
master-with-black-formatted-history
andwecc-with-black-formatted-history
which are themaster
andwecc
branches 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
master
intowecc
- Create merge requests one after another to include the changes from the
wecc
branch 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 drop
tool (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
wecc
folder 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
dimen
in set definition
Conflicting changes
- Changes related to simultaneous upgrade to latest version of Pyomo
- Use of
ordered=False
inwecc
butunique_list
inmaster
-
wecc
specific examples e.g.ca_policies
orstochastic
example -
config.yaml
approach 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 master
to 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_model
and make a new commit. -
Checkout
master
on 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-merges
ensures 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_model
to reformat the files.
c.git add .
to mark any conflicts as resolved.
d.git rebase --continue
to 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-history
andmaster
(you might need to run black onmaster
) -
Redo step 4 to 7 but for the
wecc
branch.