fix: incorporate collaborative scaling overgeneration #129
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Calculate collaborative clean energy shortfall appropriately, where an overgeneration in one target area can be exported to offset shortfalls in another area.
What is the code doing
In
powersimdata/scaling/clean_capacity_scaling/tests/test_strategies.py
, we add a test case for which there is one zone with clean energy shortfall and one zone with clean energy overgeneration:test_collaborative_capacity_strategy_overgeneration()
. This test is identical to that oftest_collaborative_capacity_strategy()
, except for the following lines:In
powersimdata/scaling/clean_capacity_scaling/auto_capacity_scaling.py
, we correct the logic inCollaborativeStrategyManager.calculate_total_shortfall()
to appropriately count the overgeneration in one zone against the shortfalls in the other area.Time to review
Half an hour. There are only around 10 lines of real changes, the rest of the new code is a direct copy from the old test case.