-
Notifications
You must be signed in to change notification settings - Fork 13
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
When calculating MW-miles of transmission upgrades, exclude some branches #118
Conversation
c4367dc
to
f410277
Compare
f410277
to
96c2233
Compare
7483182
to
4fa8739
Compare
4fa8739
to
fa58e48
Compare
fa58e48
to
e75338e
Compare
This PR has been sitting for nearly three months now. Can I get a thumbs up or thumbs down so that I can stop rebasing and pushing? |
base_branch = original_grid.branch | ||
upgraded_branches = ct["branch"]["branch_id"] | ||
for b, v in upgraded_branches.items(): | ||
if b in exclude_branches: | ||
continue | ||
# 'upgraded' capacity is v-1 because a scale of 1 = an upgrade of 0 | ||
upgraded_capacity = base_branch.loc[b, "rateA"] * (v - 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just by curiosity, what happens if b
, a branch that is part of the grid used for the scenario, is not in the base grid because the latter has been updated since the scenario has ran? In other words, should we have a if
or try
/except
statement here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting thought. If we remove a branch from the base grid, but this branch is present in the change table of previous scenarios, I think it will indeed cause an error. So far I don't think we've removed any branches, only added them, and even then we have only added them for the offshore wind generators, nowhere else.
Just thinking out loud here: if we do add an if
or a try
/except
, it could avoid this hypothetical but we may accidentally ignore similar problems that we would want to throw an exception for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Always a good thing to have options.
e75338e
to
2c77648
Compare
Purpose
When calculating MW-miles of transmission upgrades, exclude some branches. I have found this to be very useful for analyzing offshore wind scenarios, where we want to separate onshore branch upgrades and offshore branch upgrades.
What is the code doing
Functional change in calculation loop in
mwmiles.py
:Everything else is input checking, docstring updates, and new tests.
Usage example
Scenario 564 (Collaborative Offshore Anchor). Offshore branches were consciously all given capacity of 100 MW, even if the offshore plants were expected to be much bigger, since we knew that we could up-size them automatically via renewable stub scaling. However, that leads to the calculation of very large upgrade totals, which are not meaningful for this scenario.
Time to review
15 minutes. This is a low priority to review/merge, I can keep using it in my local branch in the meantime.