-
Notifications
You must be signed in to change notification settings - Fork 19
Handle broken pixels #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discord user milinile reports that this PR addresses the problem for them.
Thank you @fgervais ! |
I'm glad I could help :) |
Updating https://github.com/adafruit/Adafruit_CircuitPython_MLX90640 to 1.2.0 from 1.1.5: > Merge pull request adafruit/Adafruit_CircuitPython_MLX90640#21 from adafruit/fix-pylint > Merge pull request adafruit/Adafruit_CircuitPython_MLX90640#18 from fgervais/broken-pixels Updating https://github.com/adafruit/Adafruit_CircuitPython_PyPortal to 3.4.0 from 3.3.1: > Merge pull request adafruit/Adafruit_CircuitPython_PyPortal#83 from cjsieh/scard_vs_sdcardio Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE to 7.3.0 from 7.2.1: > Merge pull request adafruit/Adafruit_CircuitPython_BLE#103 from dhalbert/hci Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE_BerryMed_Pulse_Oximeter to 2.0.2 from 2.0.1: > Merge pull request adafruit/Adafruit_CircuitPython_BLE_BerryMed_Pulse_Oximeter#4 from dhalbert/up-to-date-data Updating https://github.com/adafruit/Adafruit_CircuitPython_framebuf to 1.4.1 from 1.3.4: > Merge pull request adafruit/Adafruit_CircuitPython_framebuf#35 from makermelissa/master > Merge pull request adafruit/Adafruit_CircuitPython_framebuf#34 from makermelissa/master > Merge pull request adafruit/Adafruit_CircuitPython_framebuf#33 from jsharper/fix/jsharper/image-rotate
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:
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.