Skip to content
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

Subtract demominator by one #20

Merged
merged 8 commits into from
Aug 16, 2024
Merged

Subtract demominator by one #20

merged 8 commits into from
Aug 16, 2024

Conversation

kolcz
Copy link
Contributor

@kolcz kolcz commented Apr 3, 2024

Add subtraction by 1 to denominator

@kolcz kolcz mentioned this pull request Apr 3, 2024
@bablokb
Copy link

bablokb commented Aug 15, 2024

Is there a reason why this is not merged? From a practical point of view, it does not matter (one per-mill of a degree), but there is no reason to have it wrong. The only argument would be performance if you would use bit-shifting, but the code doesn't.

@FoamyGuy
Copy link
Contributor

@bablokb I think it's just waiting for review / testing. Do you have access to one of these devices to test with?

I'm not familiar at all with this chip, and don't have one to test with. Are you familiar with the device? If so can you confirm the change is correct?

@bablokb
Copy link

bablokb commented Aug 15, 2024

Yes I have these devices (both SCD40 and SCD41). And the change is correct.

Nevertheless, I propose a change. @kolcz: could you replace the 2**16-1 with a constant? It should have been a constant in the first place, but when you are already changing it, then I would suggest to make it a constant.

@kolcz
Copy link
Contributor Author

kolcz commented Aug 15, 2024

Sorry for the long response, but I have adventures with pre-commit checks. I have changed 2^16 -1 to exact value and added line comments with equations for clarity. I have made changes also in temperature_offset getter and setter. @bablokb please test the code now. @FoamyGuy I wait for your review.

@bablokb
Copy link

bablokb commented Aug 16, 2024

I successfully tested the new code.

@FoamyGuy I think you can go ahead and merge the PR.

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix @kolcz and Thank you @bablokb for insight and review!

@FoamyGuy FoamyGuy merged commit be632f7 into adafruit:main Aug 16, 2024
1 check passed
tannewt added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Aug 16, 2024
Updating https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15 to 2.3.0 from 2.2.26:
  > Merge pull request adafruit/Adafruit_CircuitPython_ADS1x15#98 from RoaCode/comparator

Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1306 to 2.0.3 from 2.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_SSD1306#46 from EAGrahamJr/revert-sleep

Updating https://github.com/adafruit/Adafruit_CircuitPython_FT5336 to 1.1.0 from 1.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_FT5336#6 from adafruit/axis_swap

Updating https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731 to 3.4.2 from 3.4.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_IS31FL3731#56 from FoamyGuy/use_ruff

Updating https://github.com/adafruit/Adafruit_CircuitPython_PyPortal to 6.3.5 from 6.3.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_PyPortal#136 from tannewt/fix_gitattributes

Updating https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display to 3.12.5 from 3.12.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_RGB_Display#126 from simonldwg/ssd1331-remove-prints

Updating https://github.com/adafruit/Adafruit_CircuitPython_SCD4X to 1.4.3 from 1.4.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_SCD4X#20 from kolcz/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad to 1.23.0 from 1.21.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_ImageLoad#84 from deshipu/bug-74
  > Merge pull request adafruit/Adafruit_CircuitPython_ImageLoad#83 from deshipu/png-filters
  > Merge pull request adafruit/Adafruit_CircuitPython_ImageLoad#82 from ch4nsuk3/png-transparency

Updating https://github.com/adafruit/Adafruit_CircuitPython_Logging to 5.5.0 from 5.4.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_Logging#61 from FoamyGuy/formatters
  > Merge pull request adafruit/Adafruit_CircuitPython_Logging#62 from FoamyGuy/remove_extra_newline

Updating https://github.com/adafruit/Adafruit_CircuitPython_MIDI to 1.4.19 from 1.4.18:
  > Merge pull request adafruit/Adafruit_CircuitPython_MIDI#52 from jordanhemingway-revvity/type_annotations

Updating https://github.com/adafruit/Adafruit_CircuitPython_Ticks to 1.1.0 from 1.0.13:
  > Merge pull request adafruit/Adafruit_CircuitPython_Ticks#11 from adafruit/ticks-exception-like-micropython

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Added the following libraries: Adafruit_CircuitPython_RFM
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.

3 participants