-
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
feat: analyze binding constraints (ramp, pmin, pmax) #121
Conversation
@@ -0,0 +1,212 @@ | |||
import unittest | |||
|
|||
from numpy.testing import assert_array_equal |
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.
ununused import
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.
Done.
}) | ||
self.default_expected.set_index('UTC', inplace=True) | ||
|
||
|
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.
There should be 1 blank line
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.
Done.
_check_dataframes_match(binding_pmaxs, expected) | ||
|
||
def test_pmax_constraints_default_sepc_epsilon1(self): | ||
binding_pmaxs = pmax_constraints(self.mock_scenario, epsilon=1e-3) |
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.
sepc --> spec in function name.
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.
Done.
_check_dataframes_match(binding_pmaxs, expected) | ||
|
||
def test_pmax_constraints_default_sepc_epsilon2(self): | ||
binding_pmaxs = pmax_constraints(self.mock_scenario, epsilon=1e-6) |
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.
same 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.
Done.
expected.loc['t1', 'B'] = False | ||
_check_dataframes_match(binding_pmaxs, expected) | ||
|
||
def test_pmax_constraints_default_sepc_epsilon3(self): |
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.
same 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.
Done.
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. Tests seem to cover everything.
4b039b2
to
a836ed9
Compare
Purpose
This is a re-creation of #58, to analyze binding generator constraints. Thanks to the MATReader framework, we can now re-open this PR!
Validation
New integration tests:
Explanation: each function generates a boolean dataframe of the same dimension as PG. We can perform some groupby analysis to see that, for the Western 2016 base scenario:
INF
within REISE.Time to review
Half an hour.