From a8259a48b0f1bf91882197a4ee0a8870afd38805 Mon Sep 17 00:00:00 2001 From: Katherine Mantel Date: Sat, 9 Dec 2023 02:09:25 +0000 Subject: [PATCH] Condition: Threshold: fix incorrect tolerance warning for comparators 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):