-
Notifications
You must be signed in to change notification settings - Fork 85
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
Merge improvements from SWITCH-WECC #143
Comments
Hello @PatyHidalgo @mfripp! I spent most of my weekend exploring our options for joining the
I see a few options:
Looking forward to figuring this out together! Working on open-source projects with limited resources is always a challenge but let's do the best we can. I would be very happy if the switch community can benefit from the switch-wecc features and if both teams can work on a unified project to make the benefits accessible to the entire community. I am sad that I can't lead this effort (I really would like to but I'm trying to make the smart decision and not overcommit myself as I usually do) but I will do what I can to help as much as possible! |
One more thing: I've thought of a good example to illustrate the challenge in resolving the differences between the
|
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
wecc
branch in this repo.wecc
specific files into awecc
package.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).master
intowecc
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
switch drop
tool (status: not started)wecc
folder for others to see / use (status: not started)switch compare
(status: not started)master
features to include in WECCdimen
in set definitionConflicting changes
ordered=False
inwecc
butunique_list
inmaster
wecc
specific examples e.g.ca_policies
orstochastic
exampleconfig.yaml
approach to generating scenariosNotes
Process for creating
master-with-black-formatted-history
andwecc-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 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_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.The text was updated successfully, but these errors were encountered: