From 89c3677a74be26d535abe6c09bb7241a538d092d Mon Sep 17 00:00:00 2001 From: kmantel <1592123+kmantel@users.noreply.github.com> Date: Mon, 11 Dec 2023 23:22:44 -0500 Subject: [PATCH] Condition: Threshold: fix incorrect tolerance warning for comparators (#112) logic error caused warning to be issued when any tolerance set for any comparator, not just inequalities --- src/graph_scheduler/condition.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graph_scheduler/condition.py b/src/graph_scheduler/condition.py index d4c47933..2c487cb9 100644 --- a/src/graph_scheduler/condition.py +++ b/src/graph_scheduler/condition.py @@ -2042,7 +2042,7 @@ def __init__( if comparator not in comparison_operators: raise ConditionError(f'Operator must be one of {list(comparison_operators.keys())}') - if atol != 0 or rtol != 0 and comparator in {'<', '<=', '>', '>='}: + if (atol != 0 or rtol != 0) and comparator in {'<', '<=', '>', '>='}: warnings.warn('Tolerances for inequality comparators are ignored') if isinstance(indices, TimeScale):