{"action":"created","comment":{"url":"https://api.github.com/repos/pydata/xarray/pulls/comments/72885412","id":72885412,"diff_hunk":"@@ -152,44 +154,69 @@ def __init__(self, obj, group, squeeze=False, grouper=None, bins=None,\n         cut_kwargs : dict, optional\n             Extra keyword arguments to pass to `pandas.cut`\n         \"\"\"\n-        from .dataset import as_dataset\n+        from .dataset import Dataset\n         from .dataarray import DataArray\n \n-        if getattr(group, 'name', None) is None:\n-            raise ValueError('`group` must have a name')\n+        def check_valid_group(group_obj):\n+            if not isinstance(group_obj, (DataArray, Variable)):\n+                raise TypeError('`group` must be a DataArray, Variable or list '\n+                                'of DataArrays and/or Variables')\n+            if getattr(group_obj, 'name', None) is None:\n+                raise ValueError('each item in `group` must have a name')\n+\n+        def is_monotonic_unique(group_obj):\n+            index = safe_cast_to_index(group)\n+            return index.is_monotonic and index.is_unique\n+\n+        if grouper is not None and bins is not None:\n+            raise TypeError(\"Can't specify both `grouper` and `bins`.\")\n+\n+        if isinstance(group, (list, tuple)):\n+            for g in group:\n+                check_valid_group(g)\n+            group = merge(group)","path":"xarray/core/groupby.py","position":49,"original_position":49,"commit_id":"9c7880da9b86d9063a90637752625f39d289a746","original_commit_id":"9c7880da9b86d9063a90637752625f39d289a746","user":{"login":"rabernat","id":1197350,"avatar_url":"https://avatars.githubusercontent.com/u/1197350?v=3","gravatar_id":"","url":"https://api.github.com/users/rabernat","html_url":"https://github.com/rabernat","followers_url":"https://api.github.com/users/rabernat/followers","following_url":"https://api.github.com/users/rabernat/following{/other_user}","gists_url":"https://api.github.com/users/rabernat/gists{/gist_id}","starred_url":"https://api.github.com/users/rabernat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rabernat/subscriptions","organizations_url":"https://api.github.com/users/rabernat/orgs","repos_url":"https://api.github.com/users/rabernat/repos","events_url":"https://api.github.com/users/rabernat/events{/privacy}","received_events_url":"https://api.github.com/users/rabernat/received_events","type":"User","site_admin":false},"body":"Never mind...I get it now. By this point, all the items in the list should already be DataArrays or Variables. Still not sure I can visualize what merge is doing though.","created_at":"2016-07-30T10:30:24Z","updated_at":"2016-07-30T10:30:24Z","html_url":"https://github.com/pydata/xarray/pull/924#discussion_r72885412","pull_request_url":"https://api.github.com/repos/pydata/xarray/pulls/924","_links":{"self":{"href":"https://api.github.com/repos/pydata/xarray/pulls/comments/72885412"},"html":{"href":"https://github.com/pydata/xarray/pull/924#discussion_r72885412"},"pull_request":{"href":"https://api.github.com/repos/pydata/xarray/pulls/924"}}},"pull_request":{"url":"https://api.github.com/repos/pydata/xarray/pulls/924","id":79321657,"html_url":"https://github.com/pydata/xarray/pull/924","diff_url":"https://github.com/pydata/xarray/pull/924.diff","patch_url":"https://github.com/pydata/xarray/pull/924.patch","issue_url":"https://api.github.com/repos/pydata/xarray/issues/924","number":924,"state":"open","locked":false,"title":"WIP: progress toward making groupby work with multiple arguments","user":{"login":"shoyer","id":1217238,"avatar_url":"https://avatars.githubusercontent.com/u/1217238?v=3","gravatar_id":"","url":"https://api.github.com/users/shoyer","html_url":"https://github.com/shoyer","followers_url":"https://api.github.com/users/shoyer/followers","following_url":"https://api.github.com/users/shoyer/following{/other_user}","gists_url":"https://api.github.com/users/shoyer/gists{/gist_id}","starred_url":"https://api.github.com/users/shoyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoyer/subscriptions","organizations_url":"https://api.github.com/users/shoyer/orgs","repos_url":"https://api.github.com/users/shoyer/repos","events_url":"https://api.github.com/users/shoyer/events{/privacy}","received_events_url":"https://api.github.com/users/shoyer/received_events","type":"User","site_admin":false},"body":"It definitely doesn't work properly yet, totally mixing up coordinates,\r\ndata variables and multi-indexes (as shown by the failing tests).","created_at":"2016-07-29T08:07:57Z","updated_at":"2016-07-30T10:30:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3272b6c454f40b97a2a22accbc23f79cd84836e9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pydata/xarray/pulls/924/commits","review_comments_url":"https://api.github.com/repos/pydata/xarray/pulls/924/comments","review_comment_url":"https://api.github.com/repos/pydata/xarray/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pydata/xarray/issues/924/comments","statuses_url":"https://api.github.com/repos/pydata/xarray/statuses/9c7880da9b86d9063a90637752625f39d289a746","head":{"label":"shoyer:groupby-multiple-args","ref":"groupby-multiple-args","sha":"9c7880da9b86d9063a90637752625f39d289a746","user":{"login":"shoyer","id":1217238,"avatar_url":"https://avatars.githubusercontent.com/u/1217238?v=3","gravatar_id":"","url":"https://api.github.com/users/shoyer","html_url":"https://github.com/shoyer","followers_url":"https://api.github.com/users/shoyer/followers","following_url":"https://api.github.com/users/shoyer/following{/other_user}","gists_url":"https://api.github.com/users/shoyer/gists{/gist_id}","starred_url":"https://api.github.com/users/shoyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoyer/subscriptions","organizations_url":"https://api.github.com/users/shoyer/orgs","repos_url":"https://api.github.com/users/shoyer/repos","events_url":"https://api.github.com/users/shoyer/events{/privacy}","received_events_url":"https://api.github.com/users/shoyer/received_events","type":"User","site_admin":false},"repo":{"id":19869133,"name":"xarray","full_name":"shoyer/xarray","owner":{"login":"shoyer","id":1217238,"avatar_url":"https://avatars.githubusercontent.com/u/1217238?v=3","gravatar_id":"","url":"https://api.github.com/users/shoyer","html_url":"https://github.com/shoyer","followers_url":"https://api.github.com/users/shoyer/followers","following_url":"https://api.github.com/users/shoyer/following{/other_user}","gists_url":"https://api.github.com/users/shoyer/gists{/gist_id}","starred_url":"https://api.github.com/users/shoyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoyer/subscriptions","organizations_url":"https://api.github.com/users/shoyer/orgs","repos_url":"https://api.github.com/users/shoyer/repos","events_url":"https://api.github.com/users/shoyer/events{/privacy}","received_events_url":"https://api.github.com/users/shoyer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shoyer/xarray","description":"Extended arrays for working with scientific datasets in Python. http://xray.readthedocs.org","fork":true,"url":"https://api.github.com/repos/shoyer/xarray","forks_url":"https://api.github.com/repos/shoyer/xarray/forks","keys_url":"https://api.github.com/repos/shoyer/xarray/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shoyer/xarray/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shoyer/xarray/teams","hooks_url":"https://api.github.com/repos/shoyer/xarray/hooks","issue_events_url":"https://api.github.com/repos/shoyer/xarray/issues/events{/number}","events_url":"https://api.github.com/repos/shoyer/xarray/events","assignees_url":"https://api.github.com/repos/shoyer/xarray/assignees{/user}","branches_url":"https://api.github.com/repos/shoyer/xarray/branches{/branch}","tags_url":"https://api.github.com/repos/shoyer/xarray/tags","blobs_url":"https://api.github.com/repos/shoyer/xarray/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shoyer/xarray/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shoyer/xarray/git/refs{/sha}","trees_url":"https://api.github.com/repos/shoyer/xarray/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shoyer/xarray/statuses/{sha}","languages_url":"https://api.github.com/repos/shoyer/xarray/languages","stargazers_url":"https://api.github.com/repos/shoyer/xarray/stargazers","contributors_url":"https://api.github.com/repos/shoyer/xarray/contributors","subscribers_url":"https://api.github.com/repos/shoyer/xarray/subscribers","subscription_url":"https://api.github.com/repos/shoyer/xarray/subscription","commits_url":"https://api.github.com/repos/shoyer/xarray/commits{/sha}","git_commits_url":"https://api.github.com/repos/shoyer/xarray/git/commits{/sha}","comments_url":"https://api.github.com/repos/shoyer/xarray/comments{/number}","issue_comment_url":"https://api.github.com/repos/shoyer/xarray/issues/comments{/number}","contents_url":"https://api.github.com/repos/shoyer/xarray/contents/{+path}","compare_url":"https://api.github.com/repos/shoyer/xarray/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shoyer/xarray/merges","archive_url":"https://api.github.com/repos/shoyer/xarray/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shoyer/xarray/downloads","issues_url":"https://api.github.com/repos/shoyer/xarray/issues{/number}","pulls_url":"https://api.github.com/repos/shoyer/xarray/pulls{/number}","milestones_url":"https://api.github.com/repos/shoyer/xarray/milestones{/number}","notifications_url":"https://api.github.com/repos/shoyer/xarray/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shoyer/xarray/labels{/name}","releases_url":"https://api.github.com/repos/shoyer/xarray/releases{/id}","deployments_url":"https://api.github.com/repos/shoyer/xarray/deployments","created_at":"2014-05-16T20:03:09Z","updated_at":"2016-01-12T19:05:29Z","pushed_at":"2016-07-29T08:07:30Z","git_url":"git://github.com/shoyer/xarray.git","ssh_url":"git@github.com:shoyer/xarray.git","clone_url":"https://github.com/shoyer/xarray.git","svn_url":"https://github.com/shoyer/xarray","homepage":"","size":7270,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pydata:master","ref":"master","sha":"7a7c3d580251807b052c65ee4b3481806e7514ec","user":{"login":"pydata","id":1284191,"avatar_url":"https://avatars.githubusercontent.com/u/1284191?v=3","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,"name":"xarray","full_name":"pydata/xarray","owner":{"login":"pydata","id":1284191,"avatar_url":"https://avatars.githubusercontent.com/u/1284191?v=3","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},"private":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":"2016-07-29T04:50:33Z","pushed_at":"2016-07-29T08:07:57Z","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":7633,"stargazers_count":406,"watchers_count":406,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":115,"mirror_url":null,"open_issues_count":183,"forks":115,"open_issues":183,"watchers":406,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pydata/xarray/pulls/924"},"html":{"href":"https://github.com/pydata/xarray/pull/924"},"issue":{"href":"https://api.github.com/repos/pydata/xarray/issues/924"},"comments":{"href":"https://api.github.com/repos/pydata/xarray/issues/924/comments"},"review_comments":{"href":"https://api.github.com/repos/pydata/xarray/pulls/924/comments"},"review_comment":{"href":"https://api.github.com/repos/pydata/xarray/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pydata/xarray/pulls/924/commits"},"statuses":{"href":"https://api.github.com/repos/pydata/xarray/statuses/9c7880da9b86d9063a90637752625f39d289a746"}}}}
{"actor":{"display_login":"rabernat"}}