{"action":"created","comment":{"url":"https://api.github.com/repos/metoppv/improver/pulls/comments/119559469","pull_request_review_id":41448820,"id":119559469,"diff_hunk":"@@ -226,6 +226,61 @@ def test_check_coordinate_without_forecast_period(self):\n         result = plugin._find_required_lead_times(cube)\n         self.assertArrayAlmostEqual(result, expected_result)\n \n+    def test_check_forecast_period_unit_conversion(self):\n+        \"\"\"\n+        Test that the data within the list is as expected, when\n+        the input cube has a forecast_period coordinate with units\n+        other than the desired units of hours.\n+        \"\"\"\n+        cube = add_forecast_reference_time_and_forecast_period(set_up_cube())\n+        expected_result = cube.coord(\"forecast_period\").points\n+        cube.coord(\"forecast_period\").convert_units(\"seconds\")\n+        plugin = NBHood(self.RADIUS_IN_KM)\n+        result = plugin._find_required_lead_times(cube)\n+        self.assertArrayAlmostEqual(result, expected_result)\n+\n+    def test_check_time_unit_conversion(self):\n+        \"\"\"\n+        Test that the data within the list is as expected, when\n+        the input cube has a time coordinate with units\n+        other than the desired units of hours since 1970-01-01 00:00:00.\n+        \"\"\"\n+        cube = add_forecast_reference_time_and_forecast_period(set_up_cube())\n+        expected_result = cube.coord(\"forecast_period\").points\n+        cube.coord(\"time\").convert_units(\"seconds since 1970-01-01 00:00:00\")\n+        plugin = NBHood(self.RADIUS_IN_KM)\n+        result = plugin._find_required_lead_times(cube)\n+        self.assertArrayAlmostEqual(result, expected_result)\n+\n+    def test_check_forecast_period_unit_conversion_exception(self):\n+        \"\"\"\n+        Test that an exception is raised, when the input cube has a\n+        forecast_period coordinate with units that can not be converted\n+        into hours.\n+        \"\"\"\n+        cube = add_forecast_reference_time_and_forecast_period(set_up_cube())\n+        expected_result = cube.coord(\"forecast_period\").points\n+        cube.coord(\"forecast_period\").units = Unit(\"Celsius\")\n+        plugin = NBHood(self.RADIUS_IN_KM)\n+        msg = \"For forecast_period\"\n+        with self.assertRaisesRegexp(ValueError, msg):\n+            plugin._find_required_lead_times(cube)\n+\n+    def test_check_forecast_reference_time_unit_conversion_exception(self):\n+        \"\"\"\n+        Test that an exception is raised, when the input cube has a\n+        forecast_reference_time coordinate with units that can not be\n+        converted into hours.\n+        \"\"\"\n+        cube = add_forecast_reference_time_and_forecast_period(set_up_cube())\n+        cube.remove_coord(\"forecast_period\")\n+        expected_result = cube.coord(\"forecast_reference_time\").points","path":"lib/improver/tests/test_nbhood_basicneighbourhoodprocessing.py","position":null,"original_position":97,"commit_id":"563f882c7325e1999344279e59824e48b3569518","original_commit_id":"5151ee9c85c26114d25418980b75b7d5b539b2f5","user":{"login":"benfitzpatrick","id":1138333,"avatar_url":"https://avatars1.githubusercontent.com/u/1138333?v=3","gravatar_id":"","url":"https://api.github.com/users/benfitzpatrick","html_url":"https://github.com/benfitzpatrick","followers_url":"https://api.github.com/users/benfitzpatrick/followers","following_url":"https://api.github.com/users/benfitzpatrick/following{/other_user}","gists_url":"https://api.github.com/users/benfitzpatrick/gists{/gist_id}","starred_url":"https://api.github.com/users/benfitzpatrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benfitzpatrick/subscriptions","organizations_url":"https://api.github.com/users/benfitzpatrick/orgs","repos_url":"https://api.github.com/users/benfitzpatrick/repos","events_url":"https://api.github.com/users/benfitzpatrick/events{/privacy}","received_events_url":"https://api.github.com/users/benfitzpatrick/received_events","type":"User","site_admin":false},"body":"Unused","created_at":"2017-06-01T08:48:25Z","updated_at":"2017-06-01T08:48:25Z","html_url":"https://github.com/metoppv/improver/pull/52#discussion_r119559469","pull_request_url":"https://api.github.com/repos/metoppv/improver/pulls/52","_links":{"self":{"href":"https://api.github.com/repos/metoppv/improver/pulls/comments/119559469"},"html":{"href":"https://github.com/metoppv/improver/pull/52#discussion_r119559469"},"pull_request":{"href":"https://api.github.com/repos/metoppv/improver/pulls/52"}}},"pull_request":{"url":"https://api.github.com/repos/metoppv/improver/pulls/52","id":120330071,"html_url":"https://github.com/metoppv/improver/pull/52","diff_url":"https://github.com/metoppv/improver/pull/52.diff","patch_url":"https://github.com/metoppv/improver/pull/52.patch","issue_url":"https://api.github.com/repos/metoppv/improver/issues/52","number":52,"state":"open","locked":false,"title":"Neighbourhood processing: Configurable radius by lead times","user":{"login":"gavinevans","id":26933341,"avatar_url":"https://avatars0.githubusercontent.com/u/26933341?v=3","gravatar_id":"","url":"https://api.github.com/users/gavinevans","html_url":"https://github.com/gavinevans","followers_url":"https://api.github.com/users/gavinevans/followers","following_url":"https://api.github.com/users/gavinevans/following{/other_user}","gists_url":"https://api.github.com/users/gavinevans/gists{/gist_id}","starred_url":"https://api.github.com/users/gavinevans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gavinevans/subscriptions","organizations_url":"https://api.github.com/users/gavinevans/orgs","repos_url":"https://api.github.com/users/gavinevans/repos","events_url":"https://api.github.com/users/gavinevans/events{/privacy}","received_events_url":"https://api.github.com/users/gavinevans/received_events","type":"User","site_admin":false},"body":"#36 \r\n\r\nTesting:\r\n - [OK] Ran tests and they passed OK\r\n - [OK] Added new tests for the new feature(s)","created_at":"2017-05-12T14:02:47Z","updated_at":"2017-06-01T08:48:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"07c55c361fb98117bff7b3225cb05df69835389d","assignee":{"login":"gavinevans","id":26933341,"avatar_url":"https://avatars0.githubusercontent.com/u/26933341?v=3","gravatar_id":"","url":"https://api.github.com/users/gavinevans","html_url":"https://github.com/gavinevans","followers_url":"https://api.github.com/users/gavinevans/followers","following_url":"https://api.github.com/users/gavinevans/following{/other_user}","gists_url":"https://api.github.com/users/gavinevans/gists{/gist_id}","starred_url":"https://api.github.com/users/gavinevans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gavinevans/subscriptions","organizations_url":"https://api.github.com/users/gavinevans/orgs","repos_url":"https://api.github.com/users/gavinevans/repos","events_url":"https://api.github.com/users/gavinevans/events{/privacy}","received_events_url":"https://api.github.com/users/gavinevans/received_events","type":"User","site_admin":false},"assignees":[{"login":"gavinevans","id":26933341,"avatar_url":"https://avatars0.githubusercontent.com/u/26933341?v=3","gravatar_id":"","url":"https://api.github.com/users/gavinevans","html_url":"https://github.com/gavinevans","followers_url":"https://api.github.com/users/gavinevans/followers","following_url":"https://api.github.com/users/gavinevans/following{/other_user}","gists_url":"https://api.github.com/users/gavinevans/gists{/gist_id}","starred_url":"https://api.github.com/users/gavinevans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gavinevans/subscriptions","organizations_url":"https://api.github.com/users/gavinevans/orgs","repos_url":"https://api.github.com/users/gavinevans/repos","events_url":"https://api.github.com/users/gavinevans/events{/privacy}","received_events_url":"https://api.github.com/users/gavinevans/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/metoppv/improver/milestones/5","html_url":"https://github.com/metoppv/improver/milestone/5","labels_url":"https://api.github.com/repos/metoppv/improver/milestones/5/labels","id":2464425,"number":5,"title":"2017-05","description":"More fully fleshed out IMPROVER, ready for serious code development","creator":{"login":"benfitzpatrick","id":1138333,"avatar_url":"https://avatars1.githubusercontent.com/u/1138333?v=3","gravatar_id":"","url":"https://api.github.com/users/benfitzpatrick","html_url":"https://github.com/benfitzpatrick","followers_url":"https://api.github.com/users/benfitzpatrick/followers","following_url":"https://api.github.com/users/benfitzpatrick/following{/other_user}","gists_url":"https://api.github.com/users/benfitzpatrick/gists{/gist_id}","starred_url":"https://api.github.com/users/benfitzpatrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benfitzpatrick/subscriptions","organizations_url":"https://api.github.com/users/benfitzpatrick/orgs","repos_url":"https://api.github.com/users/benfitzpatrick/repos","events_url":"https://api.github.com/users/benfitzpatrick/events{/privacy}","received_events_url":"https://api.github.com/users/benfitzpatrick/received_events","type":"User","site_admin":false},"open_issues":16,"closed_issues":4,"state":"open","created_at":"2017-04-18T15:54:47Z","updated_at":"2017-05-31T14:03:32Z","due_on":"2017-05-31T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/metoppv/improver/pulls/52/commits","review_comments_url":"https://api.github.com/repos/metoppv/improver/pulls/52/comments","review_comment_url":"https://api.github.com/repos/metoppv/improver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/metoppv/improver/issues/52/comments","statuses_url":"https://api.github.com/repos/metoppv/improver/statuses/563f882c7325e1999344279e59824e48b3569518","head":{"label":"gavinevans:nbhood_radius_by_leadtime","ref":"nbhood_radius_by_leadtime","sha":"563f882c7325e1999344279e59824e48b3569518","user":{"login":"gavinevans","id":26933341,"avatar_url":"https://avatars0.githubusercontent.com/u/26933341?v=3","gravatar_id":"","url":"https://api.github.com/users/gavinevans","html_url":"https://github.com/gavinevans","followers_url":"https://api.github.com/users/gavinevans/followers","following_url":"https://api.github.com/users/gavinevans/following{/other_user}","gists_url":"https://api.github.com/users/gavinevans/gists{/gist_id}","starred_url":"https://api.github.com/users/gavinevans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gavinevans/subscriptions","organizations_url":"https://api.github.com/users/gavinevans/orgs","repos_url":"https://api.github.com/users/gavinevans/repos","events_url":"https://api.github.com/users/gavinevans/events{/privacy}","received_events_url":"https://api.github.com/users/gavinevans/received_events","type":"User","site_admin":false},"repo":{"id":87411485,"name":"improver","full_name":"gavinevans/improver","owner":{"login":"gavinevans","id":26933341,"avatar_url":"https://avatars0.githubusercontent.com/u/26933341?v=3","gravatar_id":"","url":"https://api.github.com/users/gavinevans","html_url":"https://github.com/gavinevans","followers_url":"https://api.github.com/users/gavinevans/followers","following_url":"https://api.github.com/users/gavinevans/following{/other_user}","gists_url":"https://api.github.com/users/gavinevans/gists{/gist_id}","starred_url":"https://api.github.com/users/gavinevans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gavinevans/subscriptions","organizations_url":"https://api.github.com/users/gavinevans/orgs","repos_url":"https://api.github.com/users/gavinevans/repos","events_url":"https://api.github.com/users/gavinevans/events{/privacy}","received_events_url":"https://api.github.com/users/gavinevans/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gavinevans/improver","description":"IMPROVER","fork":true,"url":"https://api.github.com/repos/gavinevans/improver","forks_url":"https://api.github.com/repos/gavinevans/improver/forks","keys_url":"https://api.github.com/repos/gavinevans/improver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gavinevans/improver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gavinevans/improver/teams","hooks_url":"https://api.github.com/repos/gavinevans/improver/hooks","issue_events_url":"https://api.github.com/repos/gavinevans/improver/issues/events{/number}","events_url":"https://api.github.com/repos/gavinevans/improver/events","assignees_url":"https://api.github.com/repos/gavinevans/improver/assignees{/user}","branches_url":"https://api.github.com/repos/gavinevans/improver/branches{/branch}","tags_url":"https://api.github.com/repos/gavinevans/improver/tags","blobs_url":"https://api.github.com/repos/gavinevans/improver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gavinevans/improver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gavinevans/improver/git/refs{/sha}","trees_url":"https://api.github.com/repos/gavinevans/improver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gavinevans/improver/statuses/{sha}","languages_url":"https://api.github.com/repos/gavinevans/improver/languages","stargazers_url":"https://api.github.com/repos/gavinevans/improver/stargazers","contributors_url":"https://api.github.com/repos/gavinevans/improver/contributors","subscribers_url":"https://api.github.com/repos/gavinevans/improver/subscribers","subscription_url":"https://api.github.com/repos/gavinevans/improver/subscription","commits_url":"https://api.github.com/repos/gavinevans/improver/commits{/sha}","git_commits_url":"https://api.github.com/repos/gavinevans/improver/git/commits{/sha}","comments_url":"https://api.github.com/repos/gavinevans/improver/comments{/number}","issue_comment_url":"https://api.github.com/repos/gavinevans/improver/issues/comments{/number}","contents_url":"https://api.github.com/repos/gavinevans/improver/contents/{+path}","compare_url":"https://api.github.com/repos/gavinevans/improver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gavinevans/improver/merges","archive_url":"https://api.github.com/repos/gavinevans/improver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gavinevans/improver/downloads","issues_url":"https://api.github.com/repos/gavinevans/improver/issues{/number}","pulls_url":"https://api.github.com/repos/gavinevans/improver/pulls{/number}","milestones_url":"https://api.github.com/repos/gavinevans/improver/milestones{/number}","notifications_url":"https://api.github.com/repos/gavinevans/improver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gavinevans/improver/labels{/name}","releases_url":"https://api.github.com/repos/gavinevans/improver/releases{/id}","deployments_url":"https://api.github.com/repos/gavinevans/improver/deployments","created_at":"2017-04-06T09:28:43Z","updated_at":"2017-04-06T10:19:29Z","pushed_at":"2017-06-01T08:47:55Z","git_url":"git://github.com/gavinevans/improver.git","ssh_url":"git@github.com:gavinevans/improver.git","clone_url":"https://github.com/gavinevans/improver.git","svn_url":"https://github.com/gavinevans/improver","homepage":null,"size":285,"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":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"metoppv:master","ref":"master","sha":"28f66d05ee4a8153e71d387c5eb0cdfcecee87c7","user":{"login":"metoppv","id":26465485,"avatar_url":"https://avatars1.githubusercontent.com/u/26465485?v=3","gravatar_id":"","url":"https://api.github.com/users/metoppv","html_url":"https://github.com/metoppv","followers_url":"https://api.github.com/users/metoppv/followers","following_url":"https://api.github.com/users/metoppv/following{/other_user}","gists_url":"https://api.github.com/users/metoppv/gists{/gist_id}","starred_url":"https://api.github.com/users/metoppv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metoppv/subscriptions","organizations_url":"https://api.github.com/users/metoppv/orgs","repos_url":"https://api.github.com/users/metoppv/repos","events_url":"https://api.github.com/users/metoppv/events{/privacy}","received_events_url":"https://api.github.com/users/metoppv/received_events","type":"Organization","site_admin":false},"repo":{"id":85334761,"name":"improver","full_name":"metoppv/improver","owner":{"login":"metoppv","id":26465485,"avatar_url":"https://avatars1.githubusercontent.com/u/26465485?v=3","gravatar_id":"","url":"https://api.github.com/users/metoppv","html_url":"https://github.com/metoppv","followers_url":"https://api.github.com/users/metoppv/followers","following_url":"https://api.github.com/users/metoppv/following{/other_user}","gists_url":"https://api.github.com/users/metoppv/gists{/gist_id}","starred_url":"https://api.github.com/users/metoppv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metoppv/subscriptions","organizations_url":"https://api.github.com/users/metoppv/orgs","repos_url":"https://api.github.com/users/metoppv/repos","events_url":"https://api.github.com/users/metoppv/events{/privacy}","received_events_url":"https://api.github.com/users/metoppv/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/metoppv/improver","description":"IMPROVER","fork":false,"url":"https://api.github.com/repos/metoppv/improver","forks_url":"https://api.github.com/repos/metoppv/improver/forks","keys_url":"https://api.github.com/repos/metoppv/improver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metoppv/improver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metoppv/improver/teams","hooks_url":"https://api.github.com/repos/metoppv/improver/hooks","issue_events_url":"https://api.github.com/repos/metoppv/improver/issues/events{/number}","events_url":"https://api.github.com/repos/metoppv/improver/events","assignees_url":"https://api.github.com/repos/metoppv/improver/assignees{/user}","branches_url":"https://api.github.com/repos/metoppv/improver/branches{/branch}","tags_url":"https://api.github.com/repos/metoppv/improver/tags","blobs_url":"https://api.github.com/repos/metoppv/improver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metoppv/improver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metoppv/improver/git/refs{/sha}","trees_url":"https://api.github.com/repos/metoppv/improver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metoppv/improver/statuses/{sha}","languages_url":"https://api.github.com/repos/metoppv/improver/languages","stargazers_url":"https://api.github.com/repos/metoppv/improver/stargazers","contributors_url":"https://api.github.com/repos/metoppv/improver/contributors","subscribers_url":"https://api.github.com/repos/metoppv/improver/subscribers","subscription_url":"https://api.github.com/repos/metoppv/improver/subscription","commits_url":"https://api.github.com/repos/metoppv/improver/commits{/sha}","git_commits_url":"https://api.github.com/repos/metoppv/improver/git/commits{/sha}","comments_url":"https://api.github.com/repos/metoppv/improver/comments{/number}","issue_comment_url":"https://api.github.com/repos/metoppv/improver/issues/comments{/number}","contents_url":"https://api.github.com/repos/metoppv/improver/contents/{+path}","compare_url":"https://api.github.com/repos/metoppv/improver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metoppv/improver/merges","archive_url":"https://api.github.com/repos/metoppv/improver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metoppv/improver/downloads","issues_url":"https://api.github.com/repos/metoppv/improver/issues{/number}","pulls_url":"https://api.github.com/repos/metoppv/improver/pulls{/number}","milestones_url":"https://api.github.com/repos/metoppv/improver/milestones{/number}","notifications_url":"https://api.github.com/repos/metoppv/improver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metoppv/improver/labels{/name}","releases_url":"https://api.github.com/repos/metoppv/improver/releases{/id}","deployments_url":"https://api.github.com/repos/metoppv/improver/deployments","created_at":"2017-03-17T16:51:29Z","updated_at":"2017-04-27T12:56:56Z","pushed_at":"2017-06-01T08:47:56Z","git_url":"git://github.com/metoppv/improver.git","ssh_url":"git@github.com:metoppv/improver.git","clone_url":"https://github.com/metoppv/improver.git","svn_url":"https://github.com/metoppv/improver","homepage":null,"size":148,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":53,"forks":11,"open_issues":53,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/metoppv/improver/pulls/52"},"html":{"href":"https://github.com/metoppv/improver/pull/52"},"issue":{"href":"https://api.github.com/repos/metoppv/improver/issues/52"},"comments":{"href":"https://api.github.com/repos/metoppv/improver/issues/52/comments"},"review_comments":{"href":"https://api.github.com/repos/metoppv/improver/pulls/52/comments"},"review_comment":{"href":"https://api.github.com/repos/metoppv/improver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/metoppv/improver/pulls/52/commits"},"statuses":{"href":"https://api.github.com/repos/metoppv/improver/statuses/563f882c7325e1999344279e59824e48b3569518"}}}}
{"actor":{"display_login":"benfitzpatrick"}}