{"action":"created","issue":{"url":"https://api.github.com/repos/sympy/sympy/issues/15445","repository_url":"https://api.github.com/repos/sympy/sympy","labels_url":"https://api.github.com/repos/sympy/sympy/issues/15445/labels{/name}","comments_url":"https://api.github.com/repos/sympy/sympy/issues/15445/comments","events_url":"https://api.github.com/repos/sympy/sympy/issues/15445/events","html_url":"https://github.com/sympy/sympy/pull/15445","id":376300470,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI3NTQ3NzY0","number":15445,"title":"Fix issue where solveset throws PolificationError when x cancels out (Edit)","user":{"login":"JMSS-Unknown","id":31131631,"node_id":"MDQ6VXNlcjMxMTMxNjMx","avatar_url":"https://avatars1.githubusercontent.com/u/31131631?v=4","gravatar_id":"","url":"https://api.github.com/users/JMSS-Unknown","html_url":"https://github.com/JMSS-Unknown","followers_url":"https://api.github.com/users/JMSS-Unknown/followers","following_url":"https://api.github.com/users/JMSS-Unknown/following{/other_user}","gists_url":"https://api.github.com/users/JMSS-Unknown/gists{/gist_id}","starred_url":"https://api.github.com/users/JMSS-Unknown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JMSS-Unknown/subscriptions","organizations_url":"https://api.github.com/users/JMSS-Unknown/orgs","repos_url":"https://api.github.com/users/JMSS-Unknown/repos","events_url":"https://api.github.com/users/JMSS-Unknown/events{/privacy}","received_events_url":"https://api.github.com/users/JMSS-Unknown/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-11-01T08:35:08Z","updated_at":"2018-11-15T23:51:38Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/sympy/sympy/pulls/15445","html_url":"https://github.com/sympy/sympy/pull/15445","diff_url":"https://github.com/sympy/sympy/pull/15445.diff","patch_url":"https://github.com/sympy/sympy/pull/15445.patch"},"body":"Fixes #15351\r\n\r\nI deleted my fork so I could no longer edit #15443 \r\nThis is an update to address @asmeurer comment (https://github.com/sympy/sympy/pull/15443#issuecomment-434776485)\r\n<!-- BEGIN RELEASE NOTES -->\r\n* solvers\r\n  * Fixed a bug where solveset would not find the solution when the variable in a polynomial cancels out\r\n<!-- END RELEASE NOTES -->"},"comment":{"url":"https://api.github.com/repos/sympy/sympy/issues/comments/439232493","html_url":"https://github.com/sympy/sympy/pull/15445#issuecomment-439232493","issue_url":"https://api.github.com/repos/sympy/sympy/issues/15445","id":439232493,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTIzMjQ5Mw==","user":{"login":"asmeurer","id":71486,"node_id":"MDQ6VXNlcjcxNDg2","avatar_url":"https://avatars3.githubusercontent.com/u/71486?v=4","gravatar_id":"","url":"https://api.github.com/users/asmeurer","html_url":"https://github.com/asmeurer","followers_url":"https://api.github.com/users/asmeurer/followers","following_url":"https://api.github.com/users/asmeurer/following{/other_user}","gists_url":"https://api.github.com/users/asmeurer/gists{/gist_id}","starred_url":"https://api.github.com/users/asmeurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asmeurer/subscriptions","organizations_url":"https://api.github.com/users/asmeurer/orgs","repos_url":"https://api.github.com/users/asmeurer/repos","events_url":"https://api.github.com/users/asmeurer/events{/privacy}","received_events_url":"https://api.github.com/users/asmeurer/received_events","type":"User","site_admin":false},"created_at":"2018-11-15T23:51:38Z","updated_at":"2018-11-15T23:51:38Z","author_association":"MEMBER","body":"The real bug here is `degree(-2*x*(x + 1) + 2*(x - 1)*(x + 2))`. So we should add a test for it directly. We can also add a test for solveset to make sure it works. \r\n\r\nI don't understand why `poly_from_expr` doesn't have the `gen` argument from degree passed to it. Based on the traceback, changing that should fix the solveset issue. \r\n\r\nMaking `degree(-2*x*(x + 1) + 2*(x - 1)*(x + 2))` without a generator argument should work too. It looks like `PolyficationFailed` stores the expanded polynomial as `expr`. So you can check if it is a constant by inspecting that attribute from the exception. That would be better than calling `expand`, which is already done in `poly_from_expr`, so shouldn't be done again (`expand` can be expensive in general). "}}
{"actor":{"display_login":"asmeurer"}}