pull_requests: 163657424
This data as json
id | node_id | number | state | locked | title | user | body | created_at | updated_at | closed_at | merged_at | merge_commit_sha | assignee | milestone | draft | head | base | author_association | auto_merge | repo | url | merged_by |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
163657424 | MDExOlB1bGxSZXF1ZXN0MTYzNjU3NDI0 | 1837 | closed | 0 | Rolling window with `as_strided` | 6815844 | - [x] Closes #1831, #1142, #819 - [x] Tests added - [x] Tests passed - [x] Passes ``git diff upstream/master **/*py | flake8 --diff`` - [x] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API I started to work for refactoring rollings. As suggested in [#1831 comment](https://github.com/pydata/xarray/issues/1831#issuecomment-357828636), I implemented `rolling_window` methods based on `as_strided`. I got more than 1,000 times speed up! yey! ```python In [1]: import numpy as np ...: import xarray as xr ...: ...: da = xr.DataArray(np.random.randn(10000, 3), dims=['x', 'y']) ``` with the master ```python %timeit da.rolling(x=5).reduce(np.mean) 1 loop, best of 3: 9.68 s per loop ``` with the current implementation ```python %timeit da.rolling(x=5).reduce(np.mean) 100 loops, best of 3: 5.29 ms per loop ``` and with the bottleneck ```python %timeit da.rolling(x=5).mean() 100 loops, best of 3: 2.62 ms per loop ``` My current concerns are + Can we expose the new `rolling_window` method of `DataArray` and `Dataset` to the public? I think this method itself is useful for many usecases, such as short-term-FFT and convolution. This also gives more flexible rolling operation, such as windowed moving average, strided rolling, and ND-rolling. + Is there any dask's equivalence to numpy's `as_strided`? Currently, I just use a slice->concatenate path, but I don't think it is very efficient. (Is it already efficient, as dask utilizes out-of-core computation?) Any thoughts are welcome. | 2018-01-18T09:18:19Z | 2018-06-22T22:27:11Z | 2018-03-01T03:39:19Z | 2018-03-01T03:39:19Z | dc3eebf3a514cfdc1039b63f2a542121d1328ba9 | 0 | aeabdf5fc7ead2f2ae24b59045cc987f6feb5033 | f3bbb3ef6badcfe5d1f3b77c231846f0e79a93ea | MEMBER | 13221727 | https://github.com/pydata/xarray/pull/1837 |
Links from other tables
- 0 rows from pull_requests_id in labels_pull_requests