From 933d11ebc7121464f4a297f3b701bdb559bdb9f4 Mon Sep 17 00:00:00 2001 From: XANTRONIX Industrial Date: Fri, 14 Mar 2025 11:00:37 -0400 Subject: [PATCH] Implement SeriesIntersection.inverse() Implement SeriesIntersection.inverse() to return the inverse of the current intersection type --- lib/xmet/series.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/xmet/series.py b/lib/xmet/series.py index d8c7e12..9ca3cec 100644 --- a/lib/xmet/series.py +++ b/lib/xmet/series.py @@ -17,6 +17,14 @@ class SeriesIntersection(enum.Enum): elif a < b: return SeriesIntersection.LESSER + def inverse(self): + if self is SeriesIntersection.GREATER: + return SeriesIntersection.LESSER + elif self is SeriesIntersection.LESSER: + return SeriesIntersection.GREATER + + return self + class Series(dict): def __init__(self): super().__init__()