pull_requests: 202609913
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
202609913 | MDExOlB1bGxSZXF1ZXN0MjAyNjA5OTEz | 2301 | closed | 0 | WIP Add a CFTimeIndex-enabled xr.cftime_range function | 6628425 | - [x] Closes #2142 - [x] Tests added (for all bug fixes or enhancements) - [x] Tests passed (for all non-documentation changes) - [x] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API (remove if this change should not be visible to users, e.g., if it is an internal clean-up, or if this is part of a larger project that will be documented later) I took the approach first discussed [here](https://github.com/pydata/xarray/pull/1252#issuecomment-380593243) by @shoyer and followed pandas by creating simplified offset classes for use with cftime objects to implement a `CFTimeIndex`-enabled `cftime_range` function. I still may clean things up a bit and add a few more tests, but I wanted to post this in its current state to show some progress, as I think it is more or less working. I will try to ping folks when it is ready for a more detailed review. Here are a few examples: ``` In [1]: import xarray as xr In [2]: xr.cftime_range('2000-02-01', '2002-05-05', freq='3M', calendar='noleap') Out[2]: CFTimeIndex([2000-02-28 00:00:00, 2000-05-31 00:00:00, 2000-08-31 00:00:00, 2000-11-30 00:00:00, 2001-02-28 00:00:00, 2001-05-31 00:00:00, 2001-08-31 00:00:00, 2001-11-30 00:00:00, 2002-02-28 00:00:00], dtype='object') In [3]: xr.cftime_range('2000-02-01', periods=4, freq='3A-JUN', calendar='noleap') Out[3]: CFTimeIndex([2000-06-30 00:00:00, 2003-06-30 00:00:00, 2006-06-30 00:00:00, 2009-06-30 00:00:00], dtype='object') In [4]: xr.cftime_range(end='2000-02-01', periods=4, freq='3A-JUN') Out[4]: CFTimeIndex([1990-06-30 00:00:00, 1993-06-30 00:00:00, 1996-06-30 00:00:00, 1999-06-30 00:00:00], dtype='object') ``` Hopefully the offset classes defined here would also be useful for implementing things like `resample` for `CFTimeIndex` objects (#2191) and `CFTimeIndex.shift` (#2244). | 2018-07-19T16:04:10Z | 2018-09-19T20:24:51Z | 2018-09-19T20:24:40Z | 2018-09-19T20:24:40Z | 5b87b6e2f159b827f739e12d4faae57a0b6f6178 | 0 | 19c1dfe6c243d6d52ff381fe3b1111729dd1cc2d | e5ae4088f3512eb805b13ea138087350b8180d69 | MEMBER | 13221727 | https://github.com/pydata/xarray/pull/2301 |
Links from other tables
- 0 rows from pull_requests_id in labels_pull_requests