{"action":"created","comment":{"url":"https://api.github.com/repos/SciTools/iris/pulls/comments/70232064","id":70232064,"diff_hunk":"@@ -149,64 +177,103 @@ def test_aligned_src_x(self):\n         mask = np.array([[True, False], [False, False]])\n         self.assertArrayEqual(result.data.mask, mask)\n \n-    def test_aligned_src_x_mask(self):\n-        self.src.add_aux_coord(self.src_y, (0, 1))\n-        self.src.add_aux_coord(self.src_x_positive, (0, 1))\n-        self.src.data[([1, 2, 2], [3, 0, 2])] = ma.masked\n-        self.grid.add_dim_coord(self.grid_y_inc, 0)\n-        self.grid.add_dim_coord(self.grid_x_inc, 1)\n+    def test_non_latlon(self):\n+        odd_coord_system = LambertConformal()\n+        co_src_y = AuxCoord(self.src_y.points,\n+                            standard_name='projection_y_coordinate',\n+                            units='km',\n+                            coord_system=odd_coord_system)\n+        co_src_x = AuxCoord(self.src_x_positive.points,\n+                            standard_name='projection_x_coordinate',\n+                            units='km',\n+                            coord_system=odd_coord_system)\n+        co_grid_y = DimCoord(self.grid_y_inc.points,\n+                             bounds=self.grid_y_inc.bounds,\n+                             standard_name='projection_y_coordinate',\n+                             units='km',\n+                             coord_system=odd_coord_system)\n+        co_grid_x = DimCoord(self.grid_x_inc.points,\n+                             bounds=self.grid_x_inc.bounds,\n+                             standard_name='projection_x_coordinate',\n+                             units='km',\n+                             coord_system=odd_coord_system)\n+        self.src.add_aux_coord(co_src_y, (0, 1))\n+        self.src.add_aux_coord(co_src_x, (0, 1))\n+        self.grid.add_dim_coord(co_grid_y, 0)\n+        self.grid.add_dim_coord(co_grid_x, 1)\n         result = regrid(self.src, self.weights, self.grid)\n         data = np.array([0,\n                          self._weighted_mean([3]),\n-                         self._weighted_mean([7]),\n-                         self._weighted_mean([10])]).reshape(2, 2)\n+                         self._weighted_mean([7, 8]),\n+                         self._weighted_mean([9, 10, 11])]).reshape(2, 2)\n         expected = self._expected_cube(data)\n         self.assertEqual(result, expected)\n         mask = np.array([[True, False], [False, False]])\n         self.assertArrayEqual(result.data.mask, mask)\n \n-    def test_aligned_src_x_zero_weights(self):\n-        self.src.add_aux_coord(self.src_y, (0, 1))\n-        self.src.add_aux_coord(self.src_x_positive, (0, 1))\n+    def test_src_xy_not_2d(self):\n+        new_shape = (2, 2, 3)\n+        # Reshape the source cube, including the X and Y coordinates,\n+        # from (3, 4) to (2, 2, 3).\n+        # This is really an \"invalid\" reshape, but should still work because\n+        # the XY shape is actually irrelevant to the regrid operation.\n+        src = iris.cube.Cube(\n+            self.test_src_data.reshape(new_shape),\n+            standard_name=self.test_src_name,\n+            units=self.test_src_units,\n+            aux_coords_and_dims=[(self.test_scalar_coord, None)],\n+            attributes=self.test_src_attributes)\n+        co_src_y = self.src_y.copy(\n+            points=self.src_y.points.reshape(new_shape))\n+        co_src_x = self.src_x_positive.copy(\n+            points=self.src_x_positive.points.reshape(new_shape))\n+        src.add_aux_coord(co_src_y, (0, 1, 2))\n+        src.add_aux_coord(co_src_x, (0, 1, 2))\n         self.grid.add_dim_coord(self.grid_y_inc, 0)\n         self.grid.add_dim_coord(self.grid_x_inc, 1)\n-        self.weights[:, 2] = 0\n-        self.weights[1, :] = 0\n-        result = regrid(self.src, self.weights, self.grid)\n-        data = np.array([0, 0, 0, self._weighted_mean([9, 10])]).reshape(2, 2)\n+        weights = self.weights.reshape(new_shape)\n+        result = regrid(src, weights, self.grid)\n+        # NOTE: set the grid of self.src to make '_expected_cube' work ...\n+        self.src.add_aux_coord(self.src_y, (0, 1))\n+        self.src.add_aux_coord(self.src_x_positive, (0, 1))\n+        # ... given that, we expect exactly the same 'normal' result.\n+        data = np.array([0,\n+                         self._weighted_mean([3]),\n+                         self._weighted_mean([7, 8]),\n+                         self._weighted_mean([9, 10, 11])]).reshape(2, 2)\n         expected = self._expected_cube(data)\n         self.assertEqual(result, expected)\n-        mask = np.array([[True, True], [True, False]])\n+        mask = np.array([[True, False], [False, False]])","path":"lib/iris/tests/unit/experimental/regrid/test_regrid_weighted_curvilinear_to_rectilinear.py","position":257,"original_position":257,"commit_id":"edbfbfc8de8e9da202a9285acc08ec377f5f1bac","original_commit_id":"edbfbfc8de8e9da202a9285acc08ec377f5f1bac","user":{"login":"dkillick","id":3473068,"avatar_url":"https://avatars.githubusercontent.com/u/3473068?v=3","gravatar_id":"","url":"https://api.github.com/users/dkillick","html_url":"https://github.com/dkillick","followers_url":"https://api.github.com/users/dkillick/followers","following_url":"https://api.github.com/users/dkillick/following{/other_user}","gists_url":"https://api.github.com/users/dkillick/gists{/gist_id}","starred_url":"https://api.github.com/users/dkillick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkillick/subscriptions","organizations_url":"https://api.github.com/users/dkillick/orgs","repos_url":"https://api.github.com/users/dkillick/repos","events_url":"https://api.github.com/users/dkillick/events{/privacy}","received_events_url":"https://api.github.com/users/dkillick/received_events","type":"User","site_admin":false},"body":"Why has this answer changed?","created_at":"2016-07-11T10:08:50Z","updated_at":"2016-07-11T10:08:50Z","html_url":"https://github.com/SciTools/iris/pull/2079#discussion_r70232064","pull_request_url":"https://api.github.com/repos/SciTools/iris/pulls/2079","_links":{"self":{"href":"https://api.github.com/repos/SciTools/iris/pulls/comments/70232064"},"html":{"href":"https://github.com/SciTools/iris/pull/2079#discussion_r70232064"},"pull_request":{"href":"https://api.github.com/repos/SciTools/iris/pulls/2079"}}},"pull_request":{"url":"https://api.github.com/repos/SciTools/iris/pulls/2079","id":76872805,"html_url":"https://github.com/SciTools/iris/pull/2079","diff_url":"https://github.com/SciTools/iris/pull/2079.diff","patch_url":"https://github.com/SciTools/iris/pull/2079.patch","issue_url":"https://api.github.com/repos/SciTools/iris/issues/2079","number":2079,"state":"open","locked":false,"title":"Extend point in cell","user":{"login":"pp-mo","id":2089069,"avatar_url":"https://avatars.githubusercontent.com/u/2089069?v=3","gravatar_id":"","url":"https://api.github.com/users/pp-mo","html_url":"https://github.com/pp-mo","followers_url":"https://api.github.com/users/pp-mo/followers","following_url":"https://api.github.com/users/pp-mo/following{/other_user}","gists_url":"https://api.github.com/users/pp-mo/gists{/gist_id}","starred_url":"https://api.github.com/users/pp-mo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pp-mo/subscriptions","organizations_url":"https://api.github.com/users/pp-mo/orgs","repos_url":"https://api.github.com/users/pp-mo/repos","events_url":"https://api.github.com/users/pp-mo/events{/privacy}","received_events_url":"https://api.github.com/users/pp-mo/received_events","type":"User","site_admin":false},"body":"Adapt PointInCell regridder to make it work for cross-coordinate-system regridding, including non-latlon systems.\r\n\r\nNOTE: this removes certain input requirements, but also adds some, so is not totally backwards-compatible :\r\n**requirements removed:**\r\n  * source and target must have the same coordinate system\r\n  * coord systems must be latlon\r\n  * source data X and Y coords must be 2d (can now have any dimensionality)\r\n\r\n**requirements added:**\r\n  * source and target must both have a **defined** coord-system\r\n    * previously 'None' was acceptable, but that is problematic now it isn't limited to latlon systems\r\n  * source data X and Y coordinates must now have **the same** cube dimensions\r\n    * previously they had to be 2d, and the same size, but could have different dimension ordering\r\n\r\n**I think these changes are acceptable, as it is experimental**\r\nIt basically *will* work for all existing cases, with just simple adaptations in certain cases","created_at":"2016-07-10T13:02:50Z","updated_at":"2016-07-11T10:08:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bb16af61b627ed74a947e0ddbb34d87c54c870dd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/SciTools/iris/pulls/2079/commits","review_comments_url":"https://api.github.com/repos/SciTools/iris/pulls/2079/comments","review_comment_url":"https://api.github.com/repos/SciTools/iris/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SciTools/iris/issues/2079/comments","statuses_url":"https://api.github.com/repos/SciTools/iris/statuses/edbfbfc8de8e9da202a9285acc08ec377f5f1bac","head":{"label":"pp-mo:extend_PointInCell","ref":"extend_PointInCell","sha":"edbfbfc8de8e9da202a9285acc08ec377f5f1bac","user":{"login":"pp-mo","id":2089069,"avatar_url":"https://avatars.githubusercontent.com/u/2089069?v=3","gravatar_id":"","url":"https://api.github.com/users/pp-mo","html_url":"https://github.com/pp-mo","followers_url":"https://api.github.com/users/pp-mo/followers","following_url":"https://api.github.com/users/pp-mo/following{/other_user}","gists_url":"https://api.github.com/users/pp-mo/gists{/gist_id}","starred_url":"https://api.github.com/users/pp-mo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pp-mo/subscriptions","organizations_url":"https://api.github.com/users/pp-mo/orgs","repos_url":"https://api.github.com/users/pp-mo/repos","events_url":"https://api.github.com/users/pp-mo/events{/privacy}","received_events_url":"https://api.github.com/users/pp-mo/received_events","type":"User","site_admin":false},"repo":{"id":5701421,"name":"iris","full_name":"pp-mo/iris","owner":{"login":"pp-mo","id":2089069,"avatar_url":"https://avatars.githubusercontent.com/u/2089069?v=3","gravatar_id":"","url":"https://api.github.com/users/pp-mo","html_url":"https://github.com/pp-mo","followers_url":"https://api.github.com/users/pp-mo/followers","following_url":"https://api.github.com/users/pp-mo/following{/other_user}","gists_url":"https://api.github.com/users/pp-mo/gists{/gist_id}","starred_url":"https://api.github.com/users/pp-mo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pp-mo/subscriptions","organizations_url":"https://api.github.com/users/pp-mo/orgs","repos_url":"https://api.github.com/users/pp-mo/repos","events_url":"https://api.github.com/users/pp-mo/events{/privacy}","received_events_url":"https://api.github.com/users/pp-mo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pp-mo/iris","description":"","fork":true,"url":"https://api.github.com/repos/pp-mo/iris","forks_url":"https://api.github.com/repos/pp-mo/iris/forks","keys_url":"https://api.github.com/repos/pp-mo/iris/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pp-mo/iris/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pp-mo/iris/teams","hooks_url":"https://api.github.com/repos/pp-mo/iris/hooks","issue_events_url":"https://api.github.com/repos/pp-mo/iris/issues/events{/number}","events_url":"https://api.github.com/repos/pp-mo/iris/events","assignees_url":"https://api.github.com/repos/pp-mo/iris/assignees{/user}","branches_url":"https://api.github.com/repos/pp-mo/iris/branches{/branch}","tags_url":"https://api.github.com/repos/pp-mo/iris/tags","blobs_url":"https://api.github.com/repos/pp-mo/iris/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pp-mo/iris/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pp-mo/iris/git/refs{/sha}","trees_url":"https://api.github.com/repos/pp-mo/iris/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pp-mo/iris/statuses/{sha}","languages_url":"https://api.github.com/repos/pp-mo/iris/languages","stargazers_url":"https://api.github.com/repos/pp-mo/iris/stargazers","contributors_url":"https://api.github.com/repos/pp-mo/iris/contributors","subscribers_url":"https://api.github.com/repos/pp-mo/iris/subscribers","subscription_url":"https://api.github.com/repos/pp-mo/iris/subscription","commits_url":"https://api.github.com/repos/pp-mo/iris/commits{/sha}","git_commits_url":"https://api.github.com/repos/pp-mo/iris/git/commits{/sha}","comments_url":"https://api.github.com/repos/pp-mo/iris/comments{/number}","issue_comment_url":"https://api.github.com/repos/pp-mo/iris/issues/comments{/number}","contents_url":"https://api.github.com/repos/pp-mo/iris/contents/{+path}","compare_url":"https://api.github.com/repos/pp-mo/iris/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pp-mo/iris/merges","archive_url":"https://api.github.com/repos/pp-mo/iris/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pp-mo/iris/downloads","issues_url":"https://api.github.com/repos/pp-mo/iris/issues{/number}","pulls_url":"https://api.github.com/repos/pp-mo/iris/pulls{/number}","milestones_url":"https://api.github.com/repos/pp-mo/iris/milestones{/number}","notifications_url":"https://api.github.com/repos/pp-mo/iris/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pp-mo/iris/labels{/name}","releases_url":"https://api.github.com/repos/pp-mo/iris/releases{/id}","deployments_url":"https://api.github.com/repos/pp-mo/iris/deployments","created_at":"2012-09-06T11:45:58Z","updated_at":"2015-04-25T22:15:43Z","pushed_at":"2016-07-10T17:25:40Z","git_url":"git://github.com/pp-mo/iris.git","ssh_url":"git@github.com:pp-mo/iris.git","clone_url":"https://github.com/pp-mo/iris.git","svn_url":"https://github.com/pp-mo/iris","homepage":"http://scitools.github.com/iris","size":102481,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"SciTools:master","ref":"master","sha":"4e2034ef08ff178b8ca01298b0725a5b6474b36b","user":{"login":"SciTools","id":1391487,"avatar_url":"https://avatars.githubusercontent.com/u/1391487?v=3","gravatar_id":"","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?v=3","gravatar_id":"","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}","deployments_url":"https://api.github.com/repos/SciTools/iris/deployments","created_at":"2012-08-06T10:09:14Z","updated_at":"2016-06-09T09:25:52Z","pushed_at":"2016-07-11T07:49:21Z","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":143054,"stargazers_count":130,"watchers_count":130,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":101,"mirror_url":null,"open_issues_count":235,"forks":101,"open_issues":235,"watchers":130,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SciTools/iris/pulls/2079"},"html":{"href":"https://github.com/SciTools/iris/pull/2079"},"issue":{"href":"https://api.github.com/repos/SciTools/iris/issues/2079"},"comments":{"href":"https://api.github.com/repos/SciTools/iris/issues/2079/comments"},"review_comments":{"href":"https://api.github.com/repos/SciTools/iris/pulls/2079/comments"},"review_comment":{"href":"https://api.github.com/repos/SciTools/iris/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SciTools/iris/pulls/2079/commits"},"statuses":{"href":"https://api.github.com/repos/SciTools/iris/statuses/edbfbfc8de8e9da202a9285acc08ec377f5f1bac"}}}}
{"actor":{"display_login":"dkillick"}}