Skip to content
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

fix: incorporate collaborative scaling overgeneration #129

Merged
merged 2 commits into from
Apr 3, 2020

Conversation

danielolsen
Copy link
Contributor

@danielolsen danielolsen commented Apr 3, 2020

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 of test_collaborative_capacity_strategy(), except for the following lines:

  • Line 585 sets the target for the Pacific target zone to 0.
  • Line 597 confirms that the shortfall for the Pacific target zone is calculated as 0.
  • Line 649 confirms the new collaborative shortfall value.
  • Lines 654, 655, 659, 661, 663, and 665 confirm the new calculations based on this collaborative shortfall value.

In powersimdata/scaling/clean_capacity_scaling/auto_capacity_scaling.py , we correct the logic in CollaborativeStrategyManager.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.

@danielolsen danielolsen added the bug Something isn't working label Apr 3, 2020
Copy link
Collaborator

@BainanXia BainanXia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic is clean. All tests passed. Just need to be aware that we are moving these files around in another ongoing PR #124 and this may cause conflicts when merging. @dmuldrew will be the best person to manage the order of merging these branches.

@danielolsen danielolsen force-pushed the collaborative_scaling_overgeneration branch from bd0ca9d to eb0d69b Compare April 3, 2020 22:40
@danielolsen danielolsen merged commit 5b22eae into develop Apr 3, 2020
@danielolsen danielolsen deleted the collaborative_scaling_overgeneration branch April 3, 2020 22:41
@ahurli ahurli mentioned this pull request Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants