Skip to content

Commit

Permalink
ran black on test_hs071.py
Browse files Browse the repository at this point in the history
  • Loading branch information
robfalck committed Nov 14, 2024
1 parent de767a8 commit 4cb9a90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_hs071.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,16 +214,16 @@ def test_optimization(self, optName):
# Check informs
self.assert_inform_equal(sol)
# Check the lagrange multipliers in the solution text
lines = str(sol).split('\n')
lines = str(sol).split("\n")
constraint_header_line_num = [i for i, line in enumerate(lines) if "Constraints" in line][0]
con1_line_num = constraint_header_line_num + 2
con2_line_num = constraint_header_line_num + 3
lambda_con1 = float(lines[con1_line_num].split()[-1])
lambda_con2 = float(lines[con2_line_num].split()[-1])
if optName in ("IPOPT", "SNOPT", "ParOpt"):
assert_allclose([lambda_con1, lambda_con2], self.lambdaStar[0]["con"], rtol=1.0E-5, atol=1.0E-5)
assert_allclose([lambda_con1, lambda_con2], self.lambdaStar[0]["con"], rtol=1.0e-5, atol=1.0e-5)
else:
assert_allclose([lambda_con1, lambda_con2], [9.E100, 9.E100], rtol=1.0E-5, atol=1.0E-5)
assert_allclose([lambda_con1, lambda_con2], [9.0e100, 9.0e100], rtol=1.0e-5, atol=1.0e-5)


if __name__ == "__main__":
Expand Down

0 comments on commit 4cb9a90

Please sign in to comment.