Skip to content

Commit

Permalink
Fix flaky test of truncated normal
Browse files Browse the repository at this point in the history
  • Loading branch information
dafeda committed Sep 12, 2023
1 parent fe72f84 commit fcfb7de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/unit_tests/config/test_transfer_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ def test_that_truncated_normal_is_monotonic(x1, x2, arg):
result1 = TransferFunction.trans_truncated_normal(x1, arg)
result2 = TransferFunction.trans_truncated_normal(x2, arg)

if x1 < x2:
if np.isclose(x1, x2):
assert np.isclose(result1, result2)
elif x1 < x2:
# Results should be different unless clamped
assert (
result1 < result2
or (result1 == arg[2] and result2 == arg[2])
or (result1 == arg[3] and result2 == arg[3])
)
elif x1 == x2:
assert result1 == result2


@given(valid_params())
Expand Down

0 comments on commit fcfb7de

Please sign in to comment.