-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
rolling: periodic #2011
rolling: periodic #2011
Conversation
We would probably have to test how edit: or not, as |
[4, 1, 2], | ||
[1, 2, 3], | ||
[2, 3, 4]], dtype=float) | ||
assert_array_equal(actual, expected) |
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.
W292 no newline at end of file
Thanks for sending a PR.
Maybe better API would be
I don't think so. I think we can keep rolling as similar to that of pandas,
I think at least we need to add this to the docstring of |
Some comments.
We use this here xarray/xarray/core/dask_array_ops.py Lines 78 to 79 in 7c2c43c
I suspect this would be already working, but it would be nice if we can add some test cases.
|
Thanks for the discussion. I could not get it to work with dask - the problem is the 'padding before ghosting'. xarray/xarray/core/dask_array_ops.py Lines 60 to 62 in 7c2c43c
I see no way how to get the |
Ah, you are right. |
I may pick up this PR but will need some hand holding as i'm not familiar with dask. I want to make sure I can do periodic rolling with dask in a simple script first but it needs work: https://gist.github.com/raybellwaves/621faaf195c0f4ed010b7b0dfee8605a |
Rather than letting this PR lie dormant, maybe we should just move forward without dask support and raise an appropriate error if the user tries it with dask arrays. |
It might make sense to start with the higher level |
|
whats-new.rst
for all changes andapi.rst
for new APIOk, this was easier to do than initially thought, we can use
np.pad(a, pads, mode='wrap')
innputils.rolling_window
. However, I'm not sure if that is enough already*.I added an initial test, but could use some pointers where else you want this to be tested.
Questions:
fill_value='periodic'
a good api?fill_value
keyvalue be ported torolling
?rolling
(I only learned aboutrolling.construct
yesterday)*
rolling
is present incore/dataset.py
,core/dataarray.py
,core/variable.py
,core/rolling.py
,core/dask_array_ops.py
,core/nputils.py
,core/ops.py
,core/common.py
,core/missing.py
, andcore/duck_array_ops.py
that can be a bit daunting...