{"action":"created","comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/86648327","pull_request_review_id":7299662,"id":86648327,"diff_hunk":"@@ -133,6 +134,20 @@ def test_barbs():\n              cmap='viridis')\n \n \n+@cleanup\n+@raises(ValueError)","path":"lib/matplotlib/tests/test_quiver.py","position":13,"original_position":13,"commit_id":"65d818df2ba2359355c76c619851df7d9168655b","original_commit_id":"65d818df2ba2359355c76c619851df7d9168655b","user":{"login":"phobson","id":1163939,"avatar_url":"https://avatars.githubusercontent.com/u/1163939?v=3","gravatar_id":"","url":"https://api.github.com/users/phobson","html_url":"https://github.com/phobson","followers_url":"https://api.github.com/users/phobson/followers","following_url":"https://api.github.com/users/phobson/following{/other_user}","gists_url":"https://api.github.com/users/phobson/gists{/gist_id}","starred_url":"https://api.github.com/users/phobson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phobson/subscriptions","organizations_url":"https://api.github.com/users/phobson/orgs","repos_url":"https://api.github.com/users/phobson/repos","events_url":"https://api.github.com/users/phobson/events{/privacy}","received_events_url":"https://api.github.com/users/phobson/received_events","type":"User","site_admin":false},"body":"Oops. Sorry for the noise. I missed the destination for this.","created_at":"2016-11-04T23:20:54Z","updated_at":"2016-11-04T23:20:55Z","html_url":"https://github.com/matplotlib/matplotlib/pull/7407#discussion_r86648327","pull_request_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7407","_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/86648327"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/7407#discussion_r86648327"},"pull_request":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7407"}}},"pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7407","id":92409949,"html_url":"https://github.com/matplotlib/matplotlib/pull/7407","diff_url":"https://github.com/matplotlib/matplotlib/pull/7407.diff","patch_url":"https://github.com/matplotlib/matplotlib/pull/7407.patch","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/7407","number":7407,"state":"open","locked":false,"title":"[MRG+1] Improve barbs() error message","user":{"login":"dopplershift","id":221526,"avatar_url":"https://avatars.githubusercontent.com/u/221526?v=3","gravatar_id":"","url":"https://api.github.com/users/dopplershift","html_url":"https://github.com/dopplershift","followers_url":"https://api.github.com/users/dopplershift/followers","following_url":"https://api.github.com/users/dopplershift/following{/other_user}","gists_url":"https://api.github.com/users/dopplershift/gists{/gist_id}","starred_url":"https://api.github.com/users/dopplershift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dopplershift/subscriptions","organizations_url":"https://api.github.com/users/dopplershift/orgs","repos_url":"https://api.github.com/users/dopplershift/repos","events_url":"https://api.github.com/users/dopplershift/events{/privacy}","received_events_url":"https://api.github.com/users/dopplershift/received_events","type":"User","site_admin":false},"body":"So for the following code with badly sized (x,y with 3, u,v with 4) arrays:\r\n```python\r\nx = np.arange(3)\r\ny = np.arange(3)\r\nu = np.ma.array(15. * np.ones((4,)), mask=[False, True, False, False])\r\nv = np.ma.array(15. * np.ones_like(u), mask=[False, True, False, False])\r\nplt.barbs(x, y, u, v)\r\n```\r\nThe error would end up with something inscrutable (I lost over an hour figuring out what was wrong):\r\n```pytb\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\n\r\n<SNIP>\r\n\r\n/Users/rmay/repos/matplotlib/lib/matplotlib/quiver.py in __init__(self, ax, *args, **kw)\r\n    942         self.set_transform(transforms.IdentityTransform())\r\n    943 \r\n--> 944         self.set_UVC(u, v, c)\r\n    945 \r\n    946     def _find_tails(self, mag, rounding=True, half=5, full=10, flag=50):\r\n\r\n/Users/rmay/repos/matplotlib/lib/matplotlib/quiver.py in set_UVC(self, U, V, C)\r\n   1138         plot_barbs = self._make_barbs(u, v, flags, barbs, halves, empty,\r\n   1139                                       self._length, self._pivot, self.sizes,\r\n-> 1140                                       self.fill_empty, self.flip)\r\n   1141         self.set_verts(plot_barbs)\r\n   1142 \r\n\r\n/Users/rmay/repos/matplotlib/lib/matplotlib/quiver.py in _make_barbs(self, u, v, nflags, nbarbs, half_barb, empty_flag, length, pivot, sizes, fill_empty, flip)\r\n   1071 \r\n   1072             # Add vertices for each flag\r\n-> 1073             for i in range(nflags[index]):\r\n   1074                 # The spacing that works for the barbs is a little to much for\r\n   1075                 # the flags, but this only occurs when we have more than 1\r\n\r\nTypeError: only integer arrays with one element can be converted to an index\r\n```\r\n\r\nIt also only happens when masked arrays are involved--otherwise it silently succeeds, which seems poor as well. With this change now the error is easy to identify:\r\n```pytb\r\n---------------------------------------------------------------------------\r\nValueError                                Traceback (most recent call last)\r\n\r\n<SNIP>\r\n\r\n/Users/rmay/repos/matplotlib/lib/matplotlib/quiver.py in __init__(self, ax, *args, **kw)\r\n    948         self.set_transform(transforms.IdentityTransform())\r\n    949 \r\n--> 950         self.set_UVC(u, v, c)\r\n    951 \r\n    952     def _find_tails(self, mag, rounding=True, half=5, full=10, flag=50):\r\n\r\n/Users/rmay/repos/matplotlib/lib/matplotlib/quiver.py in set_UVC(self, U, V, C)\r\n   1135             x, y, u, v = delete_masked_points(self.x.ravel(), self.y.ravel(),\r\n   1136                                               self.u, self.v)\r\n-> 1137             check_array_shapes(x, y, u, v)\r\n   1138 \r\n   1139         magnitude = np.hypot(u, v)\r\n\r\n/Users/rmay/repos/matplotlib/lib/matplotlib/quiver.py in check_array_shapes(*arrays)\r\n    396     all_shapes = set(a.shape for a in arrays)\r\n    397     if len(all_shapes) != 1:\r\n--> 398         raise ValueError('The shapes of the passed in arrays do not match.')\r\n    399 \r\n    400 \r\n\r\nValueError: The shapes of the passed in arrays do not match.\r\n```","created_at":"2016-11-04T20:25:49Z","updated_at":"2016-11-04T23:20:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3013d502ec8e63b613e7e17f847c8644571df703","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/20","html_url":"https://github.com/matplotlib/matplotlib/milestones/2.0.1%20(next%20bug%20fix%20release)","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/20/labels","id":1306895,"number":20,"title":"2.0.1 (next bug fix release)","description":"","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":177,"closed_issues":105,"state":"open","created_at":"2015-09-15T17:47:44Z","updated_at":"2016-11-04T22:22:43Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7407/commits","review_comments_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7407/comments","review_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/7407/comments","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/65d818df2ba2359355c76c619851df7d9168655b","head":{"label":"dopplershift:barbs-error","ref":"barbs-error","sha":"65d818df2ba2359355c76c619851df7d9168655b","user":{"login":"dopplershift","id":221526,"avatar_url":"https://avatars.githubusercontent.com/u/221526?v=3","gravatar_id":"","url":"https://api.github.com/users/dopplershift","html_url":"https://github.com/dopplershift","followers_url":"https://api.github.com/users/dopplershift/followers","following_url":"https://api.github.com/users/dopplershift/following{/other_user}","gists_url":"https://api.github.com/users/dopplershift/gists{/gist_id}","starred_url":"https://api.github.com/users/dopplershift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dopplershift/subscriptions","organizations_url":"https://api.github.com/users/dopplershift/orgs","repos_url":"https://api.github.com/users/dopplershift/repos","events_url":"https://api.github.com/users/dopplershift/events{/privacy}","received_events_url":"https://api.github.com/users/dopplershift/received_events","type":"User","site_admin":false},"repo":{"id":1409412,"name":"matplotlib","full_name":"dopplershift/matplotlib","owner":{"login":"dopplershift","id":221526,"avatar_url":"https://avatars.githubusercontent.com/u/221526?v=3","gravatar_id":"","url":"https://api.github.com/users/dopplershift","html_url":"https://github.com/dopplershift","followers_url":"https://api.github.com/users/dopplershift/followers","following_url":"https://api.github.com/users/dopplershift/following{/other_user}","gists_url":"https://api.github.com/users/dopplershift/gists{/gist_id}","starred_url":"https://api.github.com/users/dopplershift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dopplershift/subscriptions","organizations_url":"https://api.github.com/users/dopplershift/orgs","repos_url":"https://api.github.com/users/dopplershift/repos","events_url":"https://api.github.com/users/dopplershift/events{/privacy}","received_events_url":"https://api.github.com/users/dopplershift/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dopplershift/matplotlib","description":null,"fork":true,"url":"https://api.github.com/repos/dopplershift/matplotlib","forks_url":"https://api.github.com/repos/dopplershift/matplotlib/forks","keys_url":"https://api.github.com/repos/dopplershift/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dopplershift/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dopplershift/matplotlib/teams","hooks_url":"https://api.github.com/repos/dopplershift/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/dopplershift/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/dopplershift/matplotlib/events","assignees_url":"https://api.github.com/repos/dopplershift/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/dopplershift/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/dopplershift/matplotlib/tags","blobs_url":"https://api.github.com/repos/dopplershift/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dopplershift/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dopplershift/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/dopplershift/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dopplershift/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/dopplershift/matplotlib/languages","stargazers_url":"https://api.github.com/repos/dopplershift/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/dopplershift/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/dopplershift/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/dopplershift/matplotlib/subscription","commits_url":"https://api.github.com/repos/dopplershift/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/dopplershift/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/dopplershift/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/dopplershift/matplotlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/dopplershift/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/dopplershift/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dopplershift/matplotlib/merges","archive_url":"https://api.github.com/repos/dopplershift/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dopplershift/matplotlib/downloads","issues_url":"https://api.github.com/repos/dopplershift/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/dopplershift/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/dopplershift/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/dopplershift/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dopplershift/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/dopplershift/matplotlib/releases{/id}","deployments_url":"https://api.github.com/repos/dopplershift/matplotlib/deployments","created_at":"2011-02-25T02:55:48Z","updated_at":"2015-04-20T16:20:50Z","pushed_at":"2016-11-04T22:29:46Z","git_url":"git://github.com/dopplershift/matplotlib.git","ssh_url":"git@github.com:dopplershift/matplotlib.git","clone_url":"https://github.com/dopplershift/matplotlib.git","svn_url":"https://github.com/dopplershift/matplotlib","homepage":"","size":288937,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"matplotlib:v2.x","ref":"v2.x","sha":"1a6a897a93baf974dcc209b6f8e8e299236987b6","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}","deployments_url":"https://api.github.com/repos/matplotlib/matplotlib/deployments","created_at":"2011-02-19T03:17:12Z","updated_at":"2016-11-04T14:13:50Z","pushed_at":"2016-11-04T23:19:29Z","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":401292,"stargazers_count":4299,"watchers_count":4299,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2114,"mirror_url":null,"open_issues_count":1046,"forks":2114,"open_issues":1046,"watchers":4299,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7407"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/7407"},"issue":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/7407"},"comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/7407/comments"},"review_comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7407/comments"},"review_comment":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7407/commits"},"statuses":{"href":"https://api.github.com/repos/matplotlib/matplotlib/statuses/65d818df2ba2359355c76c619851df7d9168655b"}}}}
{"actor":{"display_login":"phobson"}}