{"action":"created","comment":{"url":"https://api.github.com/repos/sympy/sympy/pulls/comments/33898966","id":33898966,"diff_hunk":"@@ -184,6 +184,10 @@ def test_rsolve():\n             (C0*((sqrt(-a**2 + 1) - 1)/a)**n +\n              C1*((-sqrt(-a**2 + 1) - 1)/a)**n)).simplify() == 0\n \n+    assert rsolve((k + 1)*y(k), y(k)) is None\n+    assert (rsolve((k + 1)*y(k) + (k + 3)*y(k + 1) + (k + 5)*y(k + 2), y(k))\n+            is None)","path":"sympy/solvers/tests/test_recurr.py","position":15,"original_position":15,"commit_id":"9536f2863ce5c1294321b092dfce81dcf0a74fb8","original_commit_id":"9536f2863ce5c1294321b092dfce81dcf0a74fb8","user":{"login":"leosartaj","id":6217976,"avatar_url":"https://avatars.githubusercontent.com/u/6217976?v=3","gravatar_id":"","url":"https://api.github.com/users/leosartaj","html_url":"https://github.com/leosartaj","followers_url":"https://api.github.com/users/leosartaj/followers","following_url":"https://api.github.com/users/leosartaj/following{/other_user}","gists_url":"https://api.github.com/users/leosartaj/gists{/gist_id}","starred_url":"https://api.github.com/users/leosartaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leosartaj/subscriptions","organizations_url":"https://api.github.com/users/leosartaj/orgs","repos_url":"https://api.github.com/users/leosartaj/repos","events_url":"https://api.github.com/users/leosartaj/events{/privacy}","received_events_url":"https://api.github.com/users/leosartaj/received_events","type":"User","site_admin":false},"body":"Docstring of recurr module\r\n\r\n> This module is intended for solving recurrences or, in other words,\r\n    difference equations. Currently supported are linear, inhomogeneous\r\n    equations with polynomial or rational coefficients.\r\n\r\nI guess they fall in this category. So, input is valid.\r\n\r\n> Maybe, but since I am unaware of the algorithm, so I am not sure if it's the right candidate.\r\n\r\nWell, somebody else can help out then.\r\n\r\nThanks btw!","created_at":"2015-07-05T21:15:43Z","updated_at":"2015-07-05T21:15:43Z","html_url":"https://github.com/sympy/sympy/pull/9615#discussion_r33898966","pull_request_url":"https://api.github.com/repos/sympy/sympy/pulls/9615","_links":{"self":{"href":"https://api.github.com/repos/sympy/sympy/pulls/comments/33898966"},"html":{"href":"https://github.com/sympy/sympy/pull/9615#discussion_r33898966"},"pull_request":{"href":"https://api.github.com/repos/sympy/sympy/pulls/9615"}}},"pull_request":{"url":"https://api.github.com/repos/sympy/sympy/pulls/9615","id":39202064,"html_url":"https://github.com/sympy/sympy/pull/9615","diff_url":"https://github.com/sympy/sympy/pull/9615.diff","patch_url":"https://github.com/sympy/sympy/pull/9615.patch","issue_url":"https://api.github.com/repos/sympy/sympy/issues/9615","number":9615,"state":"open","locked":false,"title":"Improved error handling in recurr.rsolve_hyper","user":{"login":"leosartaj","id":6217976,"avatar_url":"https://avatars.githubusercontent.com/u/6217976?v=3","gravatar_id":"","url":"https://api.github.com/users/leosartaj","html_url":"https://github.com/leosartaj","followers_url":"https://api.github.com/users/leosartaj/followers","following_url":"https://api.github.com/users/leosartaj/following{/other_user}","gists_url":"https://api.github.com/users/leosartaj/gists{/gist_id}","starred_url":"https://api.github.com/users/leosartaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leosartaj/subscriptions","organizations_url":"https://api.github.com/users/leosartaj/orgs","repos_url":"https://api.github.com/users/leosartaj/repos","events_url":"https://api.github.com/users/leosartaj/events{/privacy}","received_events_url":"https://api.github.com/users/leosartaj/received_events","type":"User","site_admin":false},"body":"Previously, following cases raised error, now they return ``None``\r\n\r\n```\r\nIn [1]: r1 = (k + 1)*g(k)\r\n\r\nIn [2]: rsolve(r1, g(k))\r\n---------------------------------------------------------------------------\r\nValueError                                Traceback (most recent call last)\r\n<ipython-input-2-9a0672b637aa> in <module>()\r\n----> 1 rsolve(r, g(k))\r\n\r\n/home/leosartaj/projects/sympy/sympy/solvers/recurr.pyc in rsolve(f, y, init)\r\n    785     coeffs = [H_part[i] for i in range(K_max + 1)]\r\n    786 \r\n--> 787     result = rsolve_hyper(coeffs, -i_part, n, symbols=True)\r\n    788 \r\n    789     if result is None:\r\n\r\n/home/leosartaj/projects/sympy/sympy/solvers/recurr.pyc in rsolve_hyper(coeffs, f, n, **hints)\r\n    606                 degrees.append(polys[i].degree())\r\n    607 \r\n--> 608         d, poly = max(degrees), S.Zero\r\n    609 \r\n    610         for i in range(0, r + 1):\r\n\r\nValueError: max() arg is an empty sequence\r\n```\r\n```\r\nIn [3]: r2 = (k + 1)*g(k) + (k + 3)*g(k + 1) + (k + 5)*g(k + 2)\r\n\r\nIn [4]: rsolve(r2, g(k))\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\n<ipython-input-4-20f69c2be462> in <module>()\r\n----> 1 rsolve(r2, g(k))\r\n\r\n/home/leosartaj/projects/sympy/sympy/solvers/recurr.pyc in rsolve(f, y, init)\r\n    785     coeffs = [H_part[i] for i in range(K_max + 1)]\r\n    786 \r\n--> 787     result = rsolve_hyper(coeffs, -i_part, n, symbols=True)\r\n    788 \r\n    789     if result is None:\r\n\r\n/home/leosartaj/projects/sympy/sympy/solvers/recurr.pyc in rsolve_hyper(coeffs, f, n, **hints)\r\n    630                 n0 = 0\r\n    631                 for n_root in roots(ratio.as_numer_denom()[1], n).keys():\r\n--> 632                     if (n0 < (n_root + 1)) == True:\r\n    633                         n0 = n_root + 1\r\n    634                 K = product(ratio, (n, n0, n - 1))\r\n\r\n/home/leosartaj/projects/sympy/sympy/core/expr.pyc in __gt__(self, other)\r\n    278             if (me.is_complex and me.is_real is False) or \\\r\n    279                     me.has(S.ComplexInfinity):\r\n--> 280                 raise TypeError(\"Invalid comparison of complex %s\" % me)\r\n    281             if me is S.NaN:\r\n    282                 raise TypeError(\"Invalid NaN comparison\")\r\n\r\nTypeError: Invalid comparison of complex -1 - sqrt(3)*I/3\r\n\r\n```\r\n\r\nNow, \r\n```\r\n>>> rsolve(r1, g(k))\r\nNone\r\n>>> rsolve(r2, g(k))\r\nNone\r\n```\r\n\r\nPing @flacjacket @jcrist","created_at":"2015-07-04T03:36:35Z","updated_at":"2015-07-05T21:15:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e2609fa289800a4e922069533365a8c85d51080b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sympy/sympy/pulls/9615/commits","review_comments_url":"https://api.github.com/repos/sympy/sympy/pulls/9615/comments","review_comment_url":"https://api.github.com/repos/sympy/sympy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sympy/sympy/issues/9615/comments","statuses_url":"https://api.github.com/repos/sympy/sympy/statuses/9536f2863ce5c1294321b092dfce81dcf0a74fb8","head":{"label":"leosartaj:rsolve-hyper","ref":"rsolve-hyper","sha":"9536f2863ce5c1294321b092dfce81dcf0a74fb8","user":{"login":"leosartaj","id":6217976,"avatar_url":"https://avatars.githubusercontent.com/u/6217976?v=3","gravatar_id":"","url":"https://api.github.com/users/leosartaj","html_url":"https://github.com/leosartaj","followers_url":"https://api.github.com/users/leosartaj/followers","following_url":"https://api.github.com/users/leosartaj/following{/other_user}","gists_url":"https://api.github.com/users/leosartaj/gists{/gist_id}","starred_url":"https://api.github.com/users/leosartaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leosartaj/subscriptions","organizations_url":"https://api.github.com/users/leosartaj/orgs","repos_url":"https://api.github.com/users/leosartaj/repos","events_url":"https://api.github.com/users/leosartaj/events{/privacy}","received_events_url":"https://api.github.com/users/leosartaj/received_events","type":"User","site_admin":false},"repo":{"id":29408196,"name":"sympy","full_name":"leosartaj/sympy","owner":{"login":"leosartaj","id":6217976,"avatar_url":"https://avatars.githubusercontent.com/u/6217976?v=3","gravatar_id":"","url":"https://api.github.com/users/leosartaj","html_url":"https://github.com/leosartaj","followers_url":"https://api.github.com/users/leosartaj/followers","following_url":"https://api.github.com/users/leosartaj/following{/other_user}","gists_url":"https://api.github.com/users/leosartaj/gists{/gist_id}","starred_url":"https://api.github.com/users/leosartaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leosartaj/subscriptions","organizations_url":"https://api.github.com/users/leosartaj/orgs","repos_url":"https://api.github.com/users/leosartaj/repos","events_url":"https://api.github.com/users/leosartaj/events{/privacy}","received_events_url":"https://api.github.com/users/leosartaj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/leosartaj/sympy","description":"A computer algebra system written in pure Python","fork":true,"url":"https://api.github.com/repos/leosartaj/sympy","forks_url":"https://api.github.com/repos/leosartaj/sympy/forks","keys_url":"https://api.github.com/repos/leosartaj/sympy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leosartaj/sympy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leosartaj/sympy/teams","hooks_url":"https://api.github.com/repos/leosartaj/sympy/hooks","issue_events_url":"https://api.github.com/repos/leosartaj/sympy/issues/events{/number}","events_url":"https://api.github.com/repos/leosartaj/sympy/events","assignees_url":"https://api.github.com/repos/leosartaj/sympy/assignees{/user}","branches_url":"https://api.github.com/repos/leosartaj/sympy/branches{/branch}","tags_url":"https://api.github.com/repos/leosartaj/sympy/tags","blobs_url":"https://api.github.com/repos/leosartaj/sympy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leosartaj/sympy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leosartaj/sympy/git/refs{/sha}","trees_url":"https://api.github.com/repos/leosartaj/sympy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leosartaj/sympy/statuses/{sha}","languages_url":"https://api.github.com/repos/leosartaj/sympy/languages","stargazers_url":"https://api.github.com/repos/leosartaj/sympy/stargazers","contributors_url":"https://api.github.com/repos/leosartaj/sympy/contributors","subscribers_url":"https://api.github.com/repos/leosartaj/sympy/subscribers","subscription_url":"https://api.github.com/repos/leosartaj/sympy/subscription","commits_url":"https://api.github.com/repos/leosartaj/sympy/commits{/sha}","git_commits_url":"https://api.github.com/repos/leosartaj/sympy/git/commits{/sha}","comments_url":"https://api.github.com/repos/leosartaj/sympy/comments{/number}","issue_comment_url":"https://api.github.com/repos/leosartaj/sympy/issues/comments{/number}","contents_url":"https://api.github.com/repos/leosartaj/sympy/contents/{+path}","compare_url":"https://api.github.com/repos/leosartaj/sympy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leosartaj/sympy/merges","archive_url":"https://api.github.com/repos/leosartaj/sympy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leosartaj/sympy/downloads","issues_url":"https://api.github.com/repos/leosartaj/sympy/issues{/number}","pulls_url":"https://api.github.com/repos/leosartaj/sympy/pulls{/number}","milestones_url":"https://api.github.com/repos/leosartaj/sympy/milestones{/number}","notifications_url":"https://api.github.com/repos/leosartaj/sympy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leosartaj/sympy/labels{/name}","releases_url":"https://api.github.com/repos/leosartaj/sympy/releases{/id}","created_at":"2015-01-17T22:39:40Z","updated_at":"2015-05-26T14:11:50Z","pushed_at":"2015-07-05T04:02:23Z","git_url":"git://github.com/leosartaj/sympy.git","ssh_url":"git@github.com:leosartaj/sympy.git","clone_url":"https://github.com/leosartaj/sympy.git","svn_url":"https://github.com/leosartaj/sympy","homepage":"http://sympy.org/","size":71242,"stargazers_count":2,"watchers_count":2,"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":2,"default_branch":"master"}},"base":{"label":"sympy:master","ref":"master","sha":"45c2fb138e0ed3d08a4b75e9add1d517c08d983b","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-07-05T11:34:25Z","pushed_at":"2015-07-05T00:12:08Z","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":149555,"stargazers_count":2209,"watchers_count":2209,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1085,"mirror_url":null,"open_issues_count":1952,"forks":1085,"open_issues":1952,"watchers":2209,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sympy/sympy/pulls/9615"},"html":{"href":"https://github.com/sympy/sympy/pull/9615"},"issue":{"href":"https://api.github.com/repos/sympy/sympy/issues/9615"},"comments":{"href":"https://api.github.com/repos/sympy/sympy/issues/9615/comments"},"review_comments":{"href":"https://api.github.com/repos/sympy/sympy/pulls/9615/comments"},"review_comment":{"href":"https://api.github.com/repos/sympy/sympy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sympy/sympy/pulls/9615/commits"},"statuses":{"href":"https://api.github.com/repos/sympy/sympy/statuses/9536f2863ce5c1294321b092dfce81dcf0a74fb8"}}}}