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/pull/1837#issuecomment-369464776,https://api.github.com/repos/pydata/xarray/issues/1837,369464776,MDEyOklzc3VlQ29tbWVudDM2OTQ2NDc3Ng==,2443309,2018-03-01T03:41:48Z,2018-03-01T03:41:48Z,MEMBER,nice work @fujiisoup! ,"{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,289556132 https://github.com/pydata/xarray/pull/1837#issuecomment-369438064,https://api.github.com/repos/pydata/xarray/issues/1837,369438064,MDEyOklzc3VlQ29tbWVudDM2OTQzODA2NA==,6815844,2018-03-01T00:59:37Z,2018-03-01T00:59:37Z,MEMBER,"@shyer, do you have further suggestions? I think this is almost ready.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,289556132 https://github.com/pydata/xarray/pull/1837#issuecomment-366572887,https://api.github.com/repos/pydata/xarray/issues/1837,366572887,MDEyOklzc3VlQ29tbWVudDM2NjU3Mjg4Nw==,6815844,2018-02-19T02:14:35Z,2018-02-19T02:14:35Z,MEMBER,"@shoyer , thanks for the detailed review. I noticed the benchmark test is still failing. After fixing this, I will merge this. Thanks :)","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,289556132 https://github.com/pydata/xarray/pull/1837#issuecomment-366488673,https://api.github.com/repos/pydata/xarray/issues/1837,366488673,MDEyOklzc3VlQ29tbWVudDM2NjQ4ODY3Mw==,6815844,2018-02-18T02:56:49Z,2018-02-18T02:56:49Z,MEMBER,"@shoyer , thanks for the review. > These names are very descriptive, but unfortunately they are different for DataArray and Dataset, which means that users will need to write different code for different xarray types. Agreed. Changed `to_dataarray / to_dataset` -> `construct`.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,289556132 https://github.com/pydata/xarray/pull/1837#issuecomment-366479069,https://api.github.com/repos/pydata/xarray/issues/1837,366479069,MDEyOklzc3VlQ29tbWVudDM2NjQ3OTA2OQ==,1217238,2018-02-17T23:24:30Z,2018-02-17T23:24:30Z,MEMBER,"My final concern is about the name for these methods. Currently, you have two separate method names, `to_dataset` and `to_dataarray()`. These names are very descriptive, but unfortunately they are different for DataArray and Dataset, which means that users will need to write different code for different xarray types. I would slightly rather that we had a single method name that could be used for both, perhaps `construct()` or `build()`. Then you could write code like `xarray_obj.rolling(time=100).construct(rolling_dim='window')` without needing to know whether `xarray_obj` is a Dataset or DataArray.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,289556132 https://github.com/pydata/xarray/pull/1837#issuecomment-364825407,https://api.github.com/repos/pydata/xarray/issues/1837,364825407,MDEyOklzc3VlQ29tbWVudDM2NDgyNTQwNw==,6815844,2018-02-12T04:18:32Z,2018-02-12T04:18:32Z,MEMBER,"> What's the current status here vs #1883? Do you still want to merge that one first? Yes. It looks I reverted to a wrong commit. I will overwrite most modifications in `duck_array_ops` and `test_duck_array_ops` after #1883 is merged..","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,289556132 https://github.com/pydata/xarray/pull/1837#issuecomment-363621372,https://api.github.com/repos/pydata/xarray/issues/1837,363621372,MDEyOklzc3VlQ29tbWVudDM2MzYyMTM3Mg==,6815844,2018-02-07T01:11:12Z,2018-02-07T01:11:12Z,MEMBER,"I sent a separate PR (#1883) for nan-reduce methods. I will continue / finish up this PR after #1883 is merged.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,289556132 https://github.com/pydata/xarray/pull/1837#issuecomment-361664085,https://api.github.com/repos/pydata/xarray/issues/1837,361664085,MDEyOklzc3VlQ29tbWVudDM2MTY2NDA4NQ==,1217238,2018-01-30T17:10:44Z,2018-01-30T17:10:44Z,MEMBER,"I'll take a look, but I'm open to only fixing this nansum for numpy 1.13+ (or even requiring numpy 1.13 for rolling window arrays), as long as we don't break existing behavior on earlier versions of numpy. On Tue, Jan 30, 2018 at 3:16 AM Keisuke Fujii wrote: > Hmm... > The support of nansum for object-dtype is much more difficult than I > expected. > > Now, I am stacked in supporting numpy<1.13. > With numpy<1.13, nansum for the object type gives just a nan. > > nansum scripts defined in numpy==1.13 does not help because != operator > used here > > behaves differently in numpy<1.13. > > I think our best choice is to revert this PR to 4189d71 > > and left this issue to #1866 > . > > — > You are receiving this because you commented. > > Reply to this email directly, view it on GitHub > , or mute > the thread > > . > ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,289556132 https://github.com/pydata/xarray/pull/1837#issuecomment-361562466,https://api.github.com/repos/pydata/xarray/issues/1837,361562466,MDEyOklzc3VlQ29tbWVudDM2MTU2MjQ2Ng==,6815844,2018-01-30T11:16:34Z,2018-01-30T11:16:34Z,MEMBER,"Hmm... The support of `nansum` for object-dtype is much more difficult than I expected. Now, I am stacked in supporting numpy<1.13. With numpy<1.13, `nansum` for the object type gives just a `nan`. `nansum` scripts defined in numpy==1.13 does not help because `!=` operator used [here](https://github.com/numpy/numpy/blob/6914bb41f0fb3c1ba500bae4e7d671da9536786f/numpy/lib/nanfunctions.py#L68) behaves differently in numpy<1.13. I think our best choice is to revert this PR to 4189d71 and left this issue to #1866.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,289556132 https://github.com/pydata/xarray/pull/1837#issuecomment-359960625,https://api.github.com/repos/pydata/xarray/issues/1837,359960625,MDEyOklzc3VlQ29tbWVudDM1OTk2MDYyNQ==,6815844,2018-01-23T22:58:46Z,2018-01-23T22:58:46Z,MEMBER,"Although nan-reduce methods (such as `nanmean`) might be sped up by replacing nan by a certain number before constructing a rolling window, this improvement brings another complexity into the code (and bottleneck already does this). I want to finish this PR first and left such improvements to another chance. Please let me know if anyone has comments of this PR.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,289556132 https://github.com/pydata/xarray/pull/1837#issuecomment-359252185,https://api.github.com/repos/pydata/xarray/issues/1837,359252185,MDEyOklzc3VlQ29tbWVudDM1OTI1MjE4NQ==,6815844,2018-01-21T14:25:25Z,2018-01-21T14:25:25Z,MEMBER,"I think this is ready for the final review, including docs. I would like to add rolling methods to airspeed benchmark, but in another PR.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,289556132 https://github.com/pydata/xarray/pull/1837#issuecomment-359228984,https://api.github.com/repos/pydata/xarray/issues/1837,359228984,MDEyOklzc3VlQ29tbWVudDM1OTIyODk4NA==,1217238,2018-01-21T07:15:29Z,2018-01-21T07:15:29Z,MEMBER,"Would it make sense to add a `stride` argument to `to_dataarray`? You can always index afterwards, but that could be a nice shortcut. It will be much faster for dask, certainly. (We can also add this later if desired)","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,289556132 https://github.com/pydata/xarray/pull/1837#issuecomment-358982464,https://api.github.com/repos/pydata/xarray/issues/1837,358982464,MDEyOklzc3VlQ29tbWVudDM1ODk4MjQ2NA==,6815844,2018-01-19T14:35:31Z,2018-01-19T14:35:31Z,MEMBER,"During the work, I notice a somehow unexpected behavior of rolling. I expected that with `min_periods=1` option, we will get an array without `nan`, It is true with `center=False` and also `pd.rolling`. ```python In [2]: da = xr.DataArray(np.arange(10), dims='x') In [3]: da.rolling(x=3, min_periods=1, center=False).sum() Out[3]: array([ 0., 1., 3., 6., 9., 12., 15., 18., 21., 24.]) Dimensions without coordinates: x In [5]: s = pd.Series(np.arange(10)) s.rolling(3, min_periods=1, center=True).sum() Out[7]: 0 1.0 1 3.0 2 6.0 3 9.0 4 12.0 5 15.0 6 18.0 7 21.0 8 24.0 9 17.0 dtype: float64 ``` But with `center=True`, we have a `nan` at the end. ``` In [4]: da.rolling(x=3, min_periods=1, center=True).sum() Out[4]: array([ 1., 3., 6., 9., 12., 15., 18., 21., 24., nan]) Dimensions without coordinates: x ``` It is because we make `shift` operation after the rolling. https://github.com/pydata/xarray/blob/74d8318c68be884134d449afad18dfe731d48b72/xarray/core/rolling.py#L263-L269 If we `pad` the array before the rolling operation instead of `shift`, we will not get the last `nan` and the result would be the same to pandas. (`rolling.to_dataarray('window_dim')` does this). I think this path is more intuitive. Any thoughts?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,289556132