You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 a wecc package.
Create branches master-with-black-formatted-history and wecc-with-black-formatted-history which are the master and wecc branches rewritten but with their history modified such that every commit is formatted according to black. This reduces merge conflicts in the next step (see notes on how this was done below).
Merge master into wecc
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 in wecc but unique_list in master
wecc specific examples e.g. ca_policies or stochastic 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 branch master-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 and master (you might need to run black on master)
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
weccbranch in this repo.weccspecific files into aweccpackage.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).masterintoweccweccbranch 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
masterswitch droptool (status: not started)weccfolder for others to see / use (status: not started)switch compare(status: not started)masterfeatures to include in WECCdimenin set definitionConflicting changes
ordered=Falseinweccbutunique_listinmasterweccspecific examples e.g.ca_policiesorstochasticexampleconfig.yamlapproach to generating scenariosNotes
Process for creating
master-with-black-formatted-historyandwecc-with-black-formatted-historyThis 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-parenta. The
--rebase-mergesensures we keep the topography of the mergesb. 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.