Repository: adafruit/Adafruit_CircuitPython_MLX90640 (language: python)

Issue:
Handle broken pixels
I got a mlx90640 with a defective pixel and even though the datasheet says that it's acceptable up to 4, the library was not able to recover and was crashing when trying to calculate the forth root of a negative number:

```
Traceback (most recent call last):
  File "mlx90640_camtest.py", line 124, in <module>
    raise e
  File "mlx90640_camtest.py", line 121, in <module>
    mlx.getFrame(frame)
  File "/home/fgervais/Adafruit_CircuitPython_MLX90640/adafruit_mlx90640.py", line 159, in getFrame
    self._CalculateTo(mlx90640Frame, emissivity, tr, framebuf)
  File "/home/fgervais/Adafruit_CircuitPython_MLX90640/adafruit_mlx90640.py", line 341, in _CalculateTo
    Sx = math.sqrt(math.sqrt(Sx)) * self.ksTo[1]
ValueError: math domain error
```
I added the missing code to handle broken adjacent pixels that had been left out from the library port (noted as TODO) and added the code to detect and "fix" broken pixels when doing the conversion to Celsius.

I must say, I made the dumbest fix but hey, at least it's a valid option recommended by the datasheet :). If I end up needing the more advanced interpolation fixes I'll gladly PR them later on.



Discussion / hints:
Any suggestions about the linter errors?
see https://learn.adafruit.com/improve-your-code-with-pylint for a guide!
I see. Well I get the errors but let say "Method could be a function". I agree but I still feel like it makes more sense to have it in the class since it's functionally related and also there is no other functions in the module currently so I feel it would look weird to add two lonely little functions.

Then "Too many branches", I think this part fits well with the code already in place and what mlx90640-library has which everything seems to be translated from.

Lastly "Simplify chained comparison between the operands", well I kept it close to the mlx90640-library. I feel the code is pretty clear too.

From my point of view I would ignore all those but I can change any part of the code so it suits your tastes better.
Should I put the utility method `_UniqueListPairs()` outside of the class?

Fix patch:
diff --git a/examples/mlx90640_pil.py b/examples/mlx90640_pil.py
index a940695..3ff7300 100644
--- a/examples/mlx90640_pil.py
+++ b/examples/mlx90640_pil.py
@@ -2,9 +2,9 @@
    It will not work on microcontrollers running CircuitPython!"""
 
 import math
+from PIL import Image
 import board
 import adafruit_mlx90640
-from PIL import Image
 
 FILENAME = "mlx.jpg"
 
diff --git a/examples/mlx90640_pygamer.py b/examples/mlx90640_pygamer.py
index 6b22401..31c72ab 100644
--- a/examples/mlx90640_pygamer.py
+++ b/examples/mlx90640_pygamer.py
@@ -1,11 +1,11 @@
 import time
 import board
 import busio
-import adafruit_mlx90640
 import displayio
 import terminalio
 from adafruit_display_text.label import Label
 from simpleio import map_range
+import adafruit_mlx90640
 
 number_of_colors = 64  # Number of color in the gradian
 last_color = number_of_colors - 1  # Last color in palette


Test patch:
diff --git a/examples/mlx90640_camtest.py b/examples/mlx90640_camtest.py
index 82c1ae4..8d4ea54 100644
--- a/examples/mlx90640_camtest.py
+++ b/examples/mlx90640_camtest.py
@@ -6,10 +6,10 @@
 import math
 import time
 import argparse
-import board
-import busio
 from PIL import Image
 import pygame
+import board
+import busio
 
 import adafruit_mlx90640