Skip to content

Commit

Permalink
Condition: Threshold: fix incorrect tolerance warning for comparators
Browse files Browse the repository at this point in the history
logic error caused warning to be issued when any tolerance set for any
comparator, not just inequalities
  • Loading branch information
kmantel committed Dec 11, 2023
1 parent a99ec73 commit a8259a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/graph_scheduler/condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit a8259a4

Please sign in to comment.