html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/issues/2514#issuecomment-433454137,https://api.github.com/repos/pydata/xarray/issues/2514,433454137,MDEyOklzc3VlQ29tbWVudDQzMzQ1NDEzNw==,102827,2018-10-26T15:49:20Z,2018-10-31T21:14:48Z,CONTRIBUTOR,"EDIT: The issue of this post is now separated #2531 I think I have a fix, but wanted to write some failing tests before committing the changes. Doing this I discovered that also `DataArray.rolling()` does not preserve the chunksizes, apparently depending on the applied method. ```python import pandas as pd import numpy as np import xarray as xr t = pd.date_range(start='2018-01-01', end='2018-02-01', freq='H') bar = np.sin(np.arange(len(t))) baz = np.cos(np.arange(len(t))) da_test = xr.DataArray(data=np.stack([bar, baz]), coords={'time': t, 'sensor': ['one', 'two']}, dims=('sensor', 'time')) print(da_test.chunk({'time': 100}).rolling(time=60).mean().chunks) print(da_test.chunk({'time': 100}).rolling(time=60).count().chunks) ``` ``` Output for `mean`: ((2,), (745,)) Output for `count`: ((2,), (100, 100, 100, 100, 100, 100, 100, 45)) Desired Output: ((2,), (100, 100, 100, 100, 100, 100, 100, 45)) ``` My fix solves my initial problem, but maybe if done correctly it should also solve this bug, too. Any idea why this depends on whether `.mean()` or `.count()` is used? I have already pushed some [WIP changes](https://github.com/cchwala/xarray/commits/fix_dask_rolling_window_chunksize). Should I already open a PR if though most new test still fail?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,374279704 https://github.com/pydata/xarray/issues/2514#issuecomment-433992180,https://api.github.com/repos/pydata/xarray/issues/2514,433992180,MDEyOklzc3VlQ29tbWVudDQzMzk5MjE4MA==,102827,2018-10-29T17:01:12Z,2018-10-29T17:01:12Z,CONTRIBUTOR,"@dcherian Okay. A WIP PR will follow, but might take some days.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,374279704 https://github.com/pydata/xarray/issues/2514#issuecomment-433369567,https://api.github.com/repos/pydata/xarray/issues/2514,433369567,MDEyOklzc3VlQ29tbWVudDQzMzM2OTU2Nw==,102827,2018-10-26T10:53:32Z,2018-10-26T10:53:32Z,CONTRIBUTOR,Thanks @fujiisoup for the quick response and the pointers. I will have a look and report back if a PR is within my capabilities or not.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,374279704 https://github.com/pydata/xarray/issues/2514#issuecomment-433346685,https://api.github.com/repos/pydata/xarray/issues/2514,433346685,MDEyOklzc3VlQ29tbWVudDQzMzM0NjY4NQ==,102827,2018-10-26T09:27:19Z,2018-10-26T09:27:19Z,CONTRIBUTOR,"The problem seems to occur here https://github.com/pydata/xarray/blob/5940100761478604080523ebb1291ecff90e779e/xarray/core/missing.py#L368-L376 because of the usage of `.construct()`. A quick try without it, shows that the chunksize is preserved then. Hence, [`.construct()`](https://github.com/pydata/xarray/blob/5940100761478604080523ebb1291ecff90e779e/xarray/core/rolling.py#L169) might need a fix for correctly dealing with the chunks of `dask.arrays`.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,374279704