{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/xarray/issues/2633","repository_url":"https://api.github.com/repos/pydata/xarray","labels_url":"https://api.github.com/repos/pydata/xarray/issues/2633/labels{/name}","comments_url":"https://api.github.com/repos/pydata/xarray/issues/2633/comments","events_url":"https://api.github.com/repos/pydata/xarray/issues/2633/events","html_url":"https://github.com/pydata/xarray/pull/2633","id":394017899,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQwODcyMDM1","number":2633,"title":"Fix dayofweek and dayofyear attributes from dates generated by cftime_range","user":{"login":"spencerkclark","id":6628425,"node_id":"MDQ6VXNlcjY2Mjg0MjU=","avatar_url":"https://avatars0.githubusercontent.com/u/6628425?v=4","gravatar_id":"","url":"https://api.github.com/users/spencerkclark","html_url":"https://github.com/spencerkclark","followers_url":"https://api.github.com/users/spencerkclark/followers","following_url":"https://api.github.com/users/spencerkclark/following{/other_user}","gists_url":"https://api.github.com/users/spencerkclark/gists{/gist_id}","starred_url":"https://api.github.com/users/spencerkclark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spencerkclark/subscriptions","organizations_url":"https://api.github.com/users/spencerkclark/orgs","repos_url":"https://api.github.com/users/spencerkclark/repos","events_url":"https://api.github.com/users/spencerkclark/events{/privacy}","received_events_url":"https://api.github.com/users/spencerkclark/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-25T12:57:13Z","updated_at":"2018-12-25T15:43:44Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/pydata/xarray/pulls/2633","html_url":"https://github.com/pydata/xarray/pull/2633","diff_url":"https://github.com/pydata/xarray/pull/2633.diff","patch_url":"https://github.com/pydata/xarray/pull/2633.patch"},"body":" - [x] Tests added\r\n\r\nIt turns out there was a remaining bug in cftime (https://github.com/Unidata/cftime/issues/106) that impacted the results of the `dayofwk` and `dayofyr` attributes of cftime objects generated by their `replace` method, which we use when parsing dates from strings, and in some offset arithmetic.\r\n\r\nA workaround is to add a `dayofwk=-1` argument to each `replace` call where the `dayofwk` or `dayofyr` would be expected to change.  I've fixed this bug upstream in cftime (https://github.com/Unidata/cftime/pull/108), but it will only be available in a future version.  Would it be appropriate to use this workaround in xarray?  \r\n\r\nThis would fix [this doc page](http://xarray.pydata.org/en/latest/time-series.html#non-standard-calendars-and-dates-outside-the-timestamp-valid-range) for instance:\r\n\r\n<img width=\"709\" alt=\"screen shot 2018-12-25 at 7 40 30 am\" src=\"https://user-images.githubusercontent.com/6628425/50422387-7fed3480-0818-11e9-8244-9533b6030691.png\">\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/pydata/xarray/issues/comments/449859242","html_url":"https://github.com/pydata/xarray/pull/2633#issuecomment-449859242","issue_url":"https://api.github.com/repos/pydata/xarray/issues/2633","id":449859242,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0OTg1OTI0Mg==","user":{"login":"pep8speaks","id":24736507,"node_id":"MDQ6VXNlcjI0NzM2NTA3","avatar_url":"https://avatars1.githubusercontent.com/u/24736507?v=4","gravatar_id":"","url":"https://api.github.com/users/pep8speaks","html_url":"https://github.com/pep8speaks","followers_url":"https://api.github.com/users/pep8speaks/followers","following_url":"https://api.github.com/users/pep8speaks/following{/other_user}","gists_url":"https://api.github.com/users/pep8speaks/gists{/gist_id}","starred_url":"https://api.github.com/users/pep8speaks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pep8speaks/subscriptions","organizations_url":"https://api.github.com/users/pep8speaks/orgs","repos_url":"https://api.github.com/users/pep8speaks/repos","events_url":"https://api.github.com/users/pep8speaks/events{/privacy}","received_events_url":"https://api.github.com/users/pep8speaks/received_events","type":"User","site_admin":false},"created_at":"2018-12-25T15:43:44Z","updated_at":"2018-12-25T15:43:44Z","author_association":"NONE","body":"Hello @spencerkclark! Thanks for updating the PR.\n\n\n\n - In the file [`xarray/coding/cftimeindex.py`](https://github.com/pydata/xarray/blob/69e77cb9fb286ee5689326c358b1599df7f629cc/xarray/coding/cftimeindex.py), following are the PEP8 issues :\n\n> [Line 164:1](https://github.com/pydata/xarray/blob/69e77cb9fb286ee5689326c358b1599df7f629cc/xarray/coding/cftimeindex.py#L164): [W293](https://duckduckgo.com/?q=pep8%20W293) blank line contains whitespace\n\n\n\n\n\n"}}
{"actor":{"display_login":"pep8speaks"}}