Skip to content

Commit

Permalink
240501.135558.HKT revoke the changes to test_combining_constraints.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zaikunzhang committed May 1, 2024
1 parent 5ad0370 commit 7a49bb6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions python/tests/test_combining_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ def test_providing_bounds_and_nonlinear_constraints():
bounds = prima_Bounds([None, 1], [None, 1])
x0 = [0, 0]
res = prima_minimize(fun, x0, constraints=nlc, bounds=bounds)
#assert np.isclose(res.x[0], 5, atol=1e-6, rtol=1e-6) # Zaikun 20240501: fails on macOS-14 ARM64
assert np.isclose(res.x[0], 5, atol=1e-3, rtol=1e-3)
assert np.isclose(res.x[0], 5, atol=1e-6, rtol=1e-6)
assert np.isclose(res.x[1], 1, atol=1e-6, rtol=1e-6)
assert np.isclose(res.fun, 9, atol=1e-6, rtol=1e-6)
assert res.method == "cobyla"
Expand Down Expand Up @@ -70,8 +69,7 @@ def newfun(x):

# 32 bit builds of PRIMA reach the optimal solution with the same level of precision as 64 bit builds
# so we lower the atol/rtol to 1e-3 so that 32 bit builds will pass.
#assert np.isclose(res.x[0], 5.5, atol=1e-3, rtol=1e-3) # Zaikun 20240501: fails on macOS-14 ARM64
assert np.isclose(res.x[0], 5.5, atol=2e-2, rtol=2e-2)
assert np.isclose(res.x[0], 5.5, atol=1e-3, rtol=1e-3)
assert np.isclose(res.x[1], 1, atol=1e-6, rtol=1e-6)
assert np.isclose(res.x[2], 3.5, atol=1e-3, rtol=1e-3)
assert np.isclose(res.fun, 9.5, atol=1e-3, rtol=1e-3)
Expand Down

0 comments on commit 7a49bb6

Please sign in to comment.