-
Notifications
You must be signed in to change notification settings - Fork 184
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
Fix invalid value error in weekly_hours_worked file by using np.divide #5505
Fix invalid value error in weekly_hours_worked file by using np.divide #5505
Conversation
… with out and where parameters
lsr_relative_change = np.divide( | ||
income_effect, | ||
original_earnings, | ||
out=np.zeros_like( |
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.
To avoid awkward line breaks.
out=np.zeros_like( | |
# Assign no LSR change to people with no original earnings to avoid dividing by zero. | |
out=np.zeros_like(income_effect, dtype=np.float32), | |
where=original_earnings != 0, |
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.
Try make format
and please add the comment I suggested
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5505 +/- ##
==========================================
- Coverage 99.12% 99.10% -0.03%
==========================================
Files 2592 2679 +87
Lines 37707 38827 +1120
Branches 162 168 +6
==========================================
+ Hits 37378 38478 +1100
- Misses 297 315 +18
- Partials 32 34 +2 ☔ View full report in Codecov by Sentry. |
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.
Could you please add a unit test for this?
Fixes issue #4889 and #4890 (Used np.divide NumPy function with out and where parameters to solve invalid value encountered when dividing income_effect by original_earnings and dividing substitution_effect by original_earnings in weekly hours worked calculation in weekly hours worked file.)