{"action":"created","comment":{"url":"https://api.github.com/repos/scipy/scipy/pulls/comments/81264528","pull_request_review_id":2257267,"id":81264528,"diff_hunk":"@@ -902,6 +903,105 @@ def simplified(x):\n \n             yield check, name\n \n+class Test_HalfspaceIntersection(object):\n+    def assert_unordered_allclose(self, arr1, arr2, rtol=1e-7):\n+        \"\"\"Check that every line in arr1 is only once in arr2\"\"\"\n+        assert_equal(arr1.shape, arr2.shape)\n+\n+        truths = np.zeros((arr1.shape[0],), dtype=bool)\n+        for l1 in arr1:\n+            indexes = np.where((abs(arr2 - l1) < rtol).all(axis=1))[0]\n+            assert(indexes.shape == (1,))\n+            truths[indexes[0]] = True\n+        assert(truths.all())\n+\n+    def test_cube_halfspace_intersection(self):\n+        halfspaces = np.array([[-1.0, 0.0, 0.0],\n+                               [0.0, -1.0, 0.0],\n+                               [1.0, 0.0, -1.0],\n+                               [0.0, 1.0, -1.0]])\n+        feasible_point = np.array([0.5, 0.5])\n+\n+        points = np.array([[0.0, 1.0], [1.0, 1.0], [0.0, 0.0], [1.0, 0.0]])\n+\n+        hull = qhull.HalfspaceIntersection(halfspaces, feasible_point)\n+\n+        assert_allclose(points, hull.intersections)\n+\n+    def test_self_dual_polytope_intersection(self):\n+        fname = os.path.join(os.path.dirname(__file__), 'data',\n+                             'selfdual-4d-polytope.txt')\n+        ineqs = np.genfromtxt(fname)\n+        halfspaces = -np.hstack((ineqs[:, 1:], ineqs[:, :1]))\n+\n+        hs = qhull.HalfspaceIntersection(halfspaces, np.array([0., 0., 0., 0.]))\n+\n+        assert_equal(hs.intersections.shape, (24, 4))","path":"scipy/spatial/tests/test_qhull.py","position":45,"original_position":45,"commit_id":"8ff6704b841f1e06557e23436ac11dbaf46390da","original_commit_id":"8ff6704b841f1e06557e23436ac11dbaf46390da","user":{"login":"haudren","id":4352562,"avatar_url":"https://avatars.githubusercontent.com/u/4352562?v=3","gravatar_id":"","url":"https://api.github.com/users/haudren","html_url":"https://github.com/haudren","followers_url":"https://api.github.com/users/haudren/followers","following_url":"https://api.github.com/users/haudren/following{/other_user}","gists_url":"https://api.github.com/users/haudren/gists{/gist_id}","starred_url":"https://api.github.com/users/haudren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haudren/subscriptions","organizations_url":"https://api.github.com/users/haudren/orgs","repos_url":"https://api.github.com/users/haudren/repos","events_url":"https://api.github.com/users/haudren/events{/privacy}","received_events_url":"https://api.github.com/users/haudren/received_events","type":"User","site_admin":false},"body":"You are right, but I was mostly interested in the intersection points, I'll see what I can do about this.","created_at":"2016-09-30T01:02:39Z","updated_at":"2016-09-30T01:02:39Z","html_url":"https://github.com/scipy/scipy/pull/6448#discussion_r81264528","pull_request_url":"https://api.github.com/repos/scipy/scipy/pulls/6448","_links":{"self":{"href":"https://api.github.com/repos/scipy/scipy/pulls/comments/81264528"},"html":{"href":"https://github.com/scipy/scipy/pull/6448#discussion_r81264528"},"pull_request":{"href":"https://api.github.com/repos/scipy/scipy/pulls/6448"}}},"pull_request":{"url":"https://api.github.com/repos/scipy/scipy/pulls/6448","id":79675849,"html_url":"https://github.com/scipy/scipy/pull/6448","diff_url":"https://github.com/scipy/scipy/pull/6448.diff","patch_url":"https://github.com/scipy/scipy/pull/6448.patch","issue_url":"https://api.github.com/repos/scipy/scipy/issues/6448","number":6448,"state":"open","locked":false,"title":"ENH: Add halfspace mode to Qhull","user":{"login":"haudren","id":4352562,"avatar_url":"https://avatars.githubusercontent.com/u/4352562?v=3","gravatar_id":"","url":"https://api.github.com/users/haudren","html_url":"https://github.com/haudren","followers_url":"https://api.github.com/users/haudren/followers","following_url":"https://api.github.com/users/haudren/following{/other_user}","gists_url":"https://api.github.com/users/haudren/gists{/gist_id}","starred_url":"https://api.github.com/users/haudren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haudren/subscriptions","organizations_url":"https://api.github.com/users/haudren/orgs","repos_url":"https://api.github.com/users/haudren/repos","events_url":"https://api.github.com/users/haudren/events{/privacy}","received_events_url":"https://api.github.com/users/haudren/received_events","type":"User","site_admin":false},"body":"This pull request would add functionality to compute halfspace intersections using Qhull `H` mode (or equivalently, qhalf).\r\n\r\nThis is still a WIP as I do not have proper test coverage, but it seems to work.\r\n\r\nWe also need to prevent someone passing the `H` option to `ConvexHull`.\r\n\r\nMy biggest problem with this PR as it stands is how to feed the feasible point to Qhull: as the check is done in qh_new_qhull, there is no other way than passing it as a string in the mode option...\r\n\r\nThis would fix #6441 by providing a new interface to `H` mode.","created_at":"2016-08-02T04:52:55Z","updated_at":"2016-09-30T01:02:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6924d84c491a569e66b146e29e71201f85bdfd02","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/scipy/scipy/pulls/6448/commits","review_comments_url":"https://api.github.com/repos/scipy/scipy/pulls/6448/comments","review_comment_url":"https://api.github.com/repos/scipy/scipy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scipy/scipy/issues/6448/comments","statuses_url":"https://api.github.com/repos/scipy/scipy/statuses/8ff6704b841f1e06557e23436ac11dbaf46390da","head":{"label":"haudren:topic/addHalfspaceMode","ref":"topic/addHalfspaceMode","sha":"8ff6704b841f1e06557e23436ac11dbaf46390da","user":{"login":"haudren","id":4352562,"avatar_url":"https://avatars.githubusercontent.com/u/4352562?v=3","gravatar_id":"","url":"https://api.github.com/users/haudren","html_url":"https://github.com/haudren","followers_url":"https://api.github.com/users/haudren/followers","following_url":"https://api.github.com/users/haudren/following{/other_user}","gists_url":"https://api.github.com/users/haudren/gists{/gist_id}","starred_url":"https://api.github.com/users/haudren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haudren/subscriptions","organizations_url":"https://api.github.com/users/haudren/orgs","repos_url":"https://api.github.com/users/haudren/repos","events_url":"https://api.github.com/users/haudren/events{/privacy}","received_events_url":"https://api.github.com/users/haudren/received_events","type":"User","site_admin":false},"repo":{"id":38464591,"name":"scipy","full_name":"haudren/scipy","owner":{"login":"haudren","id":4352562,"avatar_url":"https://avatars.githubusercontent.com/u/4352562?v=3","gravatar_id":"","url":"https://api.github.com/users/haudren","html_url":"https://github.com/haudren","followers_url":"https://api.github.com/users/haudren/followers","following_url":"https://api.github.com/users/haudren/following{/other_user}","gists_url":"https://api.github.com/users/haudren/gists{/gist_id}","starred_url":"https://api.github.com/users/haudren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haudren/subscriptions","organizations_url":"https://api.github.com/users/haudren/orgs","repos_url":"https://api.github.com/users/haudren/repos","events_url":"https://api.github.com/users/haudren/events{/privacy}","received_events_url":"https://api.github.com/users/haudren/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/haudren/scipy","description":"Scipy library main repository","fork":true,"url":"https://api.github.com/repos/haudren/scipy","forks_url":"https://api.github.com/repos/haudren/scipy/forks","keys_url":"https://api.github.com/repos/haudren/scipy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/haudren/scipy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/haudren/scipy/teams","hooks_url":"https://api.github.com/repos/haudren/scipy/hooks","issue_events_url":"https://api.github.com/repos/haudren/scipy/issues/events{/number}","events_url":"https://api.github.com/repos/haudren/scipy/events","assignees_url":"https://api.github.com/repos/haudren/scipy/assignees{/user}","branches_url":"https://api.github.com/repos/haudren/scipy/branches{/branch}","tags_url":"https://api.github.com/repos/haudren/scipy/tags","blobs_url":"https://api.github.com/repos/haudren/scipy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/haudren/scipy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/haudren/scipy/git/refs{/sha}","trees_url":"https://api.github.com/repos/haudren/scipy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/haudren/scipy/statuses/{sha}","languages_url":"https://api.github.com/repos/haudren/scipy/languages","stargazers_url":"https://api.github.com/repos/haudren/scipy/stargazers","contributors_url":"https://api.github.com/repos/haudren/scipy/contributors","subscribers_url":"https://api.github.com/repos/haudren/scipy/subscribers","subscription_url":"https://api.github.com/repos/haudren/scipy/subscription","commits_url":"https://api.github.com/repos/haudren/scipy/commits{/sha}","git_commits_url":"https://api.github.com/repos/haudren/scipy/git/commits{/sha}","comments_url":"https://api.github.com/repos/haudren/scipy/comments{/number}","issue_comment_url":"https://api.github.com/repos/haudren/scipy/issues/comments{/number}","contents_url":"https://api.github.com/repos/haudren/scipy/contents/{+path}","compare_url":"https://api.github.com/repos/haudren/scipy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/haudren/scipy/merges","archive_url":"https://api.github.com/repos/haudren/scipy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/haudren/scipy/downloads","issues_url":"https://api.github.com/repos/haudren/scipy/issues{/number}","pulls_url":"https://api.github.com/repos/haudren/scipy/pulls{/number}","milestones_url":"https://api.github.com/repos/haudren/scipy/milestones{/number}","notifications_url":"https://api.github.com/repos/haudren/scipy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/haudren/scipy/labels{/name}","releases_url":"https://api.github.com/repos/haudren/scipy/releases{/id}","deployments_url":"https://api.github.com/repos/haudren/scipy/deployments","created_at":"2015-07-03T01:09:13Z","updated_at":"2016-08-01T05:08:41Z","pushed_at":"2016-08-23T05:55:33Z","git_url":"git://github.com/haudren/scipy.git","ssh_url":"git@github.com:haudren/scipy.git","clone_url":"https://github.com/haudren/scipy.git","svn_url":"https://github.com/haudren/scipy","homepage":"http://scipy.org/scipylib/","size":59109,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"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":"scipy:master","ref":"master","sha":"f144e982d06e41c24149f2b2923ad1b973c4b4b0","user":{"login":"scipy","id":288277,"avatar_url":"https://avatars.githubusercontent.com/u/288277?v=3","gravatar_id":"","url":"https://api.github.com/users/scipy","html_url":"https://github.com/scipy","followers_url":"https://api.github.com/users/scipy/followers","following_url":"https://api.github.com/users/scipy/following{/other_user}","gists_url":"https://api.github.com/users/scipy/gists{/gist_id}","starred_url":"https://api.github.com/users/scipy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scipy/subscriptions","organizations_url":"https://api.github.com/users/scipy/orgs","repos_url":"https://api.github.com/users/scipy/repos","events_url":"https://api.github.com/users/scipy/events{/privacy}","received_events_url":"https://api.github.com/users/scipy/received_events","type":"Organization","site_admin":false},"repo":{"id":1460385,"name":"scipy","full_name":"scipy/scipy","owner":{"login":"scipy","id":288277,"avatar_url":"https://avatars.githubusercontent.com/u/288277?v=3","gravatar_id":"","url":"https://api.github.com/users/scipy","html_url":"https://github.com/scipy","followers_url":"https://api.github.com/users/scipy/followers","following_url":"https://api.github.com/users/scipy/following{/other_user}","gists_url":"https://api.github.com/users/scipy/gists{/gist_id}","starred_url":"https://api.github.com/users/scipy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scipy/subscriptions","organizations_url":"https://api.github.com/users/scipy/orgs","repos_url":"https://api.github.com/users/scipy/repos","events_url":"https://api.github.com/users/scipy/events{/privacy}","received_events_url":"https://api.github.com/users/scipy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scipy/scipy","description":"Scipy library main repository","fork":false,"url":"https://api.github.com/repos/scipy/scipy","forks_url":"https://api.github.com/repos/scipy/scipy/forks","keys_url":"https://api.github.com/repos/scipy/scipy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scipy/scipy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scipy/scipy/teams","hooks_url":"https://api.github.com/repos/scipy/scipy/hooks","issue_events_url":"https://api.github.com/repos/scipy/scipy/issues/events{/number}","events_url":"https://api.github.com/repos/scipy/scipy/events","assignees_url":"https://api.github.com/repos/scipy/scipy/assignees{/user}","branches_url":"https://api.github.com/repos/scipy/scipy/branches{/branch}","tags_url":"https://api.github.com/repos/scipy/scipy/tags","blobs_url":"https://api.github.com/repos/scipy/scipy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scipy/scipy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scipy/scipy/git/refs{/sha}","trees_url":"https://api.github.com/repos/scipy/scipy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scipy/scipy/statuses/{sha}","languages_url":"https://api.github.com/repos/scipy/scipy/languages","stargazers_url":"https://api.github.com/repos/scipy/scipy/stargazers","contributors_url":"https://api.github.com/repos/scipy/scipy/contributors","subscribers_url":"https://api.github.com/repos/scipy/scipy/subscribers","subscription_url":"https://api.github.com/repos/scipy/scipy/subscription","commits_url":"https://api.github.com/repos/scipy/scipy/commits{/sha}","git_commits_url":"https://api.github.com/repos/scipy/scipy/git/commits{/sha}","comments_url":"https://api.github.com/repos/scipy/scipy/comments{/number}","issue_comment_url":"https://api.github.com/repos/scipy/scipy/issues/comments{/number}","contents_url":"https://api.github.com/repos/scipy/scipy/contents/{+path}","compare_url":"https://api.github.com/repos/scipy/scipy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scipy/scipy/merges","archive_url":"https://api.github.com/repos/scipy/scipy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scipy/scipy/downloads","issues_url":"https://api.github.com/repos/scipy/scipy/issues{/number}","pulls_url":"https://api.github.com/repos/scipy/scipy/pulls{/number}","milestones_url":"https://api.github.com/repos/scipy/scipy/milestones{/number}","notifications_url":"https://api.github.com/repos/scipy/scipy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scipy/scipy/labels{/name}","releases_url":"https://api.github.com/repos/scipy/scipy/releases{/id}","deployments_url":"https://api.github.com/repos/scipy/scipy/deployments","created_at":"2011-03-09T18:52:03Z","updated_at":"2016-09-29T17:56:51Z","pushed_at":"2016-09-29T22:43:46Z","git_url":"git://github.com/scipy/scipy.git","ssh_url":"git@github.com:scipy/scipy.git","clone_url":"https://github.com/scipy/scipy.git","svn_url":"https://github.com/scipy/scipy","homepage":"http://scipy.org/scipylib/","size":78604,"stargazers_count":2603,"watchers_count":2603,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1516,"mirror_url":null,"open_issues_count":960,"forks":1516,"open_issues":960,"watchers":2603,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scipy/scipy/pulls/6448"},"html":{"href":"https://github.com/scipy/scipy/pull/6448"},"issue":{"href":"https://api.github.com/repos/scipy/scipy/issues/6448"},"comments":{"href":"https://api.github.com/repos/scipy/scipy/issues/6448/comments"},"review_comments":{"href":"https://api.github.com/repos/scipy/scipy/pulls/6448/comments"},"review_comment":{"href":"https://api.github.com/repos/scipy/scipy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scipy/scipy/pulls/6448/commits"},"statuses":{"href":"https://api.github.com/repos/scipy/scipy/statuses/8ff6704b841f1e06557e23436ac11dbaf46390da"}}}}
{"actor":{"display_login":"haudren"}}