Skip to content

fix: allow small tolerance on capacity factors#181

Merged
danielolsen merged 2 commits intodevelopfrom
fix_resource_cap_factor_tolerance
May 16, 2020
Merged

fix: allow small tolerance on capacity factors#181
danielolsen merged 2 commits intodevelopfrom
fix_resource_cap_factor_tolerance

Conversation

@danielolsen
Copy link
Copy Markdown
Contributor

Purpose

Similarly to #128, we want to avoid an AssertionError that happens if the total generation is slightly above a capacity factor of 1. This can be seen when loading Scenario 519 and calling CollaborativeStrategyManager.populate_targets_with_resources(), there is one region for which 'other' type generators have a calculated capacity factor of 100.01%, and this halts the method.

What is the code doing

Adding a small tolerance (1e-3 by default) to the 0 < x < 1 check.

Time to review

5 minutes.

@danielolsen danielolsen requested review from BainanXia and dmuldrew May 15, 2020 17:47
@danielolsen danielolsen added the bug Something isn't working label May 15, 2020
@danielolsen danielolsen force-pushed the fix_resource_cap_factor_tolerance branch from 218ebf0 to 7bff8db Compare May 15, 2020 19:03
@danielolsen danielolsen merged commit e11491f into develop May 16, 2020
@danielolsen danielolsen deleted the fix_resource_cap_factor_tolerance branch May 16, 2020 18:15
@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.

2 participants