Skip to content

Commit

Permalink
Changed absolute tolerance in test_cobyla_constraints and other sma…
Browse files Browse the repository at this point in the history
…ll errors

signing
  • Loading branch information
sahinbatu committed Apr 16, 2024
1 parent 0e874b0 commit aafac5f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions openmdao/recorders/tests/test_sqlite_recorder.py
Expand Up @@ -2747,10 +2747,10 @@ def test_cobyla_constraints(self):
obj = case.get_objectives()

assert_near_equal(obj, {'f_xy': -27.33333333}, tolerance=1e-8)
assert_near_equal(dvs, {'x': 6.66666669, 'y': -7.33333338}, tolerance=1e-8, atol=1e-7)
assert_near_equal(dvs, {'x': 6.66666669, 'y': -7.33333338}, tolerance=1e-8, atol=8.1e-8)

if Version(scipy_version) < Version("1.11"):
assert_near_equal(con, {'x': 6.66666669, 'y': -7.33333338}, tolerance=1e-8, atol=1e-7)
assert_near_equal(con, {'x': 6.66666669, 'y': -7.33333338}, tolerance=1e-8, atol=8.1e-8)
else:
self.assertEqual(con, {})

Expand Down
2 changes: 1 addition & 1 deletion openmdao/utils/assert_utils.py
Expand Up @@ -575,7 +575,7 @@ def assert_near_equal(actual, desired, tolerance=1e-15, atol=None):

if atol:
if abs(error) > atol:
raise ValueError('actual %s, desired %s, rel error %s, absolute tolerance %s'
raise ValueError('actual %s, desired %s, abs error %s, abs tolerance %s'
% (actual, desired, error, atol))
elif abs(error) > tolerance:
if actual.size < 10 and desired.size < 10:
Expand Down

0 comments on commit aafac5f

Please sign in to comment.