{"action":"created","comment":{"url":"https://api.github.com/repos/pydata/xarray/pulls/comments/242021408","pull_request_review_id":185433967,"id":242021408,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MjAyMTQwOA==","diff_hunk":"@@ -0,0 +1,134 @@\n+from __future__ import absolute_import\n+\n+import itertools\n+import pytest\n+import datetime as dt\n+\n+import numpy as np\n+import pandas as pd\n+import xarray as xr\n+from xarray.tests import assert_array_equal, assert_identical\n+\n+\n+@pytest.fixture()\n+def pd_index():\n+    return pd.date_range('2000-01-01', periods=30, freq='MS', tz='UTC')\n+\n+\n+@pytest.fixture()\n+def xr_index():\n+    return xr.cftime_range('2000-01-01', periods=30, freq='MS', tz='UTC')\n+\n+\n+@pytest.fixture()\n+def daily_pd_index():\n+    return pd.date_range('2000-01-01', periods=900, freq='D', tz='UTC')\n+\n+\n+@pytest.fixture()\n+def daily_xr_index():\n+    return xr.cftime_range('2000-01-01', periods=900, freq='D', tz='UTC')\n+\n+\n+@pytest.fixture()\n+def base_pd_index():\n+    return pd.date_range('2000-01-01', periods=30, freq='D', tz='UTC')\n+\n+\n+@pytest.fixture()\n+def base_xr_index():\n+    return xr.cftime_range('2000-01-01', periods=30, freq='D', tz='UTC')\n+\n+\n+def da(index):\n+    return xr.DataArray(np.arange(100., 100.+index.size),\n+                        coords=[index], dims=['time'])\n+\n+\n+def series(index):\n+    return pd.Series(np.arange(100., 100.+index.size), index=index)\n+\n+\n+@ pytest.mark.parametrize(('closed', 'label', 'freq'),\n+                          list(itertools.product(\n+                              ['left', 'right'],\n+                              ['left', 'right'],\n+                              ['2MS', '2M', '3MS', '3M', '7MS', '7M'])))","path":"xarray/tests/test_cftimeindex_resample.py","position":null,"original_position":56,"commit_id":"5a41ee2e11d82fc31ec362be2f214b3b0154bc0f","original_commit_id":"e64fedb6452c9b1c24001304235e555d22daa911","user":{"login":"jwenfai","id":8708062,"node_id":"MDQ6VXNlcjg3MDgwNjI=","avatar_url":"https://avatars3.githubusercontent.com/u/8708062?v=4","gravatar_id":"","url":"https://api.github.com/users/jwenfai","html_url":"https://github.com/jwenfai","followers_url":"https://api.github.com/users/jwenfai/followers","following_url":"https://api.github.com/users/jwenfai/following{/other_user}","gists_url":"https://api.github.com/users/jwenfai/gists{/gist_id}","starred_url":"https://api.github.com/users/jwenfai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwenfai/subscriptions","organizations_url":"https://api.github.com/users/jwenfai/orgs","repos_url":"https://api.github.com/users/jwenfai/repos","events_url":"https://api.github.com/users/jwenfai/events{/privacy}","received_events_url":"https://api.github.com/users/jwenfai/received_events","type":"User","site_admin":false},"body":"Thanks for the comment, I made the change, much better than the torturous code I was writing before!","created_at":"2018-12-17T04:06:11Z","updated_at":"2018-12-17T04:06:11Z","html_url":"https://github.com/pydata/xarray/pull/2593#discussion_r242021408","pull_request_url":"https://api.github.com/repos/pydata/xarray/pulls/2593","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/pydata/xarray/pulls/comments/242021408"},"html":{"href":"https://github.com/pydata/xarray/pull/2593#discussion_r242021408"},"pull_request":{"href":"https://api.github.com/repos/pydata/xarray/pulls/2593"}},"in_reply_to_id":239235087},"pull_request":{"url":"https://api.github.com/repos/pydata/xarray/pulls/2593","id":236306204,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM2MzA2MjA0","html_url":"https://github.com/pydata/xarray/pull/2593","diff_url":"https://github.com/pydata/xarray/pull/2593.diff","patch_url":"https://github.com/pydata/xarray/pull/2593.patch","issue_url":"https://api.github.com/repos/pydata/xarray/issues/2593","number":2593,"state":"open","locked":false,"title":"CFTimeIndex Resampling","user":{"login":"jwenfai","id":8708062,"node_id":"MDQ6VXNlcjg3MDgwNjI=","avatar_url":"https://avatars3.githubusercontent.com/u/8708062?v=4","gravatar_id":"","url":"https://api.github.com/users/jwenfai","html_url":"https://github.com/jwenfai","followers_url":"https://api.github.com/users/jwenfai/followers","following_url":"https://api.github.com/users/jwenfai/following{/other_user}","gists_url":"https://api.github.com/users/jwenfai/gists{/gist_id}","starred_url":"https://api.github.com/users/jwenfai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwenfai/subscriptions","organizations_url":"https://api.github.com/users/jwenfai/orgs","repos_url":"https://api.github.com/users/jwenfai/repos","events_url":"https://api.github.com/users/jwenfai/events{/privacy}","received_events_url":"https://api.github.com/users/jwenfai/received_events","type":"User","site_admin":false},"body":"I would appreciate some feedback on why this implementation for CFTimeIndex resampling doesn't match pandas' output 100%.\r\n\r\n- [x] Tentative attempt at addressing #2191 (resampling CFTimeIndex). Downsampling produces results that match pandas' results in all the tests done thus far. However, upsampling has trouble assigning the right values to the right bins.\r\n- [x] Tests (`test_cftimeindex_resample.py`) created for standard calendars but not for non-standard calendars (360 days etc.). Contents from `test_cftimeindex_resample.py` will be inserted into `test_dataarray.py` and  `test_cftimeindex_resample.py` will be deleted once resampling implementation is finalized. Files found in the `tests/temp` folder is meant to highlight resampling discrepancies between pandas and this implementaion. Both the files and the folder will be removed once resampling implementation is finalized.\r\n - [x] Not fully documented. Docstrings have yet to be added to `resample_cftime.py`. There were no doctrings from https://github.com/pandas-dev/pandas/blob/master/pandas/core/resample.py (which is where the codes were ported from) that could be conveniently copied.\r\n","created_at":"2018-12-05T20:08:06Z","updated_at":"2018-12-17T04:06:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pydata/xarray/pulls/2593/commits","review_comments_url":"https://api.github.com/repos/pydata/xarray/pulls/2593/comments","review_comment_url":"https://api.github.com/repos/pydata/xarray/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pydata/xarray/issues/2593/comments","statuses_url":"https://api.github.com/repos/pydata/xarray/statuses/5a41ee2e11d82fc31ec362be2f214b3b0154bc0f","head":{"label":"Ouranosinc:master","ref":"master","sha":"5a41ee2e11d82fc31ec362be2f214b3b0154bc0f","user":{"login":"Ouranosinc","id":1696763,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2OTY3NjM=","avatar_url":"https://avatars3.githubusercontent.com/u/1696763?v=4","gravatar_id":"","url":"https://api.github.com/users/Ouranosinc","html_url":"https://github.com/Ouranosinc","followers_url":"https://api.github.com/users/Ouranosinc/followers","following_url":"https://api.github.com/users/Ouranosinc/following{/other_user}","gists_url":"https://api.github.com/users/Ouranosinc/gists{/gist_id}","starred_url":"https://api.github.com/users/Ouranosinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ouranosinc/subscriptions","organizations_url":"https://api.github.com/users/Ouranosinc/orgs","repos_url":"https://api.github.com/users/Ouranosinc/repos","events_url":"https://api.github.com/users/Ouranosinc/events{/privacy}","received_events_url":"https://api.github.com/users/Ouranosinc/received_events","type":"Organization","site_admin":false},"repo":{"id":155752842,"node_id":"MDEwOlJlcG9zaXRvcnkxNTU3NTI4NDI=","name":"xarray","full_name":"Ouranosinc/xarray","private":false,"owner":{"login":"Ouranosinc","id":1696763,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2OTY3NjM=","avatar_url":"https://avatars3.githubusercontent.com/u/1696763?v=4","gravatar_id":"","url":"https://api.github.com/users/Ouranosinc","html_url":"https://github.com/Ouranosinc","followers_url":"https://api.github.com/users/Ouranosinc/followers","following_url":"https://api.github.com/users/Ouranosinc/following{/other_user}","gists_url":"https://api.github.com/users/Ouranosinc/gists{/gist_id}","starred_url":"https://api.github.com/users/Ouranosinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ouranosinc/subscriptions","organizations_url":"https://api.github.com/users/Ouranosinc/orgs","repos_url":"https://api.github.com/users/Ouranosinc/repos","events_url":"https://api.github.com/users/Ouranosinc/events{/privacy}","received_events_url":"https://api.github.com/users/Ouranosinc/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Ouranosinc/xarray","description":"N-D labeled arrays and datasets in Python","fork":true,"url":"https://api.github.com/repos/Ouranosinc/xarray","forks_url":"https://api.github.com/repos/Ouranosinc/xarray/forks","keys_url":"https://api.github.com/repos/Ouranosinc/xarray/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ouranosinc/xarray/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ouranosinc/xarray/teams","hooks_url":"https://api.github.com/repos/Ouranosinc/xarray/hooks","issue_events_url":"https://api.github.com/repos/Ouranosinc/xarray/issues/events{/number}","events_url":"https://api.github.com/repos/Ouranosinc/xarray/events","assignees_url":"https://api.github.com/repos/Ouranosinc/xarray/assignees{/user}","branches_url":"https://api.github.com/repos/Ouranosinc/xarray/branches{/branch}","tags_url":"https://api.github.com/repos/Ouranosinc/xarray/tags","blobs_url":"https://api.github.com/repos/Ouranosinc/xarray/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ouranosinc/xarray/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ouranosinc/xarray/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ouranosinc/xarray/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ouranosinc/xarray/statuses/{sha}","languages_url":"https://api.github.com/repos/Ouranosinc/xarray/languages","stargazers_url":"https://api.github.com/repos/Ouranosinc/xarray/stargazers","contributors_url":"https://api.github.com/repos/Ouranosinc/xarray/contributors","subscribers_url":"https://api.github.com/repos/Ouranosinc/xarray/subscribers","subscription_url":"https://api.github.com/repos/Ouranosinc/xarray/subscription","commits_url":"https://api.github.com/repos/Ouranosinc/xarray/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ouranosinc/xarray/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ouranosinc/xarray/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ouranosinc/xarray/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ouranosinc/xarray/contents/{+path}","compare_url":"https://api.github.com/repos/Ouranosinc/xarray/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ouranosinc/xarray/merges","archive_url":"https://api.github.com/repos/Ouranosinc/xarray/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ouranosinc/xarray/downloads","issues_url":"https://api.github.com/repos/Ouranosinc/xarray/issues{/number}","pulls_url":"https://api.github.com/repos/Ouranosinc/xarray/pulls{/number}","milestones_url":"https://api.github.com/repos/Ouranosinc/xarray/milestones{/number}","notifications_url":"https://api.github.com/repos/Ouranosinc/xarray/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ouranosinc/xarray/labels{/name}","releases_url":"https://api.github.com/repos/Ouranosinc/xarray/releases{/id}","deployments_url":"https://api.github.com/repos/Ouranosinc/xarray/deployments","created_at":"2018-11-01T17:40:11Z","updated_at":"2018-12-12T19:41:56Z","pushed_at":"2018-12-15T23:53:29Z","git_url":"git://github.com/Ouranosinc/xarray.git","ssh_url":"git@github.com:Ouranosinc/xarray.git","clone_url":"https://github.com/Ouranosinc/xarray.git","svn_url":"https://github.com/Ouranosinc/xarray","homepage":"http://xarray.pydata.org","size":14338,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"pydata:master","ref":"master","sha":"3ae93ac31ce122fc10b089f3b92b8c20e8b218c9","user":{"login":"pydata","id":1284191,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyODQxOTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1284191?v=4","gravatar_id":"","url":"https://api.github.com/users/pydata","html_url":"https://github.com/pydata","followers_url":"https://api.github.com/users/pydata/followers","following_url":"https://api.github.com/users/pydata/following{/other_user}","gists_url":"https://api.github.com/users/pydata/gists{/gist_id}","starred_url":"https://api.github.com/users/pydata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pydata/subscriptions","organizations_url":"https://api.github.com/users/pydata/orgs","repos_url":"https://api.github.com/users/pydata/repos","events_url":"https://api.github.com/users/pydata/events{/privacy}","received_events_url":"https://api.github.com/users/pydata/received_events","type":"Organization","site_admin":false},"repo":{"id":13221727,"node_id":"MDEwOlJlcG9zaXRvcnkxMzIyMTcyNw==","name":"xarray","full_name":"pydata/xarray","private":false,"owner":{"login":"pydata","id":1284191,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyODQxOTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1284191?v=4","gravatar_id":"","url":"https://api.github.com/users/pydata","html_url":"https://github.com/pydata","followers_url":"https://api.github.com/users/pydata/followers","following_url":"https://api.github.com/users/pydata/following{/other_user}","gists_url":"https://api.github.com/users/pydata/gists{/gist_id}","starred_url":"https://api.github.com/users/pydata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pydata/subscriptions","organizations_url":"https://api.github.com/users/pydata/orgs","repos_url":"https://api.github.com/users/pydata/repos","events_url":"https://api.github.com/users/pydata/events{/privacy}","received_events_url":"https://api.github.com/users/pydata/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/pydata/xarray","description":"N-D labeled arrays and datasets in Python","fork":false,"url":"https://api.github.com/repos/pydata/xarray","forks_url":"https://api.github.com/repos/pydata/xarray/forks","keys_url":"https://api.github.com/repos/pydata/xarray/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pydata/xarray/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pydata/xarray/teams","hooks_url":"https://api.github.com/repos/pydata/xarray/hooks","issue_events_url":"https://api.github.com/repos/pydata/xarray/issues/events{/number}","events_url":"https://api.github.com/repos/pydata/xarray/events","assignees_url":"https://api.github.com/repos/pydata/xarray/assignees{/user}","branches_url":"https://api.github.com/repos/pydata/xarray/branches{/branch}","tags_url":"https://api.github.com/repos/pydata/xarray/tags","blobs_url":"https://api.github.com/repos/pydata/xarray/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pydata/xarray/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pydata/xarray/git/refs{/sha}","trees_url":"https://api.github.com/repos/pydata/xarray/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pydata/xarray/statuses/{sha}","languages_url":"https://api.github.com/repos/pydata/xarray/languages","stargazers_url":"https://api.github.com/repos/pydata/xarray/stargazers","contributors_url":"https://api.github.com/repos/pydata/xarray/contributors","subscribers_url":"https://api.github.com/repos/pydata/xarray/subscribers","subscription_url":"https://api.github.com/repos/pydata/xarray/subscription","commits_url":"https://api.github.com/repos/pydata/xarray/commits{/sha}","git_commits_url":"https://api.github.com/repos/pydata/xarray/git/commits{/sha}","comments_url":"https://api.github.com/repos/pydata/xarray/comments{/number}","issue_comment_url":"https://api.github.com/repos/pydata/xarray/issues/comments{/number}","contents_url":"https://api.github.com/repos/pydata/xarray/contents/{+path}","compare_url":"https://api.github.com/repos/pydata/xarray/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pydata/xarray/merges","archive_url":"https://api.github.com/repos/pydata/xarray/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pydata/xarray/downloads","issues_url":"https://api.github.com/repos/pydata/xarray/issues{/number}","pulls_url":"https://api.github.com/repos/pydata/xarray/pulls{/number}","milestones_url":"https://api.github.com/repos/pydata/xarray/milestones{/number}","notifications_url":"https://api.github.com/repos/pydata/xarray/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pydata/xarray/labels{/name}","releases_url":"https://api.github.com/repos/pydata/xarray/releases{/id}","deployments_url":"https://api.github.com/repos/pydata/xarray/deployments","created_at":"2013-09-30T17:21:10Z","updated_at":"2018-12-16T21:55:42Z","pushed_at":"2018-12-16T23:57:27Z","git_url":"git://github.com/pydata/xarray.git","ssh_url":"git@github.com:pydata/xarray.git","clone_url":"https://github.com/pydata/xarray.git","svn_url":"https://github.com/pydata/xarray","homepage":"http://xarray.pydata.org","size":15643,"stargazers_count":1029,"watchers_count":1029,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":327,"mirror_url":null,"archived":false,"open_issues_count":571,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":327,"open_issues":571,"watchers":1029,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pydata/xarray/pulls/2593"},"html":{"href":"https://github.com/pydata/xarray/pull/2593"},"issue":{"href":"https://api.github.com/repos/pydata/xarray/issues/2593"},"comments":{"href":"https://api.github.com/repos/pydata/xarray/issues/2593/comments"},"review_comments":{"href":"https://api.github.com/repos/pydata/xarray/pulls/2593/comments"},"review_comment":{"href":"https://api.github.com/repos/pydata/xarray/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pydata/xarray/pulls/2593/commits"},"statuses":{"href":"https://api.github.com/repos/pydata/xarray/statuses/5a41ee2e11d82fc31ec362be2f214b3b0154bc0f"}},"author_association":"NONE"}}
{"actor":{"display_login":"jwenfai"}}