Skip to content

Guard against ZeroDivisionError #47

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 1 commit into from
Apr 19, 2022
Merged

Guard against ZeroDivisionError #47

merged 1 commit into from
Apr 19, 2022

Conversation

tekktrik
Copy link
Member

Resolves #46 by forcing an arbitrarily different y_top and y_bottom for sparklines if autorange is set. This will guard against ZeroDivisionError until a value that will otherwise set the autorange is added.

@tekktrik tekktrik requested a review from a team April 19, 2022 02:13
@tekktrik
Copy link
Member Author

Converted the sparkline examples to work on a MagTag and successfully tested

Copy link

@jepler jepler left a comment

Choose a reason for hiding this comment

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

Thanks!

@tekktrik tekktrik merged commit 2fad6f2 into adafruit:main Apr 19, 2022
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Apr 20, 2022
Updating https://github.com/adafruit/Adafruit_CircuitPython_BME680 to 3.4.3 from 3.4.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_BME680#49 from billvanleeuwen424/main
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Shapes to 2.4.3 from 2.4.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Shapes#47 from tekktrik/dev/divide-by-zero
  > Update Black to latest.
  > Merge branch 'ladyada:master' into main
  > Fixed readthedocs build
  > Post-patch cleanup

Updating https://github.com/adafruit/Adafruit_CircuitPython_PortalBase to 1.12.0 from 1.11.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_PortalBase#65 from tekktrik/dev/multiple-wifi

Updating https://github.com/adafruit/Adafruit_CircuitPython_RSA to 1.2.8 from 1.2.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_RSA#27 from tekktrik/doc/add-documentation
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.

sparkline.py: division by zero
2 participants