-
-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
ENH: Rolling window with step size (GH-15354) #45735
Conversation
This is quite a large PR because the introduction of a step argument requires changes in multiple places where rolling window functionality is implemented or exposed, which in turn requires adding a bunch of tests to cover these changes. The general rule is that adding While the code for this PR took some time to figure out, almost all of the changes seem reasonable to me in hindsight. Nevertheless, one thing I'm worried about is the interaction of this PR with #42915. Specifically, the test_rolling_corr_cov_other_diff_size_as_groups test case ran into trouble and I could only get it to work with the following changes:
|
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.
Given this PR is so large, it would be easier to review in chunks. Might help to divide as:
- All internal changes needed to support step without step being exposed to the user
- Adding step API, tests, docs
Also some thoughts about part 2)
- I recommend having a dedicated file to test the steps API (
test_step.py
) - For
cov
,corr
,ewm.<method>
,expanding.<method>
and all groupby variants, I recommend just raising aNotImplementedError
@mroeschke: I'd like to try to clean up the errors in this PR first. After that I don't mind canceling it and just using it as a reference as needed. What do you have in mind for IIRC, I did not add a step parameter to |
Ah okay sure then this is a good argument to keep step in the existing tests.
I slightly prefer having dedicated behavior than experimental per-se i.e. I would rather raise a But if through your investigation you are confident about the intended behavior with corr/cov, then I'll defer to you. |
While I'm reasonably confident about the expected behavior of most rolling window step-operations as discussed in #15354, I'd suggest posting there about the As for |
AFAICS, the build failure is benign and this PR is cleaned up of errors. I'll work on starting a separate PR that advances in manageable chunks. |
I'm closing this PR and will open a replacement one soon. |
Replaced by #45765. |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.