-
Notifications
You must be signed in to change notification settings - Fork 127
Improved handling for division by zero #943
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
Improved handling for division by zero #943
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #943 +/- ##
=====================================
Coverage 94.8% 94.9%
=====================================
Files 68 68
Lines 6474 6504 +30
=====================================
+ Hits 6143 6173 +30
Misses 331 331 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Also added some refactoring to avoid importing internal methods to remove some formatting-warnings. |
phackstock
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.
Looks good to me in principle. As detailed below, I think the two explicit zero checks outside of the series are a bit overkill as you'd get the division by zero error anyway.
phackstock
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.
Good to be merged from my side.
Please confirm that this PR has done the following:
Documentation AddedName of contributors Added to AUTHORS.rstDescription of PR
PR #937 added safeguards against inf-values in timeseries data, but this can lead to errors when using the
IamDataFrame.divide()method. This PR raises an error when diving by a scalar and drops the offending rows (and prints to log) if dividing the data along an axis.