{"action":"created","comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/84317385","pull_request_review_id":5102482,"id":84317385,"diff_hunk":"@@ -345,7 +347,122 @@ def test_plotsurface_1d_raises():\n     fig = plt.figure(figsize=(14,6))\n     ax = fig.add_subplot(1, 2, 1, projection='3d')\n     assert_raises(ValueError, ax.plot_surface, X, Y, z)\n-    \n+\n+\n+def _test_proj_make_M():\n+    # eye point\n+    E = np.array([1000, -1000, 2000])\n+    R = np.array([100, 100, 100])\n+    V = np.array([0, 0, 1])\n+    viewM = proj3d.view_transformation(E, R, V)\n+    perspM = proj3d.persp_transformation(100, -100)\n+    M = np.dot(perspM, viewM)\n+    return M\n+\n+\n+def test_proj_transform():\n+    M = _test_proj_make_M()\n+\n+    xs = np.array([0, 1, 1, 0, 0, 0, 1, 1, 0, 0]) * 300.0\n+    ys = np.array([0, 0, 1, 1, 0, 0, 0, 1, 1, 0]) * 300.0\n+    zs = np.array([0, 0, 0, 0, 0, 1, 1, 1, 1, 1]) * 300.0\n+\n+    txs, tys, tzs = proj3d.proj_transform(xs, ys, zs, M)\n+    ixs, iys, izs = proj3d.inv_transform(txs, tys, tzs, M)\n+\n+    np.testing.assert_almost_equal(ixs, xs)\n+    np.testing.assert_almost_equal(iys, ys)\n+    np.testing.assert_almost_equal(izs, zs)\n+\n+\n+def _test_proj_draw_axes(M, s=1, *args, **kwargs):\n+    xs = [0, s, 0, 0]\n+    ys = [0, 0, s, 0]\n+    zs = [0, 0, 0, s]\n+    txs, tys, tzs = proj3d.proj_transform(xs, ys, zs, M)\n+    o = (txs[0], tys[0])\n+    ax = (txs[1], tys[1])\n+    ay = (txs[2], tys[2])\n+    az = (txs[3], tys[3])\n+    lines = [(o, ax), (o, ay), (o, az)]\n+\n+    fig, ax = plt.subplots(*args, **kwargs)\n+    linec = LineCollection(lines)\n+    ax.add_collection(linec)\n+    for x, y, t in zip(txs, tys, ['o', 'x', 'y', 'z']):\n+        ax.text(x, y, t)\n+\n+    return fig, ax\n+\n+\n+@image_comparison(baseline_images=['proj3d_axes_cube'], extensions=['png'])\n+def test_proj_axes_cube():\n+    M = _test_proj_make_M()\n+\n+    ts = '0 1 2 3 0 4 5 6 7 4'.split()\n+    xs = np.array([0, 1, 1, 0, 0, 0, 1, 1, 0, 0]) * 300.0\n+    ys = np.array([0, 0, 1, 1, 0, 0, 0, 1, 1, 0]) * 300.0\n+    zs = np.array([0, 0, 0, 0, 0, 1, 1, 1, 1, 1]) * 300.0\n+\n+    txs, tys, tzs = proj3d.proj_transform(xs, ys, zs, M)\n+\n+    fig, ax = _test_proj_draw_axes(M, s=400)\n+\n+    ax.scatter(txs, tys, c=tzs)\n+    ax.plot(txs, tys, c='r')\n+    for x, y, t in zip(txs, tys, ts):\n+        ax.text(x, y, t)\n+\n+    ax.set_xlim(-0.2, 0.2)\n+    ax.set_ylim(-0.2, 0.2)\n+\n+\n+def test_rot():\n+    V = [1, 0, 0, 1]\n+    rotated_V = proj3d.rot_x(V, np.pi / 6)\n+    np.testing.assert_allclose(rotated_V, [1, 0, 0, 1])\n+\n+    V = [0, 1, 0, 1]\n+    rotated_V = proj3d.rot_x(V, np.pi / 6)\n+    np.testing.assert_allclose(rotated_V, [0, np.sqrt(3) / 2, 0.5, 1])\n+\n+\n+def test_world():\n+    xmin, xmax = 100, 120\n+    ymin, ymax = -100, 100\n+    zmin, zmax = 0.1, 0.2\n+    M = proj3d.world_transformation(xmin, xmax, ymin, ymax, zmin, zmax)\n+    np.testing.assert_allclose(M,\n+                               [[5e-2, 0, 0, -5],\n+                                [0, 5e-3, 0, 5e-1],\n+                                [0, 0, 1e1, -1],\n+                                [0, 0, 0, 1]])\n+\n+\n+@image_comparison(baseline_images=['proj3d_lines_dists'], extensions=['png'])\n+def test_lines_dists():\n+    fig, ax = plt.subplots(figsize=(4, 6), subplot_kw=dict(aspect='equal'))\n+\n+    xs = (0, 30)\n+    ys = (20, 150)\n+    ax.plot(xs, ys)\n+    points = list(zip(xs, ys))\n+    p0, p1 = points","path":"lib/mpl_toolkits/tests/test_mplot3d.py","position":118,"original_position":118,"commit_id":"413e34ff8108c4fd35c72baa091159c4b99257f5","original_commit_id":"413e34ff8108c4fd35c72baa091159c4b99257f5","user":{"login":"Kojoley","id":2743474,"avatar_url":"https://avatars.githubusercontent.com/u/2743474?v=3","gravatar_id":"","url":"https://api.github.com/users/Kojoley","html_url":"https://github.com/Kojoley","followers_url":"https://api.github.com/users/Kojoley/followers","following_url":"https://api.github.com/users/Kojoley/following{/other_user}","gists_url":"https://api.github.com/users/Kojoley/gists{/gist_id}","starred_url":"https://api.github.com/users/Kojoley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kojoley/subscriptions","organizations_url":"https://api.github.com/users/Kojoley/orgs","repos_url":"https://api.github.com/users/Kojoley/repos","events_url":"https://api.github.com/users/Kojoley/events{/privacy}","received_events_url":"https://api.github.com/users/Kojoley/received_events","type":"User","site_admin":false},"body":"`p0, p1 = points = list(zip(xs, ys))` or even `p0, p1 = zip(xs, ys)` as `points` is unused","created_at":"2016-10-20T16:02:30Z","updated_at":"2016-10-20T16:02:30Z","html_url":"https://github.com/matplotlib/matplotlib/pull/7310#discussion_r84317385","pull_request_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7310","_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/84317385"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/7310#discussion_r84317385"},"pull_request":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7310"}}},"pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7310","id":90149736,"html_url":"https://github.com/matplotlib/matplotlib/pull/7310","diff_url":"https://github.com/matplotlib/matplotlib/pull/7310.diff","patch_url":"https://github.com/matplotlib/matplotlib/pull/7310.patch","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/7310","number":7310,"state":"open","locked":false,"title":"TST: Make proj3d tests into real tests","user":{"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},"body":"For some reason, these are buried in `mplot3d/proj3d.py` instead of in a test file. I guess they're sort of implicitly tested with the rest of the 3D plots, but it's also useful to test them by themselves.\r\n\r\nI think the tests are all okay except `test_world`, because I'm not totally sure what `world_transformation` is trying to do, but I guess it's okay since it's used for drawing.","created_at":"2016-10-20T07:56:12Z","updated_at":"2016-10-20T16:02:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bd956482d18e0aeb09940a755f36cfe2b6c8fe7b","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/12","html_url":"https://github.com/matplotlib/matplotlib/milestones/2.1%20(next%20point%20release)","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/12/labels","id":534144,"number":12,"title":"2.1 (next point release)","description":"Next feature release.\r\n\r\nBig ticket items:\r\n\r\n - MEP 22/27\r\n - traitlets","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":536,"closed_issues":492,"state":"open","created_at":"2014-01-13T03:21:09Z","updated_at":"2016-10-20T11:46:20Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7310/commits","review_comments_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7310/comments","review_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/7310/comments","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/413e34ff8108c4fd35c72baa091159c4b99257f5","head":{"label":"QuLogic:mplot3d-proj3d-test","ref":"mplot3d-proj3d-test","sha":"413e34ff8108c4fd35c72baa091159c4b99257f5","user":{"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},"repo":{"id":21548241,"name":"matplotlib","full_name":"QuLogic/matplotlib","owner":{"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},"private":false,"html_url":"https://github.com/QuLogic/matplotlib","description":"matplotlib: plotting with Python","fork":true,"url":"https://api.github.com/repos/QuLogic/matplotlib","forks_url":"https://api.github.com/repos/QuLogic/matplotlib/forks","keys_url":"https://api.github.com/repos/QuLogic/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/QuLogic/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/QuLogic/matplotlib/teams","hooks_url":"https://api.github.com/repos/QuLogic/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/QuLogic/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/QuLogic/matplotlib/events","assignees_url":"https://api.github.com/repos/QuLogic/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/QuLogic/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/QuLogic/matplotlib/tags","blobs_url":"https://api.github.com/repos/QuLogic/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/QuLogic/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/QuLogic/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/QuLogic/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/QuLogic/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/QuLogic/matplotlib/languages","stargazers_url":"https://api.github.com/repos/QuLogic/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/QuLogic/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/QuLogic/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/QuLogic/matplotlib/subscription","commits_url":"https://api.github.com/repos/QuLogic/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/QuLogic/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/QuLogic/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/QuLogic/matplotlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/QuLogic/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/QuLogic/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/QuLogic/matplotlib/merges","archive_url":"https://api.github.com/repos/QuLogic/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/QuLogic/matplotlib/downloads","issues_url":"https://api.github.com/repos/QuLogic/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/QuLogic/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/QuLogic/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/QuLogic/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/QuLogic/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/QuLogic/matplotlib/releases{/id}","deployments_url":"https://api.github.com/repos/QuLogic/matplotlib/deployments","created_at":"2014-07-06T20:41:46Z","updated_at":"2016-01-24T02:00:37Z","pushed_at":"2016-10-20T07:57:11Z","git_url":"git://github.com/QuLogic/matplotlib.git","ssh_url":"git@github.com:QuLogic/matplotlib.git","clone_url":"https://github.com/QuLogic/matplotlib.git","svn_url":"https://github.com/QuLogic/matplotlib","homepage":"http://matplotlib.org/","size":291993,"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":"c8ba52fa0e72bb1f1df3e49cffd3bc2739edbf59","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-10-20T15:35:14Z","pushed_at":"2016-10-20T12:00:32Z","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":400569,"stargazers_count":4245,"watchers_count":4245,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2083,"mirror_url":null,"open_issues_count":1021,"forks":2083,"open_issues":1021,"watchers":4245,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7310"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/7310"},"issue":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/7310"},"comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/7310/comments"},"review_comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7310/comments"},"review_comment":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7310/commits"},"statuses":{"href":"https://api.github.com/repos/matplotlib/matplotlib/statuses/413e34ff8108c4fd35c72baa091159c4b99257f5"}}}}
{"actor":{"display_login":"Kojoley"}}