{"action":"created","comment":{"url":"https://api.github.com/repos/sympy/sympy/pulls/comments/38268789","id":38268789,"diff_hunk":"@@ -93,3 +93,29 @@ def test_doit_nested_MatrixExpr():\n     Y = ImmutableMatrix([[2, 3], [4, 5]])\n     assert MatPow(MatMul(X, Y), 2).doit() == (X*Y)**2\n     assert MatPow(MatAdd(X, Y), 2).doit() == (X + Y)**2\n+\n+\n+def test_identity_power():\n+    k = Identity(n)\n+    assert MatPow(k, 4).doit() == k\n+    assert MatPow(k, 1).doit() == k\n+    assert MatPow(k, -3).doit() == k\n+    assert MatPow(k, 0).doit() == k\n+    l = Identity(3)\n+    assert MatPow(l, 2).doit() == l\n+    assert MatPow(l, -1).doit() == l\n+    assert MatPow(l, 0).doit() == l\n+\n+def test_zero_power():\n+    z1 = ZeroMatrix(n, n)\n+    assert MatPow(z1, 3).doit() == z1\n+    raises(ValueError, lambda:MatPow(z1, -1).doit())\n+    assert MatPow(z1, 0).doit() == Identity(n)\n+    assert MatPow(z1, 2).doit() == z1\n+    raises(ValueError, lambda:MatPow(z1, -2).doit())\n+    z2 = ZeroMatrix(4, 4)\n+    assert MatPow(z2, 4).doit() == z2\n+    raises(ValueError, lambda:MatPow(z2, -3).doit())\n+    assert MatPow(z2, 2).doit() == z2\n+    assert MatPow(z2, 0).doit() == Identity(4)\n+    raises(ValueError, lambda:MatPow(z2, -1).doit())","path":"sympy/matrices/expressions/tests/test_matpow.py","position":38,"original_position":37,"commit_id":"2823c81073d551f787a63500ee0724c1f20cb47e","original_commit_id":"119082cf13cdef0187bc66516938593628ab3319","user":{"login":"gxyd","id":7712241,"avatar_url":"https://avatars.githubusercontent.com/u/7712241?v=3","gravatar_id":"","url":"https://api.github.com/users/gxyd","html_url":"https://github.com/gxyd","followers_url":"https://api.github.com/users/gxyd/followers","following_url":"https://api.github.com/users/gxyd/following{/other_user}","gists_url":"https://api.github.com/users/gxyd/gists{/gist_id}","starred_url":"https://api.github.com/users/gxyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gxyd/subscriptions","organizations_url":"https://api.github.com/users/gxyd/orgs","repos_url":"https://api.github.com/users/gxyd/repos","events_url":"https://api.github.com/users/gxyd/events{/privacy}","received_events_url":"https://api.github.com/users/gxyd/received_events","type":"User","site_admin":false},"body":"I think \"not\", since i am seeing `O-|` this type of symbol on three \nlines at the end. Hovering over which gives \"No New line at the end of \nfile\". I am not sure if that would result in an error on `python \n./bin/test sympy/utilities/tests/test_code_quality.py` (same before as \ni mentioned). Can you run `python ./bin/test \nsympy/utilities/tests/test_code_quality.py` on your machine locally?\n\nOn Sun, Aug 30, 2015 at 11:17 AM, Keval Shah <notifications@github.com> \nwrote:\n> In sympy/matrices/expressions/tests/test_matpow.py:\n> \n> > +    assert MatPow(l, -1).doit() == l\n> > +    assert MatPow(l, 0).doit() == l\n> > +\n> > +def test_zero_power():\n> > +    z1 = ZeroMatrix(n, n)\n> > +    assert MatPow(z1, 3).doit() == z1\n> > +    raises(ValueError, lambda:MatPow(z1, -1).doit())\n> > +    assert MatPow(z1, 0).doit() == Identity(n)\n> > +    assert MatPow(z1, 2).doit() == z1\n> > +    raises(ValueError, lambda:MatPow(z1, -2).doit())\n> > +    z2 = ZeroMatrix(4, 4)\n> > +    assert MatPow(z2, 4).doit() == z2\n> > +    raises(ValueError, lambda:MatPow(z2, -3).doit())\n> > +    assert MatPow(z2, 2).doit() == z2\n> > +    assert MatPow(z2, 0).doit() == Identity(4)\n> > +    raises(ValueError, lambda:MatPow(z2, -1).doit())\n> Ohh I get it now.\n> Does everything look good after the last commit?\n> \n> —\n> Reply to this email directly or view it on GitHub.\n> \n","created_at":"2015-08-30T05:52:35Z","updated_at":"2015-08-30T05:52:35Z","html_url":"https://github.com/sympy/sympy/pull/9830#discussion_r38268789","pull_request_url":"https://api.github.com/repos/sympy/sympy/pulls/9830","_links":{"self":{"href":"https://api.github.com/repos/sympy/sympy/pulls/comments/38268789"},"html":{"href":"https://github.com/sympy/sympy/pull/9830#discussion_r38268789"},"pull_request":{"href":"https://api.github.com/repos/sympy/sympy/pulls/9830"}}},"pull_request":{"url":"https://api.github.com/repos/sympy/sympy/pulls/9830","id":42508106,"html_url":"https://github.com/sympy/sympy/pull/9830","diff_url":"https://github.com/sympy/sympy/pull/9830.diff","patch_url":"https://github.com/sympy/sympy/pull/9830.patch","issue_url":"https://api.github.com/repos/sympy/sympy/issues/9830","number":9830,"state":"open","locked":false,"title":"Bug Fixed : Matrix power of identity matrix fails #9823","user":{"login":"kevalds51","id":9724752,"avatar_url":"https://avatars.githubusercontent.com/u/9724752?v=3","gravatar_id":"","url":"https://api.github.com/users/kevalds51","html_url":"https://github.com/kevalds51","followers_url":"https://api.github.com/users/kevalds51/followers","following_url":"https://api.github.com/users/kevalds51/following{/other_user}","gists_url":"https://api.github.com/users/kevalds51/gists{/gist_id}","starred_url":"https://api.github.com/users/kevalds51/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevalds51/subscriptions","organizations_url":"https://api.github.com/users/kevalds51/orgs","repos_url":"https://api.github.com/users/kevalds51/repos","events_url":"https://api.github.com/users/kevalds51/events{/privacy}","received_events_url":"https://api.github.com/users/kevalds51/received_events","type":"User","site_admin":false},"body":"Added the test to exercise the code change. (as requested by the @moorepants )\r\nModified the code such that no error is generated for both MatPow method and ** operator.\r\nremoved extra blank line which resulted in test_code_quality fail.","created_at":"2015-08-14T23:48:12Z","updated_at":"2015-08-30T05:52:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c2e32d73ffa067f3b4bd9081e25dff0c9797913c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sympy/sympy/pulls/9830/commits","review_comments_url":"https://api.github.com/repos/sympy/sympy/pulls/9830/comments","review_comment_url":"https://api.github.com/repos/sympy/sympy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sympy/sympy/issues/9830/comments","statuses_url":"https://api.github.com/repos/sympy/sympy/statuses/2823c81073d551f787a63500ee0724c1f20cb47e","head":{"label":"kevalds51:master","ref":"master","sha":"2823c81073d551f787a63500ee0724c1f20cb47e","user":{"login":"kevalds51","id":9724752,"avatar_url":"https://avatars.githubusercontent.com/u/9724752?v=3","gravatar_id":"","url":"https://api.github.com/users/kevalds51","html_url":"https://github.com/kevalds51","followers_url":"https://api.github.com/users/kevalds51/followers","following_url":"https://api.github.com/users/kevalds51/following{/other_user}","gists_url":"https://api.github.com/users/kevalds51/gists{/gist_id}","starred_url":"https://api.github.com/users/kevalds51/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevalds51/subscriptions","organizations_url":"https://api.github.com/users/kevalds51/orgs","repos_url":"https://api.github.com/users/kevalds51/repos","events_url":"https://api.github.com/users/kevalds51/events{/privacy}","received_events_url":"https://api.github.com/users/kevalds51/received_events","type":"User","site_admin":false},"repo":{"id":40713994,"name":"sympy","full_name":"kevalds51/sympy","owner":{"login":"kevalds51","id":9724752,"avatar_url":"https://avatars.githubusercontent.com/u/9724752?v=3","gravatar_id":"","url":"https://api.github.com/users/kevalds51","html_url":"https://github.com/kevalds51","followers_url":"https://api.github.com/users/kevalds51/followers","following_url":"https://api.github.com/users/kevalds51/following{/other_user}","gists_url":"https://api.github.com/users/kevalds51/gists{/gist_id}","starred_url":"https://api.github.com/users/kevalds51/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevalds51/subscriptions","organizations_url":"https://api.github.com/users/kevalds51/orgs","repos_url":"https://api.github.com/users/kevalds51/repos","events_url":"https://api.github.com/users/kevalds51/events{/privacy}","received_events_url":"https://api.github.com/users/kevalds51/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kevalds51/sympy","description":"A computer algebra system written in pure Python","fork":true,"url":"https://api.github.com/repos/kevalds51/sympy","forks_url":"https://api.github.com/repos/kevalds51/sympy/forks","keys_url":"https://api.github.com/repos/kevalds51/sympy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kevalds51/sympy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kevalds51/sympy/teams","hooks_url":"https://api.github.com/repos/kevalds51/sympy/hooks","issue_events_url":"https://api.github.com/repos/kevalds51/sympy/issues/events{/number}","events_url":"https://api.github.com/repos/kevalds51/sympy/events","assignees_url":"https://api.github.com/repos/kevalds51/sympy/assignees{/user}","branches_url":"https://api.github.com/repos/kevalds51/sympy/branches{/branch}","tags_url":"https://api.github.com/repos/kevalds51/sympy/tags","blobs_url":"https://api.github.com/repos/kevalds51/sympy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kevalds51/sympy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kevalds51/sympy/git/refs{/sha}","trees_url":"https://api.github.com/repos/kevalds51/sympy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kevalds51/sympy/statuses/{sha}","languages_url":"https://api.github.com/repos/kevalds51/sympy/languages","stargazers_url":"https://api.github.com/repos/kevalds51/sympy/stargazers","contributors_url":"https://api.github.com/repos/kevalds51/sympy/contributors","subscribers_url":"https://api.github.com/repos/kevalds51/sympy/subscribers","subscription_url":"https://api.github.com/repos/kevalds51/sympy/subscription","commits_url":"https://api.github.com/repos/kevalds51/sympy/commits{/sha}","git_commits_url":"https://api.github.com/repos/kevalds51/sympy/git/commits{/sha}","comments_url":"https://api.github.com/repos/kevalds51/sympy/comments{/number}","issue_comment_url":"https://api.github.com/repos/kevalds51/sympy/issues/comments{/number}","contents_url":"https://api.github.com/repos/kevalds51/sympy/contents/{+path}","compare_url":"https://api.github.com/repos/kevalds51/sympy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kevalds51/sympy/merges","archive_url":"https://api.github.com/repos/kevalds51/sympy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kevalds51/sympy/downloads","issues_url":"https://api.github.com/repos/kevalds51/sympy/issues{/number}","pulls_url":"https://api.github.com/repos/kevalds51/sympy/pulls{/number}","milestones_url":"https://api.github.com/repos/kevalds51/sympy/milestones{/number}","notifications_url":"https://api.github.com/repos/kevalds51/sympy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kevalds51/sympy/labels{/name}","releases_url":"https://api.github.com/repos/kevalds51/sympy/releases{/id}","created_at":"2015-08-14T12:30:47Z","updated_at":"2015-08-14T12:30:52Z","pushed_at":"2015-08-30T05:41:48Z","git_url":"git://github.com/kevalds51/sympy.git","ssh_url":"git@github.com:kevalds51/sympy.git","clone_url":"https://github.com/kevalds51/sympy.git","svn_url":"https://github.com/kevalds51/sympy","homepage":"http://sympy.org/","size":72166,"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":"sympy:master","ref":"master","sha":"a9bbf403b28b2e90907ed5327eb1a704b2f9bd6c","user":{"login":"sympy","id":260832,"avatar_url":"https://avatars.githubusercontent.com/u/260832?v=3","gravatar_id":"","url":"https://api.github.com/users/sympy","html_url":"https://github.com/sympy","followers_url":"https://api.github.com/users/sympy/followers","following_url":"https://api.github.com/users/sympy/following{/other_user}","gists_url":"https://api.github.com/users/sympy/gists{/gist_id}","starred_url":"https://api.github.com/users/sympy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sympy/subscriptions","organizations_url":"https://api.github.com/users/sympy/orgs","repos_url":"https://api.github.com/users/sympy/repos","events_url":"https://api.github.com/users/sympy/events{/privacy}","received_events_url":"https://api.github.com/users/sympy/received_events","type":"Organization","site_admin":false},"repo":{"id":640534,"name":"sympy","full_name":"sympy/sympy","owner":{"login":"sympy","id":260832,"avatar_url":"https://avatars.githubusercontent.com/u/260832?v=3","gravatar_id":"","url":"https://api.github.com/users/sympy","html_url":"https://github.com/sympy","followers_url":"https://api.github.com/users/sympy/followers","following_url":"https://api.github.com/users/sympy/following{/other_user}","gists_url":"https://api.github.com/users/sympy/gists{/gist_id}","starred_url":"https://api.github.com/users/sympy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sympy/subscriptions","organizations_url":"https://api.github.com/users/sympy/orgs","repos_url":"https://api.github.com/users/sympy/repos","events_url":"https://api.github.com/users/sympy/events{/privacy}","received_events_url":"https://api.github.com/users/sympy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sympy/sympy","description":"A computer algebra system written in pure Python","fork":false,"url":"https://api.github.com/repos/sympy/sympy","forks_url":"https://api.github.com/repos/sympy/sympy/forks","keys_url":"https://api.github.com/repos/sympy/sympy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sympy/sympy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sympy/sympy/teams","hooks_url":"https://api.github.com/repos/sympy/sympy/hooks","issue_events_url":"https://api.github.com/repos/sympy/sympy/issues/events{/number}","events_url":"https://api.github.com/repos/sympy/sympy/events","assignees_url":"https://api.github.com/repos/sympy/sympy/assignees{/user}","branches_url":"https://api.github.com/repos/sympy/sympy/branches{/branch}","tags_url":"https://api.github.com/repos/sympy/sympy/tags","blobs_url":"https://api.github.com/repos/sympy/sympy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sympy/sympy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sympy/sympy/git/refs{/sha}","trees_url":"https://api.github.com/repos/sympy/sympy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sympy/sympy/statuses/{sha}","languages_url":"https://api.github.com/repos/sympy/sympy/languages","stargazers_url":"https://api.github.com/repos/sympy/sympy/stargazers","contributors_url":"https://api.github.com/repos/sympy/sympy/contributors","subscribers_url":"https://api.github.com/repos/sympy/sympy/subscribers","subscription_url":"https://api.github.com/repos/sympy/sympy/subscription","commits_url":"https://api.github.com/repos/sympy/sympy/commits{/sha}","git_commits_url":"https://api.github.com/repos/sympy/sympy/git/commits{/sha}","comments_url":"https://api.github.com/repos/sympy/sympy/comments{/number}","issue_comment_url":"https://api.github.com/repos/sympy/sympy/issues/comments{/number}","contents_url":"https://api.github.com/repos/sympy/sympy/contents/{+path}","compare_url":"https://api.github.com/repos/sympy/sympy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sympy/sympy/merges","archive_url":"https://api.github.com/repos/sympy/sympy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sympy/sympy/downloads","issues_url":"https://api.github.com/repos/sympy/sympy/issues{/number}","pulls_url":"https://api.github.com/repos/sympy/sympy/pulls{/number}","milestones_url":"https://api.github.com/repos/sympy/sympy/milestones{/number}","notifications_url":"https://api.github.com/repos/sympy/sympy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sympy/sympy/labels{/name}","releases_url":"https://api.github.com/repos/sympy/sympy/releases{/id}","created_at":"2010-04-30T20:37:14Z","updated_at":"2015-08-30T01:24:36Z","pushed_at":"2015-08-30T05:41:48Z","git_url":"git://github.com/sympy/sympy.git","ssh_url":"git@github.com:sympy/sympy.git","clone_url":"https://github.com/sympy/sympy.git","svn_url":"https://github.com/sympy/sympy","homepage":"http://sympy.org/","size":154673,"stargazers_count":2306,"watchers_count":2306,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1125,"mirror_url":null,"open_issues_count":1969,"forks":1125,"open_issues":1969,"watchers":2306,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sympy/sympy/pulls/9830"},"html":{"href":"https://github.com/sympy/sympy/pull/9830"},"issue":{"href":"https://api.github.com/repos/sympy/sympy/issues/9830"},"comments":{"href":"https://api.github.com/repos/sympy/sympy/issues/9830/comments"},"review_comments":{"href":"https://api.github.com/repos/sympy/sympy/pulls/9830/comments"},"review_comment":{"href":"https://api.github.com/repos/sympy/sympy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sympy/sympy/pulls/9830/commits"},"statuses":{"href":"https://api.github.com/repos/sympy/sympy/statuses/2823c81073d551f787a63500ee0724c1f20cb47e"}}}}