{"action":"created","comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/26471055","id":26471055,"diff_hunk":"@@ -2436,8 +2463,8 @@ def __init__(self, boxin, boxout, **kwargs):\n         Create a new :class:`BboxTransform` that linearly transforms\n         points from *boxin* to *boxout*.\n         \"\"\"\n-        assert boxin.is_bbox\n-        assert boxout.is_bbox\n+        if not boxin.is_bbox or not boxout.is_bbox:\n+            msg = \"'boxin' and 'boxout' must be bbox\"","path":"lib/matplotlib/transforms.py","position":162,"original_position":162,"commit_id":"41bf6b5c6e783eb8861ba75e8daf3f670d2bbfb6","original_commit_id":"088542ebc29147dd6cc025619a098695065c0948","user":{"login":"montefra","id":1394820,"avatar_url":"https://avatars.githubusercontent.com/u/1394820?v=3","gravatar_id":"","url":"https://api.github.com/users/montefra","html_url":"https://github.com/montefra","followers_url":"https://api.github.com/users/montefra/followers","following_url":"https://api.github.com/users/montefra/following{/other_user}","gists_url":"https://api.github.com/users/montefra/gists{/gist_id}","starred_url":"https://api.github.com/users/montefra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/montefra/subscriptions","organizations_url":"https://api.github.com/users/montefra/orgs","repos_url":"https://api.github.com/users/montefra/repos","events_url":"https://api.github.com/users/montefra/events{/privacy}","received_events_url":"https://api.github.com/users/montefra/received_events","type":"User","site_admin":false},"body":"Thanks for catching the `raise` missing. \r\n\r\nAbout the second comment: what do you mean with \"true-ish\". The `if` is actually testing that both instances have a `is_bbox` property, but I guess that then somewhere else the code is making use of some bbox method/property. Would you prefer something like this?\r\n\r\n> \"'boxin' and 'boxout' must look like a bbox\"\r\n\r\nAny suggestion?","created_at":"2015-03-16T09:51:00Z","updated_at":"2015-03-16T09:51:00Z","html_url":"https://github.com/matplotlib/matplotlib/pull/3060#discussion_r26471055","pull_request_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3060","_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/26471055"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/3060#discussion_r26471055"},"pull_request":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3060"}}},"pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3060","id":15844416,"html_url":"https://github.com/matplotlib/matplotlib/pull/3060","diff_url":"https://github.com/matplotlib/matplotlib/pull/3060.diff","patch_url":"https://github.com/matplotlib/matplotlib/pull/3060.patch","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/3060","number":3060,"state":"open","locked":false,"title":"converted assert into exception","user":{"login":"montefra","id":1394820,"avatar_url":"https://avatars.githubusercontent.com/u/1394820?v=3","gravatar_id":"","url":"https://api.github.com/users/montefra","html_url":"https://github.com/montefra","followers_url":"https://api.github.com/users/montefra/followers","following_url":"https://api.github.com/users/montefra/following{/other_user}","gists_url":"https://api.github.com/users/montefra/gists{/gist_id}","starred_url":"https://api.github.com/users/montefra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/montefra/subscriptions","organizations_url":"https://api.github.com/users/montefra/orgs","repos_url":"https://api.github.com/users/montefra/repos","events_url":"https://api.github.com/users/montefra/events{/privacy}","received_events_url":"https://api.github.com/users/montefra/received_events","type":"User","site_admin":false},"body":"A few days I ago I was experimenting for a possible answer to [this question](http://matplotlib.1069221.n5.nabble.com/Re-combine-different-axes-to-make-new-figure-in-matplotlib-td43385.html). While trying\r\n\r\n    fig1, ax1 = plt.subplots()\r\n    fig2, ax2 = plt.subplots()\r\n    fig2.add_axes(ax1)\r\nI stumbled into an `AssertionError` without any explanation (I had to get the doc of `add_axes`). \r\nMy understanding is that `assert` should be reserved for debugging, not to throw errors if the user give a wrong parameter. So I've converted them to exception. \r\n\r\nI've also noticed that `assert` is used all over the places. If there are no strong opinions in the next weeks I'll to go through the code and convert them to exceptions.","created_at":"2014-05-13T20:14:01Z","updated_at":"2015-03-16T09:51:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"10a71158ac756699d0bdfa7f904dc15eabf9ddd3","assignee":null,"milestone":{"url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/18","html_url":"https://github.com/matplotlib/matplotlib/milestones/next%20point%20release","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/18/labels","id":970105,"number":18,"title":"next point release","description":"Next minor release.","creator":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars.githubusercontent.com/u/199813?v=3","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"open_issues":171,"closed_issues":62,"state":"open","created_at":"2015-02-07T21:22:30Z","updated_at":"2015-03-16T04:54:20Z","due_on":"2015-07-06T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3060/commits","review_comments_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3060/comments","review_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/3060/comments","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/41bf6b5c6e783eb8861ba75e8daf3f670d2bbfb6","head":{"label":"montefra:no_assert","ref":"no_assert","sha":"41bf6b5c6e783eb8861ba75e8daf3f670d2bbfb6","user":{"login":"montefra","id":1394820,"avatar_url":"https://avatars.githubusercontent.com/u/1394820?v=3","gravatar_id":"","url":"https://api.github.com/users/montefra","html_url":"https://github.com/montefra","followers_url":"https://api.github.com/users/montefra/followers","following_url":"https://api.github.com/users/montefra/following{/other_user}","gists_url":"https://api.github.com/users/montefra/gists{/gist_id}","starred_url":"https://api.github.com/users/montefra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/montefra/subscriptions","organizations_url":"https://api.github.com/users/montefra/orgs","repos_url":"https://api.github.com/users/montefra/repos","events_url":"https://api.github.com/users/montefra/events{/privacy}","received_events_url":"https://api.github.com/users/montefra/received_events","type":"User","site_admin":false},"repo":{"id":5572510,"name":"matplotlib","full_name":"montefra/matplotlib","owner":{"login":"montefra","id":1394820,"avatar_url":"https://avatars.githubusercontent.com/u/1394820?v=3","gravatar_id":"","url":"https://api.github.com/users/montefra","html_url":"https://github.com/montefra","followers_url":"https://api.github.com/users/montefra/followers","following_url":"https://api.github.com/users/montefra/following{/other_user}","gists_url":"https://api.github.com/users/montefra/gists{/gist_id}","starred_url":"https://api.github.com/users/montefra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/montefra/subscriptions","organizations_url":"https://api.github.com/users/montefra/orgs","repos_url":"https://api.github.com/users/montefra/repos","events_url":"https://api.github.com/users/montefra/events{/privacy}","received_events_url":"https://api.github.com/users/montefra/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/montefra/matplotlib","description":"","fork":true,"url":"https://api.github.com/repos/montefra/matplotlib","forks_url":"https://api.github.com/repos/montefra/matplotlib/forks","keys_url":"https://api.github.com/repos/montefra/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/montefra/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/montefra/matplotlib/teams","hooks_url":"https://api.github.com/repos/montefra/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/montefra/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/montefra/matplotlib/events","assignees_url":"https://api.github.com/repos/montefra/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/montefra/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/montefra/matplotlib/tags","blobs_url":"https://api.github.com/repos/montefra/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/montefra/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/montefra/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/montefra/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/montefra/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/montefra/matplotlib/languages","stargazers_url":"https://api.github.com/repos/montefra/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/montefra/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/montefra/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/montefra/matplotlib/subscription","commits_url":"https://api.github.com/repos/montefra/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/montefra/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/montefra/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/montefra/matplotlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/montefra/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/montefra/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/montefra/matplotlib/merges","archive_url":"https://api.github.com/repos/montefra/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/montefra/matplotlib/downloads","issues_url":"https://api.github.com/repos/montefra/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/montefra/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/montefra/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/montefra/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/montefra/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/montefra/matplotlib/releases{/id}","created_at":"2012-08-27T14:57:49Z","updated_at":"2015-02-20T10:44:54Z","pushed_at":"2015-03-16T09:38:48Z","git_url":"git://github.com/montefra/matplotlib.git","ssh_url":"git@github.com:montefra/matplotlib.git","clone_url":"https://github.com/montefra/matplotlib.git","svn_url":"https://github.com/montefra/matplotlib","homepage":"","size":210639,"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":"matplotlib:master","ref":"master","sha":"be305a37cabc0e4e5ca002f9a27ce6b5f8d5c143","user":{"login":"matplotlib","id":215947,"avatar_url":"https://avatars.githubusercontent.com/u/215947?v=3","gravatar_id":"","url":"https://api.github.com/users/matplotlib","html_url":"https://github.com/matplotlib","followers_url":"https://api.github.com/users/matplotlib/followers","following_url":"https://api.github.com/users/matplotlib/following{/other_user}","gists_url":"https://api.github.com/users/matplotlib/gists{/gist_id}","starred_url":"https://api.github.com/users/matplotlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matplotlib/subscriptions","organizations_url":"https://api.github.com/users/matplotlib/orgs","repos_url":"https://api.github.com/users/matplotlib/repos","events_url":"https://api.github.com/users/matplotlib/events{/privacy}","received_events_url":"https://api.github.com/users/matplotlib/received_events","type":"Organization","site_admin":false},"repo":{"id":1385122,"name":"matplotlib","full_name":"matplotlib/matplotlib","owner":{"login":"matplotlib","id":215947,"avatar_url":"https://avatars.githubusercontent.com/u/215947?v=3","gravatar_id":"","url":"https://api.github.com/users/matplotlib","html_url":"https://github.com/matplotlib","followers_url":"https://api.github.com/users/matplotlib/followers","following_url":"https://api.github.com/users/matplotlib/following{/other_user}","gists_url":"https://api.github.com/users/matplotlib/gists{/gist_id}","starred_url":"https://api.github.com/users/matplotlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matplotlib/subscriptions","organizations_url":"https://api.github.com/users/matplotlib/orgs","repos_url":"https://api.github.com/users/matplotlib/repos","events_url":"https://api.github.com/users/matplotlib/events{/privacy}","received_events_url":"https://api.github.com/users/matplotlib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matplotlib/matplotlib","description":"matplotlib: plotting with Python","fork":false,"url":"https://api.github.com/repos/matplotlib/matplotlib","forks_url":"https://api.github.com/repos/matplotlib/matplotlib/forks","keys_url":"https://api.github.com/repos/matplotlib/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matplotlib/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matplotlib/matplotlib/teams","hooks_url":"https://api.github.com/repos/matplotlib/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/matplotlib/matplotlib/events","assignees_url":"https://api.github.com/repos/matplotlib/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/matplotlib/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/matplotlib/matplotlib/tags","blobs_url":"https://api.github.com/repos/matplotlib/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matplotlib/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matplotlib/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/matplotlib/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/matplotlib/matplotlib/languages","stargazers_url":"https://api.github.com/repos/matplotlib/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/matplotlib/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/matplotlib/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/matplotlib/matplotlib/subscription","commits_url":"https://api.github.com/repos/matplotlib/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/matplotlib/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/matplotlib/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/matplotlib/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matplotlib/matplotlib/merges","archive_url":"https://api.github.com/repos/matplotlib/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matplotlib/matplotlib/downloads","issues_url":"https://api.github.com/repos/matplotlib/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/matplotlib/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/matplotlib/matplotlib/releases{/id}","created_at":"2011-02-19T03:17:12Z","updated_at":"2015-03-16T06:45:40Z","pushed_at":"2015-03-16T04:34:27Z","git_url":"git://github.com/matplotlib/matplotlib.git","ssh_url":"git@github.com:matplotlib/matplotlib.git","clone_url":"https://github.com/matplotlib/matplotlib.git","svn_url":"https://github.com/matplotlib/matplotlib","homepage":"http://matplotlib.org/","size":261641,"stargazers_count":2329,"watchers_count":2329,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1169,"mirror_url":null,"open_issues_count":463,"forks":1169,"open_issues":463,"watchers":2329,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3060"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/3060"},"issue":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/3060"},"comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/3060/comments"},"review_comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3060/comments"},"review_comment":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3060/commits"},"statuses":{"href":"https://api.github.com/repos/matplotlib/matplotlib/statuses/41bf6b5c6e783eb8861ba75e8daf3f670d2bbfb6"}}}}