GitHub PullRequestReviewCommentEvent at 2014-07-17 14:20:48
Repository: iris
Actor: rhattersley
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/SciTools/iris/pulls/comments/15059807","id":15059807,"diff_hunk":"@@ -1677,8 +1677,24 @@ def reset_save_rules():\n \n     _save_rules = None\n \n+def convert_constraints(constraints):\n+    \"\"\"\n+    Converts known constraints from Iris semantics to PP semantics\n+    ignoring all unknown constraints.\n+    \"\"\"\n+    constraints = iris._constraints.list_of_constraints(constraints)\n+    pp_constraints = {}\n+    for con in constraints:\n+        if hasattr(con, '_attributes') and con._attributes.keys() == ['STASH']:\n+            if not pp_constraints.has_key('stash'):\n+                stashobj = STASH.from_msi(con._attributes['STASH'])\n+                pp_constraints['stash'] = stashobj\n+            else:\n+                raise ValueError('multiple STASH constraints not supported'\n+                                 'by the PP loader. {}'.format(constraints))","path":"lib/iris/fileformats/pp.py","position":18,"original_position":18,"commit_id":"330b17c04b8d0b24cdb06dca6314dc35e95ee6bc","original_commit_id":"330b17c04b8d0b24cdb06dca6314dc35e95ee6bc","user":{"login":"rhattersley","id":917914,"avatar_url":"https://avatars.githubusercontent.com/u/917914?","gravatar_id":"1889af9f21c3e07af149e04f23a9619b","url":"https://api.github.com/users/rhattersley","html_url":"https://github.com/rhattersley","followers_url":"https://api.github.com/users/rhattersley/followers","following_url":"https://api.github.com/users/rhattersley/following{/other_user}","gists_url":"https://api.github.com/users/rhattersley/gists{/gist_id}","starred_url":"https://api.github.com/users/rhattersley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhattersley/subscriptions","organizations_url":"https://api.github.com/users/rhattersley/orgs","repos_url":"https://api.github.com/users/rhattersley/repos","events_url":"https://api.github.com/users/rhattersley/events{/privacy}","received_events_url":"https://api.github.com/users/rhattersley/received_events","type":"User","site_admin":false},"body":"There's no need to raise an error here, nor is one wanted. When multiple STASH constraints are supplied the end result should be an empty \"pp_constraints\".","created_at":"2014-07-17T14:20:48Z","updated_at":"2014-07-17T14:20:48Z","html_url":"https://github.com/SciTools/iris/pull/1237#discussion_r15059807","pull_request_url":"https://api.github.com/repos/SciTools/iris/pulls/1237","_links":{"self":{"href":"https://api.github.com/repos/SciTools/iris/pulls/comments/15059807"},"html":{"href":"https://github.com/SciTools/iris/pull/1237#discussion_r15059807"},"pull_request":{"href":"https://api.github.com/repos/SciTools/iris/pulls/1237"}}},"pull_request":{"url":"https://api.github.com/repos/SciTools/iris/pulls/1237","id":18529044,"html_url":"https://github.com/SciTools/iris/pull/1237","diff_url":"https://github.com/SciTools/iris/pull/1237.diff","patch_url":"https://github.com/SciTools/iris/pull/1237.patch","issue_url":"https://api.github.com/repos/SciTools/iris/issues/1237","number":1237,"state":"open","title":"PP constraint","user":{"login":"marqh","id":1557321,"avatar_url":"https://avatars.githubusercontent.com/u/1557321?","gravatar_id":"9f25594a85aa6cae88b73ef5563e8fc4","url":"https://api.github.com/users/marqh","html_url":"https://github.com/marqh","followers_url":"https://api.github.com/users/marqh/followers","following_url":"https://api.github.com/users/marqh/following{/other_user}","gists_url":"https://api.github.com/users/marqh/gists{/gist_id}","starred_url":"https://api.github.com/users/marqh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marqh/subscriptions","organizations_url":"https://api.github.com/users/marqh/orgs","repos_url":"https://api.github.com/users/marqh/repos","events_url":"https://api.github.com/users/marqh/events{/privacy}","received_events_url":"https://api.github.com/users/marqh/received_events","type":"User","site_admin":false},"body":"Speed up for PP and FieldsFiles where a constraint:\r\n```\r\nconstraint = iris.AttributeConstraint(STASH='mXXsXXiXXX')\r\n```\r\nis used.\r\n","created_at":"2014-07-17T13:51:34Z","updated_at":"2014-07-17T14:20:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5d96470a2818b79ebb2d528b05ad411aecccd716","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SciTools/iris/pulls/1237/commits","review_comments_url":"https://api.github.com/repos/SciTools/iris/pulls/1237/comments","review_comment_url":"https://api.github.com/repos/SciTools/iris/pulls/comments/{number}","comments_url":"https://api.github.com/repos/SciTools/iris/issues/1237/comments","statuses_url":"https://api.github.com/repos/SciTools/iris/statuses/330b17c04b8d0b24cdb06dca6314dc35e95ee6bc","head":{"label":"marqh:pp_constraint","ref":"pp_constraint","sha":"330b17c04b8d0b24cdb06dca6314dc35e95ee6bc","user":{"login":"marqh","id":1557321,"avatar_url":"https://avatars.githubusercontent.com/u/1557321?","gravatar_id":"9f25594a85aa6cae88b73ef5563e8fc4","url":"https://api.github.com/users/marqh","html_url":"https://github.com/marqh","followers_url":"https://api.github.com/users/marqh/followers","following_url":"https://api.github.com/users/marqh/following{/other_user}","gists_url":"https://api.github.com/users/marqh/gists{/gist_id}","starred_url":"https://api.github.com/users/marqh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marqh/subscriptions","organizations_url":"https://api.github.com/users/marqh/orgs","repos_url":"https://api.github.com/users/marqh/repos","events_url":"https://api.github.com/users/marqh/events{/privacy}","received_events_url":"https://api.github.com/users/marqh/received_events","type":"User","site_admin":false},"repo":{"id":5371453,"name":"iris","full_name":"marqh/iris","owner":{"login":"marqh","id":1557321,"avatar_url":"https://avatars.githubusercontent.com/u/1557321?","gravatar_id":"9f25594a85aa6cae88b73ef5563e8fc4","url":"https://api.github.com/users/marqh","html_url":"https://github.com/marqh","followers_url":"https://api.github.com/users/marqh/followers","following_url":"https://api.github.com/users/marqh/following{/other_user}","gists_url":"https://api.github.com/users/marqh/gists{/gist_id}","starred_url":"https://api.github.com/users/marqh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marqh/subscriptions","organizations_url":"https://api.github.com/users/marqh/orgs","repos_url":"https://api.github.com/users/marqh/repos","events_url":"https://api.github.com/users/marqh/events{/privacy}","received_events_url":"https://api.github.com/users/marqh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/marqh/iris","description":"","fork":true,"url":"https://api.github.com/repos/marqh/iris","forks_url":"https://api.github.com/repos/marqh/iris/forks","keys_url":"https://api.github.com/repos/marqh/iris/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marqh/iris/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marqh/iris/teams","hooks_url":"https://api.github.com/repos/marqh/iris/hooks","issue_events_url":"https://api.github.com/repos/marqh/iris/issues/events{/number}","events_url":"https://api.github.com/repos/marqh/iris/events","assignees_url":"https://api.github.com/repos/marqh/iris/assignees{/user}","branches_url":"https://api.github.com/repos/marqh/iris/branches{/branch}","tags_url":"https://api.github.com/repos/marqh/iris/tags","blobs_url":"https://api.github.com/repos/marqh/iris/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marqh/iris/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marqh/iris/git/refs{/sha}","trees_url":"https://api.github.com/repos/marqh/iris/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marqh/iris/statuses/{sha}","languages_url":"https://api.github.com/repos/marqh/iris/languages","stargazers_url":"https://api.github.com/repos/marqh/iris/stargazers","contributors_url":"https://api.github.com/repos/marqh/iris/contributors","subscribers_url":"https://api.github.com/repos/marqh/iris/subscribers","subscription_url":"https://api.github.com/repos/marqh/iris/subscription","commits_url":"https://api.github.com/repos/marqh/iris/commits{/sha}","git_commits_url":"https://api.github.com/repos/marqh/iris/git/commits{/sha}","comments_url":"https://api.github.com/repos/marqh/iris/comments{/number}","issue_comment_url":"https://api.github.com/repos/marqh/iris/issues/comments/{number}","contents_url":"https://api.github.com/repos/marqh/iris/contents/{+path}","compare_url":"https://api.github.com/repos/marqh/iris/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marqh/iris/merges","archive_url":"https://api.github.com/repos/marqh/iris/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marqh/iris/downloads","issues_url":"https://api.github.com/repos/marqh/iris/issues{/number}","pulls_url":"https://api.github.com/repos/marqh/iris/pulls{/number}","milestones_url":"https://api.github.com/repos/marqh/iris/milestones{/number}","notifications_url":"https://api.github.com/repos/marqh/iris/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marqh/iris/labels{/name}","releases_url":"https://api.github.com/repos/marqh/iris/releases{/id}","created_at":"2012-08-10T16:11:56Z","updated_at":"2014-06-19T11:51:29Z","pushed_at":"2014-07-17T13:50:08Z","git_url":"git://github.com/marqh/iris.git","ssh_url":"git@github.com:marqh/iris.git","clone_url":"https://github.com/marqh/iris.git","svn_url":"https://github.com/marqh/iris","homepage":"http://scitools.github.com/iris","size":143452,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SciTools:master","ref":"master","sha":"8417aac4836ea57571d8662c54f3d0733b917f4d","user":{"login":"SciTools","id":1391487,"avatar_url":"https://avatars.githubusercontent.com/u/1391487?","gravatar_id":null,"url":"https://api.github.com/users/SciTools","html_url":"https://github.com/SciTools","followers_url":"https://api.github.com/users/SciTools/followers","following_url":"https://api.github.com/users/SciTools/following{/other_user}","gists_url":"https://api.github.com/users/SciTools/gists{/gist_id}","starred_url":"https://api.github.com/users/SciTools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SciTools/subscriptions","organizations_url":"https://api.github.com/users/SciTools/orgs","repos_url":"https://api.github.com/users/SciTools/repos","events_url":"https://api.github.com/users/SciTools/events{/privacy}","received_events_url":"https://api.github.com/users/SciTools/received_events","type":"Organization","site_admin":false},"repo":{"id":5312648,"name":"iris","full_name":"SciTools/iris","owner":{"login":"SciTools","id":1391487,"avatar_url":"https://avatars.githubusercontent.com/u/1391487?","gravatar_id":null,"url":"https://api.github.com/users/SciTools","html_url":"https://github.com/SciTools","followers_url":"https://api.github.com/users/SciTools/followers","following_url":"https://api.github.com/users/SciTools/following{/other_user}","gists_url":"https://api.github.com/users/SciTools/gists{/gist_id}","starred_url":"https://api.github.com/users/SciTools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SciTools/subscriptions","organizations_url":"https://api.github.com/users/SciTools/orgs","repos_url":"https://api.github.com/users/SciTools/repos","events_url":"https://api.github.com/users/SciTools/events{/privacy}","received_events_url":"https://api.github.com/users/SciTools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SciTools/iris","description":"A powerful, easy to use, and community-driven Python library for analysing and visualising meteorological and oceanographic data sets.","fork":false,"url":"https://api.github.com/repos/SciTools/iris","forks_url":"https://api.github.com/repos/SciTools/iris/forks","keys_url":"https://api.github.com/repos/SciTools/iris/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SciTools/iris/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SciTools/iris/teams","hooks_url":"https://api.github.com/repos/SciTools/iris/hooks","issue_events_url":"https://api.github.com/repos/SciTools/iris/issues/events{/number}","events_url":"https://api.github.com/repos/SciTools/iris/events","assignees_url":"https://api.github.com/repos/SciTools/iris/assignees{/user}","branches_url":"https://api.github.com/repos/SciTools/iris/branches{/branch}","tags_url":"https://api.github.com/repos/SciTools/iris/tags","blobs_url":"https://api.github.com/repos/SciTools/iris/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SciTools/iris/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SciTools/iris/git/refs{/sha}","trees_url":"https://api.github.com/repos/SciTools/iris/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SciTools/iris/statuses/{sha}","languages_url":"https://api.github.com/repos/SciTools/iris/languages","stargazers_url":"https://api.github.com/repos/SciTools/iris/stargazers","contributors_url":"https://api.github.com/repos/SciTools/iris/contributors","subscribers_url":"https://api.github.com/repos/SciTools/iris/subscribers","subscription_url":"https://api.github.com/repos/SciTools/iris/subscription","commits_url":"https://api.github.com/repos/SciTools/iris/commits{/sha}","git_commits_url":"https://api.github.com/repos/SciTools/iris/git/commits{/sha}","comments_url":"https://api.github.com/repos/SciTools/iris/comments{/number}","issue_comment_url":"https://api.github.com/repos/SciTools/iris/issues/comments/{number}","contents_url":"https://api.github.com/repos/SciTools/iris/contents/{+path}","compare_url":"https://api.github.com/repos/SciTools/iris/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SciTools/iris/merges","archive_url":"https://api.github.com/repos/SciTools/iris/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SciTools/iris/downloads","issues_url":"https://api.github.com/repos/SciTools/iris/issues{/number}","pulls_url":"https://api.github.com/repos/SciTools/iris/pulls{/number}","milestones_url":"https://api.github.com/repos/SciTools/iris/milestones{/number}","notifications_url":"https://api.github.com/repos/SciTools/iris/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SciTools/iris/labels{/name}","releases_url":"https://api.github.com/repos/SciTools/iris/releases{/id}","created_at":"2012-08-06T10:09:14Z","updated_at":"2014-07-16T21:23:06Z","pushed_at":"2014-07-14T15:47:29Z","git_url":"git://github.com/SciTools/iris.git","ssh_url":"git@github.com:SciTools/iris.git","clone_url":"https://github.com/SciTools/iris.git","svn_url":"https://github.com/SciTools/iris","homepage":"http://scitools.org.uk/iris/","size":128708,"stargazers_count":68,"watchers_count":68,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":56,"mirror_url":null,"open_issues_count":132,"forks":56,"open_issues":132,"watchers":68,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SciTools/iris/pulls/1237"},"html":{"href":"https://github.com/SciTools/iris/pull/1237"},"issue":{"href":"https://api.github.com/repos/SciTools/iris/issues/1237"},"comments":{"href":"https://api.github.com/repos/SciTools/iris/issues/1237/comments"},"review_comments":{"href":"https://api.github.com/repos/SciTools/iris/pulls/1237/comments"},"review_comment":{"href":"https://api.github.com/repos/SciTools/iris/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/SciTools/iris/pulls/1237/commits"},"statuses":{"href":"https://api.github.com/repos/SciTools/iris/statuses/330b17c04b8d0b24cdb06dca6314dc35e95ee6bc"}}}}