-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: interpolate_1d returns function to apply columnwise #34728
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
Closed
simonjayhawkins
wants to merge
14
commits into
pandas-dev:master
from
simonjayhawkins:functional-interpolate
Closed
Changes from 4 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
659895f
interpolate_1d returns function
simonjayhawkins 31596cd
Merge remote-tracking branch 'upstream/master' into functional-interp…
simonjayhawkins 3f293f6
Merge remote-tracking branch 'upstream/master' into functional-interp…
simonjayhawkins 810767a
fixup whitespace from merge
simonjayhawkins 37ffd1e
Merge remote-tracking branch 'upstream/master' into functional-interp…
simonjayhawkins e676a10
use class instead
simonjayhawkins f7c70a0
preserve_nans logic to seperate method for profiling
simonjayhawkins cb1228e
add validators and convertors
simonjayhawkins fb43c8e
move dispatch logic outside interpolate
simonjayhawkins 3482e23
remove unneeded class attributes
simonjayhawkins 871902c
remove xvalues from class atrributes
simonjayhawkins 8a46508
create NumPyInterpolator class
simonjayhawkins 54b762a
move argsort from interpolate to init
simonjayhawkins 3e19666
Merge remote-tracking branch 'upstream/master' into functional-interp…
simonjayhawkins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
can you make this a module level function and give it a nice name
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.
doc-string as well
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.
it needs to be a closure
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.
really? can you pass any needed arguments, this makes it really hard to grok
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.
the code in this function is applied columnwise, the perf gains will come from doing some things once instead of 100x for the asv.
I prefer this functional approach to pre-validation as it keeps related code together. There is some more cleaning which could move more into the outer function once it's called less often
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 understand, but having this an outer function with passing args should not have any impact on performance. It simply a more understandable approach. ok with merging then refactoring to be simpler later though.
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.
its basically the processing of the index which only needs to be done once. However, with the bulk of the time on the preserve_nans set logic, there is no sig perf gains yet, hence draft for now.
originally grouped the validation see #34628. So can do it that way if preferred.
i.e. method, xvalues = missing.clean_interp_method(method, index, **kwargs)
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.
kk sure, i think you have 1 PR pending that we should merge before this i think. but lmk what you prefer.
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.
yeah, trying not to affect the work by @cchwala, I have an alternative implementation of limit_direction that does not re-use the preserve_nans set logic, see #34628
so i'm now happy #34727 need not affect that, but still need to look at the max_gap algo
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.
sorry #34749 not #34628