Skip to content

Commit 5ce481d

Browse files
committed
Chain comparisons in _ArePixelsAdjacent()
1 parent 91524c5 commit 5ce481d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

adafruit_mlx90640.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -792,14 +792,14 @@ def _UniqueListPairs(self, inputList):
792792
yield (listValue1, listValue2)
793793

794794
def _ArePixelsAdjacent(self, pix1, pix2):
795-
# pylint: disable=no-self-use, chained-comparison
795+
# pylint: disable=no-self-use
796796
pixPosDif = pix1 - pix2
797797

798-
if pixPosDif > -34 and pixPosDif < -30:
798+
if -34 < pixPosDif < -30:
799799
return True
800-
if pixPosDif > -2 and pixPosDif < 2:
800+
if -2 < pixPosDif < 2:
801801
return True
802-
if pixPosDif > 30 and pixPosDif < 34:
802+
if 30 < pixPosDif < 34:
803803
return True
804804

805805
return False

0 commit comments

Comments
 (0)