Skip to content

Commit

Permalink
Use relative tolerance for triangular test
Browse files Browse the repository at this point in the history
  • Loading branch information
eivindjahren committed Jan 24, 2024
1 parent 0795f09 commit 626631b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/unit_tests/config/test_transfer_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ def test_that_triangular_is_symmetric_around_mode(args):
y2 = TransferFunction.trans_triangular(x2, [_min, _mode, _max])

# Check if y1 and y2 are symmetric around the mode
assert abs((_mode - y1) - (y2 - _mode)) < 1e-5
assert abs((_mode - y1) - (y2 - _mode)) < 1e-15 * max(
*map(abs, [x1, x2, _min, _mode, _max])
)


@given(valid_triangular_params())
Expand Down

0 comments on commit 626631b

Please sign in to comment.