Skip to content

Commit

Permalink
more flexibility tests
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbynum committed Apr 25, 2024
1 parent 6743fb1 commit 7cb6ee8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def main(method):
config=config,
)
print(results)
return results


if __name__ == "__main__":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from idaes.apps.flexibility_analysis.examples import (
linear_hx_network,
idaes_hx_network,
nonlin_hx_network,
)
from idaes.core.util.testing import _enable_scip_solver_for_testing

Expand All @@ -42,6 +43,13 @@ def scip_solver():

@pytest.mark.component
class TestExamples(unittest.TestCase):
def test_nonlin_hx_network(self):
with scip_solver():
res = nonlin_hx_network.main(
method=flex.FlexTestMethod.active_constraint,
)
self.assertAlmostEqual(res, 0.1474609375, 3)

def test_linear_hx_network(self):
with scip_solver():
res = linear_hx_network.main(
Expand Down
2 changes: 1 addition & 1 deletion idaes/apps/flexibility_analysis/flextest.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ def _solve_flextest_decision_rule(
config=config,
)
opt = config.minlp_solver
res = opt.solve(m, tee=True)
res = opt.solve(m)
pe.assert_optimal_termination(res)

results = FlexTestResults()
Expand Down

0 comments on commit 7cb6ee8

Please sign in to comment.