-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: Interpolate limit=n GH16282 #16429
BUG: Interpolate limit=n GH16282 #16429
Conversation
Codecov Report
@@ Coverage Diff @@
## master #16429 +/- ##
==========================================
- Coverage 90.42% 90.42% -0.01%
==========================================
Files 161 161
Lines 51023 51023
==========================================
- Hits 46138 46137 -1
- Misses 4885 4886 +1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #16429 +/- ##
=======================================
Coverage 90.42% 90.42%
=======================================
Files 161 161
Lines 51023 51023
=======================================
Hits 46138 46138
Misses 4885 4885
Continue to review full report at Codecov.
|
Sorry to have to ask a general questions, but can someone explain how my code coverage can go down in a file that I have not changed? Codecov correctly identified an uncovered return parameter from a function in common.py, but I have not modified that file. I went ahead and added the appropriate test (which does not relate to this issue), because it was very simple to cover the case. I just don't know why codecov is saying my branch reduces coverage in that file if I have not changed it. |
doc/source/whatsnew/v0.21.0.txt
Outdated
@@ -106,6 +106,8 @@ Reshaping | |||
|
|||
Numeric | |||
^^^^^^^ | |||
- DataFrame.interpolate was not respecting limit_direction when using the default limit=None (unlimited). Specifically, it would always use limit_direction='forward' even when limit_direction was set otherwise. Now default limit=None will work with other directions. :issue:`16282` |
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.
you can move this to 0.20.0. Make much shorter.
Bug in .interpolate()
, where limit_direction
was not respected when limit=None
(default) was passed (:issue:16282
)
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.
Hi Jeff @jreback , 2 questions:
-
Can you give me a basic pointer on getting this into 0.20.0? i.e. is that a new pull request? Is there a way I can apply my branch to 0.20.0 (I'm just learning GitHub).
-
What is the proper way to ping when a pull request is ready for review (all green). Just a comment?
Thanks!
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.
I think 0.20 was a typo. Probably mean 0.20.2. There's a whatsnew/v0.20.2.txt
. You can move this section there (and make it a bit shorter. Typically just a sentence, and people can click on the link to the issue if they're interested in more).
And yeah, just a comment when you're ready for review, or when you notice that all the checkmarks at the bottom are green and it's ready for review.
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.
Thanks @TomAugspurger, I thought Jeff wanted me to somehow move the change to the 0.20 branch. That change is in. I will ping when green.
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.
minor comment. ping when pushed and green.
All green. Ready for review. Thanks. |
@@ -16,6 +16,7 @@ def test_mut_exclusive(): | |||
com._mut_exclusive(a=1, b=2) | |||
assert com._mut_exclusive(a=1, b=None) == 1 | |||
assert com._mut_exclusive(major=None, major_axis=None) is None | |||
assert com._mut_exclusive(a=None, b=2) == 2 |
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.
Was this change intentional? If not I can remove it just before merging.
Basically, codecov was failing because a particular line of common.py was
not covered. I did not touch that file, but I did see that the line needed
a test. I added it, and coverage was fixed.
You can remove it, but it is actually the correct test for increased
coverage, and you can see that it is very simple. (unless someone else has
already added that test since yesterday).
I still don't know how my coverage can go down in a file I have not
touched, but I noticed it was happening to others as well.
Thanks
…On Tue, May 23, 2017 at 11:35 AM, Tom Augspurger ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In pandas/tests/test_common.py
<#16429 (comment)>:
> @@ -16,6 +16,7 @@ def test_mut_exclusive():
com._mut_exclusive(a=1, b=2)
assert com._mut_exclusive(a=1, b=None) == 1
assert com._mut_exclusive(major=None, major_axis=None) is None
+ assert com._mut_exclusive(a=None, b=2) == 2
Was this change intentional? If not I can remove it just before merging.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#16429 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/APZUQe8I1TEwxwQLAWgSxkqM8eFr8OOFks5r8vzcgaJpZM4NiySk>
.
|
@WBare thanks, more tests are good :) Just making sure it was intentional. Codecov can be a bit weird about how it counts changes. |
Removed extraneous newline
Just pushed a small change to remove the newline in the 0.21 file. Merging. |
* BUG: Interpolate limit=n GH16282 * Fix: comment line over the 80 char limit * Test: Added small test for code coverage * DOC: Moved whats new comment from 0.21.0 to 0.20.2 * Update v0.21.0.txt Removed extraneous newline (cherry picked from commit a8a497f)
* BUG: Interpolate limit=n GH16282 * Fix: comment line over the 80 char limit * Test: Added small test for code coverage * DOC: Moved whats new comment from 0.21.0 to 0.20.2 * Update v0.21.0.txt Removed extraneous newline (cherry picked from commit a8a497f)
|
||
# each possible limit_direction | ||
if limit_direction == 'forward': | ||
violate_limit = sorted(start_nans | |
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.
@TomAugspurger not sure if this is where the perf issue is (maybe because not this IS hit in all code).
these can be done via Index set ops
IOW
start_nans = Index(range(.....))
violate_limit = start_nans.union(Index(_interp_limit(invalid, limit, 0))).sort_values()
for example
Most of the time is in the _interp_limit function actually. I have a vectorized solution I'll push tonight.
… On Jun 2, 2017, at 17:38, Jeff Reback ***@***.***> wrote:
@jreback commented on this pull request.
In pandas/core/missing.py:
> + # are more than 'limit' away from any non-NaN.
+ #
+ # If limit=None, then use default behavior of filling an unlimited number
+ # of NaNs in the direction specified by limit_direction
+
+ # default limit is unlimited GH #16282
+ if limit is None:
+ limit = len(xvalues)
+ elif not is_integer(limit):
+ raise ValueError('Limit must be an integer')
+ elif limit < 1:
+ raise ValueError('Limit must be greater than 0')
+
+ # each possible limit_direction
+ if limit_direction == 'forward':
+ violate_limit = sorted(start_nans |
@TomAugspurger not sure if this is where the perf issue is (maybe because not this IS hit in all code).
these can be done via Index set ops
IOW
start_nans = Index(range(.....))
violate_limit = start_nans.union(Index(_interp_limit(invalid, limit, 0))).sort_values()
for example
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
* BUG: Interpolate limit=n GH16282 * Fix: comment line over the 80 char limit * Test: Added small test for code coverage * DOC: Moved whats new comment from 0.21.0 to 0.20.2 * Update v0.21.0.txt Removed extraneous newline
git diff upstream/master --name-only -- '*.py' | flake8 --diff