pull_requests: 399063445
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
399063445 | MDExOlB1bGxSZXF1ZXN0Mzk5MDYzNDQ1 | 3935 | closed | 0 | Add a days_in_month accessor to CFTimeIndex | 6628425 | - [x] Tests added - [x] Passes `isort -rc . && black . && mypy . && flake8` - [x] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API This adds a `days_in_month` accessor to CFTimeIndex, which allows for easy computation of monthly time weights for non-standard calendars: ``` In [1]: import xarray as xr In [2]: times = xr.cftime_range("2000", periods=24, freq="MS", calendar="noleap") In [3]: da = xr.DataArray(times, dims=["time"]) In [4]: da.dt.days_in_month Out[4]: <xarray.DataArray 'days_in_month' (time: 24)> array([31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]) Coordinates: * time (time) object 2000-01-01 00:00:00 ... 2001-12-01 00:00:00 ``` This simplifies the ["Calculating Seasonal Averages from Timeseries of Monthly Means" example](http://xarray.pydata.org/en/stable/examples/monthly-means.html) @jhamman wrote for the docs a while back, which I've taken the liberty of updating. The ability to add this feature to xarray is thanks in large part to @huard, who added a `daysinmonth` attribute to `cftime.datetime` objects late last year: https://github.com/Unidata/cftime/pull/138. | 2020-04-05T12:38:50Z | 2020-04-06T14:02:58Z | 2020-04-06T14:02:11Z | 2020-04-06T14:02:11Z | 604835603c83618dbe101331813cc6ae428d8be1 | 0 | 86faba51a3f047fa42c46106ab3bee7c8e7a985a | 8d280cd7b1d80567cfdc6ae55165c522a5d4c2ce | MEMBER | 13221727 | https://github.com/pydata/xarray/pull/3935 |
Links from other tables
- 1 row from pull_requests_id in labels_pull_requests