Skip to content

basic refactoring to remove errors #1

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

Merged
merged 7 commits into from
May 5, 2025
Merged

Conversation

bablokb
Copy link
Contributor

@bablokb bablokb commented Dec 16, 2024

This is currently a draft PR: I refactored large parts of the code to make it at least error free from the Python perspective. I still have to setup the device and actually test it, but the current code definitely does not run (just run pylint, see all the errors and you know why).

Main changes: I moved a lot of the code from the container class INA3221 to the INA3221Channel class. This not only simplifies logic and removes errors, but also follows usual OO design best practices (e.g. keep properties and related code where they belong).

More to come (probably next year)...

@bablokb
Copy link
Contributor Author

bablokb commented Apr 7, 2025

So this is now tested and ready to merge. It fixes a number of things (syntax wise and logic-wise), cleans the code and makes the API consistent with the INA219 library.

@ladyada ladyada requested a review from BlitzCityDIY May 4, 2025 16:21
@BlitzCityDIY BlitzCityDIY merged commit c1a7316 into adafruit:main May 5, 2025
1 check passed
@bablokb bablokb deleted the refactor branch May 5, 2025 13:17
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request May 13, 2025
Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SH1107 to 2.0.2 from 2.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_SH1107#28 from RetiredWizard/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_INA3221 to 1.1.0 from 1.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_INA3221#1 from bablokb/refactor

Updating https://github.com/adafruit/Adafruit_CircuitPython_OV5640 to 1.2.5 from 1.2.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_OV5640#36 from casten/patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_RA8875 to 3.1.23 from 3.1.22:
  > Merge pull request adafruit/Adafruit_CircuitPython_RA8875#33 from makermelissa/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_TLV320 to 1.1.0 from 1.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_TLV320#7 from adafruit/add_reset
  > Merge pull request adafruit/Adafruit_CircuitPython_TLV320#6 from adafruit/volume_update

Updating https://github.com/adafruit/Adafruit_CircuitPython_Pathlib to 1.0.2 from 1.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_Pathlib#1 from FoamyGuy/fix_error_num
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants