{"action":"opened","number":7254,"pull_request":{"url":"https://api.github.com/repos/scipy/scipy/pulls/7254","id":114024197,"html_url":"https://github.com/scipy/scipy/pull/7254","diff_url":"https://github.com/scipy/scipy/pull/7254.diff","patch_url":"https://github.com/scipy/scipy/pull/7254.patch","issue_url":"https://api.github.com/repos/scipy/scipy/issues/7254","number":7254,"state":"open","locked":false,"title":"ENH: SphericalVoronoi Input Handling","user":{"login":"tylerjereddy","id":7903078,"avatar_url":"https://avatars3.githubusercontent.com/u/7903078?v=3","gravatar_id":"","url":"https://api.github.com/users/tylerjereddy","html_url":"https://github.com/tylerjereddy","followers_url":"https://api.github.com/users/tylerjereddy/followers","following_url":"https://api.github.com/users/tylerjereddy/following{/other_user}","gists_url":"https://api.github.com/users/tylerjereddy/gists{/gist_id}","starred_url":"https://api.github.com/users/tylerjereddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tylerjereddy/subscriptions","organizations_url":"https://api.github.com/users/tylerjereddy/orgs","repos_url":"https://api.github.com/users/tylerjereddy/repos","events_url":"https://api.github.com/users/tylerjereddy/events{/privacy}","received_events_url":"https://api.github.com/users/tylerjereddy/received_events","type":"User","site_admin":false},"body":"Although issue #7046 didn't actually reveal any algorithm-level bugs in `SphericalVoronoi`, there was a suggestion to check the input points (generators) more thoroughly with respect to the input radius, and the original problem was that the user had degenerate input (duplicate generators).\r\n\r\nThis PR drafts a possible set of checks / exceptions raised for these two user input-related issues, along with the corresponding unit tests and documentation updates for the `Raises` section of `SphericalVoronoi`.\r\n\r\nConsiderations / Questions\r\n---------------------------\r\n1. `Voronoi` handles degenerate input silently -- i.e., the user is not notified that they have duplicate points using the default arguments / `Qhull` flags, and `Qhull` appears to take care of this (probably by removing the duplicate generators). Since my solution with `SphericalVoronoi` is to raise an exception with degenerate input, would we consider this presenting the user with an \"inconsistent interface\" in `scipy.spatial`? I think there's something to be said for explicit notification that you have duplicates in your input, but I may just be trying to avoid the extra work involved in removing them. If we do decide to go the duplicate-removal route instead of what I've done here, I suspect that is something that we'd want to abstract outside of `SphericalVoronoi`--many computational geometry algorithms do not tolerate degenerate input. \r\n\r\n2. An additional consideration is that the algorithm may not be able to tolerate points that are extremely close together (i.e., `d = 0.000000000000001`). Currently, `d = 0` is required to raise the exception--do we want to carefully check the floating point limit for degeneracy / proximity and use that instead of `0` proper? \r\n\r\n3. My changes introduce two identical `pidst` operations--I'm not sure we gain all that much by this--I was trying to avoid storing the condensed matrix in a variable in case that might alleviate space complexity issues for huge data sets, but this may actually not help at all and simply add to the calculation time? If so, we'd just switch to one `pdist` calculation, store the result in a variable, and take the `max()` and `min()` of the condensed distance matrix for the two input checks introduced here.\r\n\r\n4. Note that the `radius` value check only works for cases where the generators are far enough part that the `radius` can't possibly be correct. The reverse determination (the `radius` is too big) would be more challenging since the user may only provide a subset of the points on the sphere, and we can't easily know for sure if we are i.e., just looking at points restricted to a subregion of the sphere for which the true diameter is never approached in a distance matrix.\r\n\r\n","created_at":"2017-04-03T21:13:08Z","updated_at":"2017-04-03T21:13:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/scipy/scipy/pulls/7254/commits","review_comments_url":"https://api.github.com/repos/scipy/scipy/pulls/7254/comments","review_comment_url":"https://api.github.com/repos/scipy/scipy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scipy/scipy/issues/7254/comments","statuses_url":"https://api.github.com/repos/scipy/scipy/statuses/e7d96795e69c0f0d30361632f703c2069a8d4dac","head":{"label":"tylerjereddy:issue_7046_sph_vor_input_handling","ref":"issue_7046_sph_vor_input_handling","sha":"e7d96795e69c0f0d30361632f703c2069a8d4dac","user":{"login":"tylerjereddy","id":7903078,"avatar_url":"https://avatars3.githubusercontent.com/u/7903078?v=3","gravatar_id":"","url":"https://api.github.com/users/tylerjereddy","html_url":"https://github.com/tylerjereddy","followers_url":"https://api.github.com/users/tylerjereddy/followers","following_url":"https://api.github.com/users/tylerjereddy/following{/other_user}","gists_url":"https://api.github.com/users/tylerjereddy/gists{/gist_id}","starred_url":"https://api.github.com/users/tylerjereddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tylerjereddy/subscriptions","organizations_url":"https://api.github.com/users/tylerjereddy/orgs","repos_url":"https://api.github.com/users/tylerjereddy/repos","events_url":"https://api.github.com/users/tylerjereddy/events{/privacy}","received_events_url":"https://api.github.com/users/tylerjereddy/received_events","type":"User","site_admin":false},"repo":{"id":41598782,"name":"scipy","full_name":"tylerjereddy/scipy","owner":{"login":"tylerjereddy","id":7903078,"avatar_url":"https://avatars3.githubusercontent.com/u/7903078?v=3","gravatar_id":"","url":"https://api.github.com/users/tylerjereddy","html_url":"https://github.com/tylerjereddy","followers_url":"https://api.github.com/users/tylerjereddy/followers","following_url":"https://api.github.com/users/tylerjereddy/following{/other_user}","gists_url":"https://api.github.com/users/tylerjereddy/gists{/gist_id}","starred_url":"https://api.github.com/users/tylerjereddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tylerjereddy/subscriptions","organizations_url":"https://api.github.com/users/tylerjereddy/orgs","repos_url":"https://api.github.com/users/tylerjereddy/repos","events_url":"https://api.github.com/users/tylerjereddy/events{/privacy}","received_events_url":"https://api.github.com/users/tylerjereddy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tylerjereddy/scipy","description":"Scipy library main repository","fork":true,"url":"https://api.github.com/repos/tylerjereddy/scipy","forks_url":"https://api.github.com/repos/tylerjereddy/scipy/forks","keys_url":"https://api.github.com/repos/tylerjereddy/scipy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tylerjereddy/scipy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tylerjereddy/scipy/teams","hooks_url":"https://api.github.com/repos/tylerjereddy/scipy/hooks","issue_events_url":"https://api.github.com/repos/tylerjereddy/scipy/issues/events{/number}","events_url":"https://api.github.com/repos/tylerjereddy/scipy/events","assignees_url":"https://api.github.com/repos/tylerjereddy/scipy/assignees{/user}","branches_url":"https://api.github.com/repos/tylerjereddy/scipy/branches{/branch}","tags_url":"https://api.github.com/repos/tylerjereddy/scipy/tags","blobs_url":"https://api.github.com/repos/tylerjereddy/scipy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tylerjereddy/scipy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tylerjereddy/scipy/git/refs{/sha}","trees_url":"https://api.github.com/repos/tylerjereddy/scipy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tylerjereddy/scipy/statuses/{sha}","languages_url":"https://api.github.com/repos/tylerjereddy/scipy/languages","stargazers_url":"https://api.github.com/repos/tylerjereddy/scipy/stargazers","contributors_url":"https://api.github.com/repos/tylerjereddy/scipy/contributors","subscribers_url":"https://api.github.com/repos/tylerjereddy/scipy/subscribers","subscription_url":"https://api.github.com/repos/tylerjereddy/scipy/subscription","commits_url":"https://api.github.com/repos/tylerjereddy/scipy/commits{/sha}","git_commits_url":"https://api.github.com/repos/tylerjereddy/scipy/git/commits{/sha}","comments_url":"https://api.github.com/repos/tylerjereddy/scipy/comments{/number}","issue_comment_url":"https://api.github.com/repos/tylerjereddy/scipy/issues/comments{/number}","contents_url":"https://api.github.com/repos/tylerjereddy/scipy/contents/{+path}","compare_url":"https://api.github.com/repos/tylerjereddy/scipy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tylerjereddy/scipy/merges","archive_url":"https://api.github.com/repos/tylerjereddy/scipy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tylerjereddy/scipy/downloads","issues_url":"https://api.github.com/repos/tylerjereddy/scipy/issues{/number}","pulls_url":"https://api.github.com/repos/tylerjereddy/scipy/pulls{/number}","milestones_url":"https://api.github.com/repos/tylerjereddy/scipy/milestones{/number}","notifications_url":"https://api.github.com/repos/tylerjereddy/scipy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tylerjereddy/scipy/labels{/name}","releases_url":"https://api.github.com/repos/tylerjereddy/scipy/releases{/id}","deployments_url":"https://api.github.com/repos/tylerjereddy/scipy/deployments","created_at":"2015-08-29T15:59:44Z","updated_at":"2016-02-16T17:31:23Z","pushed_at":"2017-04-03T20:42:18Z","git_url":"git://github.com/tylerjereddy/scipy.git","ssh_url":"git@github.com:tylerjereddy/scipy.git","clone_url":"https://github.com/tylerjereddy/scipy.git","svn_url":"https://github.com/tylerjereddy/scipy","homepage":"http://scipy.org/scipylib/","size":57793,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"scipy:master","ref":"master","sha":"ab9eff32ef594a59621404ffe18045fd6bd49e1f","user":{"login":"scipy","id":288277,"avatar_url":"https://avatars1.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://avatars1.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":"2017-04-03T12:06:30Z","pushed_at":"2017-04-03T18:01:43Z","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":66809,"stargazers_count":2991,"watchers_count":2991,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1740,"mirror_url":null,"open_issues_count":998,"forks":1740,"open_issues":998,"watchers":2991,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scipy/scipy/pulls/7254"},"html":{"href":"https://github.com/scipy/scipy/pull/7254"},"issue":{"href":"https://api.github.com/repos/scipy/scipy/issues/7254"},"comments":{"href":"https://api.github.com/repos/scipy/scipy/issues/7254/comments"},"review_comments":{"href":"https://api.github.com/repos/scipy/scipy/pulls/7254/comments"},"review_comment":{"href":"https://api.github.com/repos/scipy/scipy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scipy/scipy/pulls/7254/commits"},"statuses":{"href":"https://api.github.com/repos/scipy/scipy/statuses/e7d96795e69c0f0d30361632f703c2069a8d4dac"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":3,"additions":29,"deletions":1,"changed_files":2}}
{"actor":{"display_login":"tylerjereddy"}}