{"action":"created","comment":{"url":"https://api.github.com/repos/SciTools/cartopy/pulls/comments/47050254","id":47050254,"diff_hunk":"@@ -585,7 +585,18 @@ def set_extent(self, extents, crs=None):\n \n         if projected is None:\n             projected = self.projection.project_geometry(domain_in_crs, crs)\n-        x1, y1, x2, y2 = projected.bounds\n+        try:\n+            # This might fail with an unhelpful error message ('need more\n+            # than 0 values to unpack') if the specified extents fall outside\n+            # the projection extents, so try and give a better error message.\n+            x1, y1, x2, y2 = projected.bounds","path":"lib/cartopy/mpl/geoaxes.py","position":9,"original_position":9,"commit_id":"4513d3aec2d825df0c270acc9b0b6363dae34503","original_commit_id":"4513d3aec2d825df0c270acc9b0b6363dae34503","user":{"login":"pelson","id":810663,"avatar_url":"https://avatars.githubusercontent.com/u/810663?v=3","gravatar_id":"","url":"https://api.github.com/users/pelson","html_url":"https://github.com/pelson","followers_url":"https://api.github.com/users/pelson/followers","following_url":"https://api.github.com/users/pelson/following{/other_user}","gists_url":"https://api.github.com/users/pelson/gists{/gist_id}","starred_url":"https://api.github.com/users/pelson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pelson/subscriptions","organizations_url":"https://api.github.com/users/pelson/orgs","repos_url":"https://api.github.com/users/pelson/repos","events_url":"https://api.github.com/users/pelson/events{/privacy}","received_events_url":"https://api.github.com/users/pelson/received_events","type":"User","site_admin":false},"body":"What is ``projected.bounds`` when the error message occurs? Is it just an empty list? If so, we can just test for it upfront. That way, if we get any real ValueErrors, we don't lose that detail.","created_at":"2015-12-09T04:26:09Z","updated_at":"2015-12-09T04:26:09Z","html_url":"https://github.com/SciTools/cartopy/pull/704#discussion_r47050254","pull_request_url":"https://api.github.com/repos/SciTools/cartopy/pulls/704","_links":{"self":{"href":"https://api.github.com/repos/SciTools/cartopy/pulls/comments/47050254"},"html":{"href":"https://github.com/SciTools/cartopy/pull/704#discussion_r47050254"},"pull_request":{"href":"https://api.github.com/repos/SciTools/cartopy/pulls/704"}}},"pull_request":{"url":"https://api.github.com/repos/SciTools/cartopy/pulls/704","id":52388941,"html_url":"https://github.com/SciTools/cartopy/pull/704","diff_url":"https://github.com/SciTools/cartopy/pull/704.diff","patch_url":"https://github.com/SciTools/cartopy/pull/704.patch","issue_url":"https://api.github.com/repos/SciTools/cartopy/issues/704","number":704,"state":"open","locked":false,"title":"Improve error message from setting an invalid extent.","user":{"login":"ajdawson","id":390602,"avatar_url":"https://avatars.githubusercontent.com/u/390602?v=3","gravatar_id":"","url":"https://api.github.com/users/ajdawson","html_url":"https://github.com/ajdawson","followers_url":"https://api.github.com/users/ajdawson/followers","following_url":"https://api.github.com/users/ajdawson/following{/other_user}","gists_url":"https://api.github.com/users/ajdawson/gists{/gist_id}","starred_url":"https://api.github.com/users/ajdawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajdawson/subscriptions","organizations_url":"https://api.github.com/users/ajdawson/orgs","repos_url":"https://api.github.com/users/ajdawson/repos","events_url":"https://api.github.com/users/ajdawson/events{/privacy}","received_events_url":"https://api.github.com/users/ajdawson/received_events","type":"User","site_admin":false},"body":"If you do try and use `GeoAxes.set_extent` and specify values outside the exent of the axes projection, the method may internally generate an empty geometry with no bounds, which will generate an unhelpful error message to the end-user referring to unpacking a tuple. This PR simply catches this `ValueError` exception and raises a new `ValueError` with a more appropriate error message. See #703 for background.\r\n\r\nI'm not sure if this is the best way to approach this, the original issue #703 might be more complex than I have accounted for.\r\n\r\nI've targeted v0.13.x, since this could be thought of as a bug fix.","created_at":"2015-12-02T12:24:10Z","updated_at":"2015-12-09T04:26:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2fb9baf7d80dd4006ed78563c1c9fa94180996e0","assignee":null,"milestone":{"url":"https://api.github.com/repos/SciTools/cartopy/milestones/17","html_url":"https://github.com/SciTools/cartopy/milestones/0.13.1","labels_url":"https://api.github.com/repos/SciTools/cartopy/milestones/17/labels","id":1374707,"number":17,"title":"0.13.1","description":"","creator":{"login":"QuLogic","id":302469,"avatar_url":"https://avatars.githubusercontent.com/u/302469?v=3","gravatar_id":"","url":"https://api.github.com/users/QuLogic","html_url":"https://github.com/QuLogic","followers_url":"https://api.github.com/users/QuLogic/followers","following_url":"https://api.github.com/users/QuLogic/following{/other_user}","gists_url":"https://api.github.com/users/QuLogic/gists{/gist_id}","starred_url":"https://api.github.com/users/QuLogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QuLogic/subscriptions","organizations_url":"https://api.github.com/users/QuLogic/orgs","repos_url":"https://api.github.com/users/QuLogic/repos","events_url":"https://api.github.com/users/QuLogic/events{/privacy}","received_events_url":"https://api.github.com/users/QuLogic/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":2,"state":"open","created_at":"2015-10-25T05:45:16Z","updated_at":"2015-12-02T21:00:19Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/SciTools/cartopy/pulls/704/commits","review_comments_url":"https://api.github.com/repos/SciTools/cartopy/pulls/704/comments","review_comment_url":"https://api.github.com/repos/SciTools/cartopy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SciTools/cartopy/issues/704/comments","statuses_url":"https://api.github.com/repos/SciTools/cartopy/statuses/4513d3aec2d825df0c270acc9b0b6363dae34503","head":{"label":"ajdawson:set-extent-exception","ref":"set-extent-exception","sha":"4513d3aec2d825df0c270acc9b0b6363dae34503","user":{"login":"ajdawson","id":390602,"avatar_url":"https://avatars.githubusercontent.com/u/390602?v=3","gravatar_id":"","url":"https://api.github.com/users/ajdawson","html_url":"https://github.com/ajdawson","followers_url":"https://api.github.com/users/ajdawson/followers","following_url":"https://api.github.com/users/ajdawson/following{/other_user}","gists_url":"https://api.github.com/users/ajdawson/gists{/gist_id}","starred_url":"https://api.github.com/users/ajdawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajdawson/subscriptions","organizations_url":"https://api.github.com/users/ajdawson/orgs","repos_url":"https://api.github.com/users/ajdawson/repos","events_url":"https://api.github.com/users/ajdawson/events{/privacy}","received_events_url":"https://api.github.com/users/ajdawson/received_events","type":"User","site_admin":false},"repo":{"id":7470964,"name":"cartopy","full_name":"ajdawson/cartopy","owner":{"login":"ajdawson","id":390602,"avatar_url":"https://avatars.githubusercontent.com/u/390602?v=3","gravatar_id":"","url":"https://api.github.com/users/ajdawson","html_url":"https://github.com/ajdawson","followers_url":"https://api.github.com/users/ajdawson/followers","following_url":"https://api.github.com/users/ajdawson/following{/other_user}","gists_url":"https://api.github.com/users/ajdawson/gists{/gist_id}","starred_url":"https://api.github.com/users/ajdawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajdawson/subscriptions","organizations_url":"https://api.github.com/users/ajdawson/orgs","repos_url":"https://api.github.com/users/ajdawson/repos","events_url":"https://api.github.com/users/ajdawson/events{/privacy}","received_events_url":"https://api.github.com/users/ajdawson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ajdawson/cartopy","description":"Cartopy - a cartographic python library with matplotlib support","fork":true,"url":"https://api.github.com/repos/ajdawson/cartopy","forks_url":"https://api.github.com/repos/ajdawson/cartopy/forks","keys_url":"https://api.github.com/repos/ajdawson/cartopy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ajdawson/cartopy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ajdawson/cartopy/teams","hooks_url":"https://api.github.com/repos/ajdawson/cartopy/hooks","issue_events_url":"https://api.github.com/repos/ajdawson/cartopy/issues/events{/number}","events_url":"https://api.github.com/repos/ajdawson/cartopy/events","assignees_url":"https://api.github.com/repos/ajdawson/cartopy/assignees{/user}","branches_url":"https://api.github.com/repos/ajdawson/cartopy/branches{/branch}","tags_url":"https://api.github.com/repos/ajdawson/cartopy/tags","blobs_url":"https://api.github.com/repos/ajdawson/cartopy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ajdawson/cartopy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ajdawson/cartopy/git/refs{/sha}","trees_url":"https://api.github.com/repos/ajdawson/cartopy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ajdawson/cartopy/statuses/{sha}","languages_url":"https://api.github.com/repos/ajdawson/cartopy/languages","stargazers_url":"https://api.github.com/repos/ajdawson/cartopy/stargazers","contributors_url":"https://api.github.com/repos/ajdawson/cartopy/contributors","subscribers_url":"https://api.github.com/repos/ajdawson/cartopy/subscribers","subscription_url":"https://api.github.com/repos/ajdawson/cartopy/subscription","commits_url":"https://api.github.com/repos/ajdawson/cartopy/commits{/sha}","git_commits_url":"https://api.github.com/repos/ajdawson/cartopy/git/commits{/sha}","comments_url":"https://api.github.com/repos/ajdawson/cartopy/comments{/number}","issue_comment_url":"https://api.github.com/repos/ajdawson/cartopy/issues/comments{/number}","contents_url":"https://api.github.com/repos/ajdawson/cartopy/contents/{+path}","compare_url":"https://api.github.com/repos/ajdawson/cartopy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ajdawson/cartopy/merges","archive_url":"https://api.github.com/repos/ajdawson/cartopy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ajdawson/cartopy/downloads","issues_url":"https://api.github.com/repos/ajdawson/cartopy/issues{/number}","pulls_url":"https://api.github.com/repos/ajdawson/cartopy/pulls{/number}","milestones_url":"https://api.github.com/repos/ajdawson/cartopy/milestones{/number}","notifications_url":"https://api.github.com/repos/ajdawson/cartopy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ajdawson/cartopy/labels{/name}","releases_url":"https://api.github.com/repos/ajdawson/cartopy/releases{/id}","created_at":"2013-01-06T18:20:45Z","updated_at":"2014-07-09T17:24:20Z","pushed_at":"2015-12-02T12:15:24Z","git_url":"git://github.com/ajdawson/cartopy.git","ssh_url":"git@github.com:ajdawson/cartopy.git","clone_url":"https://github.com/ajdawson/cartopy.git","svn_url":"https://github.com/ajdawson/cartopy","homepage":"http://scitools.org.uk/cartopy/","size":34496,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SciTools:v0.13.x","ref":"v0.13.x","sha":"fc5fb8fd14c5262156a7d1d174898a21ffae9ce4","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":5282596,"name":"cartopy","full_name":"SciTools/cartopy","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/cartopy","description":"Cartopy - a cartographic python library with matplotlib support","fork":false,"url":"https://api.github.com/repos/SciTools/cartopy","forks_url":"https://api.github.com/repos/SciTools/cartopy/forks","keys_url":"https://api.github.com/repos/SciTools/cartopy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SciTools/cartopy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SciTools/cartopy/teams","hooks_url":"https://api.github.com/repos/SciTools/cartopy/hooks","issue_events_url":"https://api.github.com/repos/SciTools/cartopy/issues/events{/number}","events_url":"https://api.github.com/repos/SciTools/cartopy/events","assignees_url":"https://api.github.com/repos/SciTools/cartopy/assignees{/user}","branches_url":"https://api.github.com/repos/SciTools/cartopy/branches{/branch}","tags_url":"https://api.github.com/repos/SciTools/cartopy/tags","blobs_url":"https://api.github.com/repos/SciTools/cartopy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SciTools/cartopy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SciTools/cartopy/git/refs{/sha}","trees_url":"https://api.github.com/repos/SciTools/cartopy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SciTools/cartopy/statuses/{sha}","languages_url":"https://api.github.com/repos/SciTools/cartopy/languages","stargazers_url":"https://api.github.com/repos/SciTools/cartopy/stargazers","contributors_url":"https://api.github.com/repos/SciTools/cartopy/contributors","subscribers_url":"https://api.github.com/repos/SciTools/cartopy/subscribers","subscription_url":"https://api.github.com/repos/SciTools/cartopy/subscription","commits_url":"https://api.github.com/repos/SciTools/cartopy/commits{/sha}","git_commits_url":"https://api.github.com/repos/SciTools/cartopy/git/commits{/sha}","comments_url":"https://api.github.com/repos/SciTools/cartopy/comments{/number}","issue_comment_url":"https://api.github.com/repos/SciTools/cartopy/issues/comments{/number}","contents_url":"https://api.github.com/repos/SciTools/cartopy/contents/{+path}","compare_url":"https://api.github.com/repos/SciTools/cartopy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SciTools/cartopy/merges","archive_url":"https://api.github.com/repos/SciTools/cartopy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SciTools/cartopy/downloads","issues_url":"https://api.github.com/repos/SciTools/cartopy/issues{/number}","pulls_url":"https://api.github.com/repos/SciTools/cartopy/pulls{/number}","milestones_url":"https://api.github.com/repos/SciTools/cartopy/milestones{/number}","notifications_url":"https://api.github.com/repos/SciTools/cartopy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SciTools/cartopy/labels{/name}","releases_url":"https://api.github.com/repos/SciTools/cartopy/releases{/id}","created_at":"2012-08-03T07:43:59Z","updated_at":"2015-12-04T17:31:23Z","pushed_at":"2015-12-02T12:24:10Z","git_url":"git://github.com/SciTools/cartopy.git","ssh_url":"git@github.com:SciTools/cartopy.git","clone_url":"https://github.com/SciTools/cartopy.git","svn_url":"https://github.com/SciTools/cartopy","homepage":"http://scitools.org.uk/cartopy/","size":79434,"stargazers_count":147,"watchers_count":147,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":67,"mirror_url":null,"open_issues_count":102,"forks":67,"open_issues":102,"watchers":147,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SciTools/cartopy/pulls/704"},"html":{"href":"https://github.com/SciTools/cartopy/pull/704"},"issue":{"href":"https://api.github.com/repos/SciTools/cartopy/issues/704"},"comments":{"href":"https://api.github.com/repos/SciTools/cartopy/issues/704/comments"},"review_comments":{"href":"https://api.github.com/repos/SciTools/cartopy/pulls/704/comments"},"review_comment":{"href":"https://api.github.com/repos/SciTools/cartopy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SciTools/cartopy/pulls/704/commits"},"statuses":{"href":"https://api.github.com/repos/SciTools/cartopy/statuses/4513d3aec2d825df0c270acc9b0b6363dae34503"}}}}