{"action":"created","comment":{"url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/comments/44061594","id":44061594,"diff_hunk":"@@ -195,12 +195,23 @@ def run_tr55(censuses, model_input, cached_aoi_census=None):\n \n     # Run the model under both current conditions and Pre-Columbian\n     # conditions.\n-    model_output = simulate_day(aoi_census, precip, cell_res=resolution)\n-    precolumbian_output = simulate_day(aoi_census, precip,\n-                                       cell_res=resolution, precolumbian=True)\n-\n-    model_output['pc_unmodified'] = precolumbian_output['unmodified']\n-    model_output['pc_modified'] = precolumbian_output['modified']\n+    try:\n+        model_output = simulate_day(aoi_census, precip, cell_res=resolution)\n+        precolumbian_output = simulate_day(aoi_census,\n+                                           precip,\n+                                           cell_res=resolution,\n+                                           precolumbian=True)\n+        model_output['pc_unmodified'] = precolumbian_output['unmodified']\n+        model_output['pc_modified'] = precolumbian_output['modified']\n+        runoff = format_runoff(model_output)\n+        quality = format_quality(model_output)\n+\n+    except KeyError as e:\n+        model_output = None\n+        precolumbian_output = None\n+        runoff = {}\n+        quality = []\n+        logger.info('Bad input data to TR55: %s' % e)","path":"src/mmw/apps/modeling/tasks.py","position":26,"original_position":26,"commit_id":"2cd2593d5f4cdd077fd302358d0893a2c03cf727","original_commit_id":"2cd2593d5f4cdd077fd302358d0893a2c03cf727","user":{"login":"mmcfarland","id":1014341,"avatar_url":"https://avatars.githubusercontent.com/u/1014341?v=3","gravatar_id":"","url":"https://api.github.com/users/mmcfarland","html_url":"https://github.com/mmcfarland","followers_url":"https://api.github.com/users/mmcfarland/followers","following_url":"https://api.github.com/users/mmcfarland/following{/other_user}","gists_url":"https://api.github.com/users/mmcfarland/gists{/gist_id}","starred_url":"https://api.github.com/users/mmcfarland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmcfarland/subscriptions","organizations_url":"https://api.github.com/users/mmcfarland/orgs","repos_url":"https://api.github.com/users/mmcfarland/repos","events_url":"https://api.github.com/users/mmcfarland/events{/privacy}","received_events_url":"https://api.github.com/users/mmcfarland/received_events","type":"User","site_admin":false},"body":"Should this be `logging.error`?","created_at":"2015-11-05T20:01:45Z","updated_at":"2015-11-05T20:01:45Z","html_url":"https://github.com/WikiWatershed/model-my-watershed/pull/1004#discussion_r44061594","pull_request_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/1004","_links":{"self":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/comments/44061594"},"html":{"href":"https://github.com/WikiWatershed/model-my-watershed/pull/1004#discussion_r44061594"},"pull_request":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/1004"}}},"pull_request":{"url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/1004","id":49865110,"html_url":"https://github.com/WikiWatershed/model-my-watershed/pull/1004","diff_url":"https://github.com/WikiWatershed/model-my-watershed/pull/1004.diff","patch_url":"https://github.com/WikiWatershed/model-my-watershed/pull/1004.patch","issue_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/issues/1004","number":1004,"state":"open","locked":false,"title":"Catch TR55 key errors.","user":{"login":"lliss","id":903219,"avatar_url":"https://avatars.githubusercontent.com/u/903219?v=3","gravatar_id":"","url":"https://api.github.com/users/lliss","html_url":"https://github.com/lliss","followers_url":"https://api.github.com/users/lliss/followers","following_url":"https://api.github.com/users/lliss/following{/other_user}","gists_url":"https://api.github.com/users/lliss/gists{/gist_id}","starred_url":"https://api.github.com/users/lliss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lliss/subscriptions","organizations_url":"https://api.github.com/users/lliss/orgs","repos_url":"https://api.github.com/users/lliss/repos","events_url":"https://api.github.com/users/lliss/events{/privacy}","received_events_url":"https://api.github.com/users/lliss/received_events","type":"User","site_admin":false},"body":"Connects #976\r\n\r\nThe new version of TR55 raises KeyError when there it receives simulation data\r\nwith unsupported types. This updates our worker to catch such errors and\r\ngracefully fallback to avoid crashes.\r\n\r\n### To test:\r\n - Reprovision worker to get new TR55.\r\n - Start celery debug script and watch logs.\r\n - Supply junk data to TR55 (Try the attached patch to let the UI do it for you.)\r\n - Ensure that we log the exception and do not crash.","created_at":"2015-11-05T18:58:54Z","updated_at":"2015-11-05T20:01:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"26fc6f82be35fbc0d16863f7c93f2bc48031664a","assignee":{"login":"jamesmcclain","id":11281373,"avatar_url":"https://avatars.githubusercontent.com/u/11281373?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesmcclain","html_url":"https://github.com/jamesmcclain","followers_url":"https://api.github.com/users/jamesmcclain/followers","following_url":"https://api.github.com/users/jamesmcclain/following{/other_user}","gists_url":"https://api.github.com/users/jamesmcclain/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesmcclain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesmcclain/subscriptions","organizations_url":"https://api.github.com/users/jamesmcclain/orgs","repos_url":"https://api.github.com/users/jamesmcclain/repos","events_url":"https://api.github.com/users/jamesmcclain/events{/privacy}","received_events_url":"https://api.github.com/users/jamesmcclain/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/1004/commits","review_comments_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/1004/comments","review_comment_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/issues/1004/comments","statuses_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/statuses/2cd2593d5f4cdd077fd302358d0893a2c03cf727","head":{"label":"lliss:feature/lol/tr-55-key-error","ref":"feature/lol/tr-55-key-error","sha":"2cd2593d5f4cdd077fd302358d0893a2c03cf727","user":{"login":"lliss","id":903219,"avatar_url":"https://avatars.githubusercontent.com/u/903219?v=3","gravatar_id":"","url":"https://api.github.com/users/lliss","html_url":"https://github.com/lliss","followers_url":"https://api.github.com/users/lliss/followers","following_url":"https://api.github.com/users/lliss/following{/other_user}","gists_url":"https://api.github.com/users/lliss/gists{/gist_id}","starred_url":"https://api.github.com/users/lliss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lliss/subscriptions","organizations_url":"https://api.github.com/users/lliss/orgs","repos_url":"https://api.github.com/users/lliss/repos","events_url":"https://api.github.com/users/lliss/events{/privacy}","received_events_url":"https://api.github.com/users/lliss/received_events","type":"User","site_admin":false},"repo":{"id":36316546,"name":"model-my-watershed","full_name":"lliss/model-my-watershed","owner":{"login":"lliss","id":903219,"avatar_url":"https://avatars.githubusercontent.com/u/903219?v=3","gravatar_id":"","url":"https://api.github.com/users/lliss","html_url":"https://github.com/lliss","followers_url":"https://api.github.com/users/lliss/followers","following_url":"https://api.github.com/users/lliss/following{/other_user}","gists_url":"https://api.github.com/users/lliss/gists{/gist_id}","starred_url":"https://api.github.com/users/lliss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lliss/subscriptions","organizations_url":"https://api.github.com/users/lliss/orgs","repos_url":"https://api.github.com/users/lliss/repos","events_url":"https://api.github.com/users/lliss/events{/privacy}","received_events_url":"https://api.github.com/users/lliss/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lliss/model-my-watershed","description":"The web application front end for Model My Watershed.","fork":true,"url":"https://api.github.com/repos/lliss/model-my-watershed","forks_url":"https://api.github.com/repos/lliss/model-my-watershed/forks","keys_url":"https://api.github.com/repos/lliss/model-my-watershed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lliss/model-my-watershed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lliss/model-my-watershed/teams","hooks_url":"https://api.github.com/repos/lliss/model-my-watershed/hooks","issue_events_url":"https://api.github.com/repos/lliss/model-my-watershed/issues/events{/number}","events_url":"https://api.github.com/repos/lliss/model-my-watershed/events","assignees_url":"https://api.github.com/repos/lliss/model-my-watershed/assignees{/user}","branches_url":"https://api.github.com/repos/lliss/model-my-watershed/branches{/branch}","tags_url":"https://api.github.com/repos/lliss/model-my-watershed/tags","blobs_url":"https://api.github.com/repos/lliss/model-my-watershed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lliss/model-my-watershed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lliss/model-my-watershed/git/refs{/sha}","trees_url":"https://api.github.com/repos/lliss/model-my-watershed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lliss/model-my-watershed/statuses/{sha}","languages_url":"https://api.github.com/repos/lliss/model-my-watershed/languages","stargazers_url":"https://api.github.com/repos/lliss/model-my-watershed/stargazers","contributors_url":"https://api.github.com/repos/lliss/model-my-watershed/contributors","subscribers_url":"https://api.github.com/repos/lliss/model-my-watershed/subscribers","subscription_url":"https://api.github.com/repos/lliss/model-my-watershed/subscription","commits_url":"https://api.github.com/repos/lliss/model-my-watershed/commits{/sha}","git_commits_url":"https://api.github.com/repos/lliss/model-my-watershed/git/commits{/sha}","comments_url":"https://api.github.com/repos/lliss/model-my-watershed/comments{/number}","issue_comment_url":"https://api.github.com/repos/lliss/model-my-watershed/issues/comments{/number}","contents_url":"https://api.github.com/repos/lliss/model-my-watershed/contents/{+path}","compare_url":"https://api.github.com/repos/lliss/model-my-watershed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lliss/model-my-watershed/merges","archive_url":"https://api.github.com/repos/lliss/model-my-watershed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lliss/model-my-watershed/downloads","issues_url":"https://api.github.com/repos/lliss/model-my-watershed/issues{/number}","pulls_url":"https://api.github.com/repos/lliss/model-my-watershed/pulls{/number}","milestones_url":"https://api.github.com/repos/lliss/model-my-watershed/milestones{/number}","notifications_url":"https://api.github.com/repos/lliss/model-my-watershed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lliss/model-my-watershed/labels{/name}","releases_url":"https://api.github.com/repos/lliss/model-my-watershed/releases{/id}","created_at":"2015-05-26T18:46:24Z","updated_at":"2015-06-11T19:50:01Z","pushed_at":"2015-11-05T18:56:47Z","git_url":"git://github.com/lliss/model-my-watershed.git","ssh_url":"git@github.com:lliss/model-my-watershed.git","clone_url":"https://github.com/lliss/model-my-watershed.git","svn_url":"https://github.com/lliss/model-my-watershed","homepage":null,"size":16597,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"WikiWatershed:develop","ref":"develop","sha":"aeb0f71a2b6e15c587935f9a5cffeb97eae9551d","user":{"login":"WikiWatershed","id":8520008,"avatar_url":"https://avatars.githubusercontent.com/u/8520008?v=3","gravatar_id":"","url":"https://api.github.com/users/WikiWatershed","html_url":"https://github.com/WikiWatershed","followers_url":"https://api.github.com/users/WikiWatershed/followers","following_url":"https://api.github.com/users/WikiWatershed/following{/other_user}","gists_url":"https://api.github.com/users/WikiWatershed/gists{/gist_id}","starred_url":"https://api.github.com/users/WikiWatershed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WikiWatershed/subscriptions","organizations_url":"https://api.github.com/users/WikiWatershed/orgs","repos_url":"https://api.github.com/users/WikiWatershed/repos","events_url":"https://api.github.com/users/WikiWatershed/events{/privacy}","received_events_url":"https://api.github.com/users/WikiWatershed/received_events","type":"Organization","site_admin":false},"repo":{"id":32742922,"name":"model-my-watershed","full_name":"WikiWatershed/model-my-watershed","owner":{"login":"WikiWatershed","id":8520008,"avatar_url":"https://avatars.githubusercontent.com/u/8520008?v=3","gravatar_id":"","url":"https://api.github.com/users/WikiWatershed","html_url":"https://github.com/WikiWatershed","followers_url":"https://api.github.com/users/WikiWatershed/followers","following_url":"https://api.github.com/users/WikiWatershed/following{/other_user}","gists_url":"https://api.github.com/users/WikiWatershed/gists{/gist_id}","starred_url":"https://api.github.com/users/WikiWatershed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WikiWatershed/subscriptions","organizations_url":"https://api.github.com/users/WikiWatershed/orgs","repos_url":"https://api.github.com/users/WikiWatershed/repos","events_url":"https://api.github.com/users/WikiWatershed/events{/privacy}","received_events_url":"https://api.github.com/users/WikiWatershed/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WikiWatershed/model-my-watershed","description":"The web application front end for Model My Watershed.","fork":false,"url":"https://api.github.com/repos/WikiWatershed/model-my-watershed","forks_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/forks","keys_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/teams","hooks_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/hooks","issue_events_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/issues/events{/number}","events_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/events","assignees_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/assignees{/user}","branches_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/branches{/branch}","tags_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/tags","blobs_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/git/refs{/sha}","trees_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/statuses/{sha}","languages_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/languages","stargazers_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/stargazers","contributors_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/contributors","subscribers_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/subscribers","subscription_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/subscription","commits_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/commits{/sha}","git_commits_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/git/commits{/sha}","comments_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/comments{/number}","issue_comment_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/issues/comments{/number}","contents_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/contents/{+path}","compare_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/merges","archive_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/downloads","issues_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/issues{/number}","pulls_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls{/number}","milestones_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/milestones{/number}","notifications_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/labels{/name}","releases_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/releases{/id}","created_at":"2015-03-23T16:02:55Z","updated_at":"2015-10-11T22:49:42Z","pushed_at":"2015-11-05T18:58:54Z","git_url":"git://github.com/WikiWatershed/model-my-watershed.git","ssh_url":"git@github.com:WikiWatershed/model-my-watershed.git","clone_url":"https://github.com/WikiWatershed/model-my-watershed.git","svn_url":"https://github.com/WikiWatershed/model-my-watershed","homepage":null,"size":20290,"stargazers_count":3,"watchers_count":3,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":126,"forks":12,"open_issues":126,"watchers":3,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/1004"},"html":{"href":"https://github.com/WikiWatershed/model-my-watershed/pull/1004"},"issue":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/issues/1004"},"comments":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/issues/1004/comments"},"review_comments":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/1004/comments"},"review_comment":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/1004/commits"},"statuses":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/statuses/2cd2593d5f4cdd077fd302358d0893a2c03cf727"}}}}