-
-
Notifications
You must be signed in to change notification settings - Fork 9
[BUG] Fix single trace zero division error #268
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
[BUG] Fix single trace zero division error #268
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #268 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 13 13
Lines 537 541 +4
Branches 70 72 +2
=========================================
+ Hits 537 541 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
@sstephanyy just noticed that you added your changes to the wrong section of the changelog. No worries of course but this would mean that your changes would not be listed in the next release notes 😨 Fixed in bba6be2 ✅ |
|
@sstephanyy I simplified your test cases a bit by using |
Thanks so much for the fix :) |
wow, well-done. I do know about the existence of |
…-division-error' into fix/single-trace-zero-division-error
|
@sstephanyy let me know if the new test cases I pushed were helpful or whether you want more help here 👍 See this as well |
tpvasconcelos
left a comment
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.
Thank you @sstephanyy for your work here!
Description
To prevent the
ZeroDivisionErrorfrom occurring when using index-based colormodes with a single trace or a single row of data, the code has been modified to check the number of rows before performing any calculations. If only one row is present, a default color value (like 0.0) is returned instead of attempting to divide by zero.Related issues
Closes #252
PR check list
docs/api/internal/.docs/api/index.rst.versionadded,versionchanged, ordeprecateddirectives to docstrings.MAJOR.MINOR.PATCH(e.g., if the current version is0.2.3, the next release will be0.3.0).docs/reference/changelog.md.📚 Documentation preview 📚: https://ridgeplot--268.org.readthedocs.build/en/268/