{"action":"created","issue":{"url":"https://api.github.com/repos/scipy/scipy/issues/9390","repository_url":"https://api.github.com/repos/scipy/scipy","labels_url":"https://api.github.com/repos/scipy/scipy/issues/9390/labels{/name}","comments_url":"https://api.github.com/repos/scipy/scipy/issues/9390/comments","events_url":"https://api.github.com/repos/scipy/scipy/issues/9390/events","html_url":"https://github.com/scipy/scipy/pull/9390","id":371332294,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIzODAzNzQ2","number":9390,"title":"MAINT: (WIP) Review and strengthen tests for linprog(method='simplex')","user":{"login":"Kai-Striega","id":30074037,"node_id":"MDQ6VXNlcjMwMDc0MDM3","avatar_url":"https://avatars1.githubusercontent.com/u/30074037?v=4","gravatar_id":"","url":"https://api.github.com/users/Kai-Striega","html_url":"https://github.com/Kai-Striega","followers_url":"https://api.github.com/users/Kai-Striega/followers","following_url":"https://api.github.com/users/Kai-Striega/following{/other_user}","gists_url":"https://api.github.com/users/Kai-Striega/gists{/gist_id}","starred_url":"https://api.github.com/users/Kai-Striega/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kai-Striega/subscriptions","organizations_url":"https://api.github.com/users/Kai-Striega/orgs","repos_url":"https://api.github.com/users/Kai-Striega/repos","events_url":"https://api.github.com/users/Kai-Striega/events{/privacy}","received_events_url":"https://api.github.com/users/Kai-Striega/received_events","type":"User","site_admin":false},"labels":[{"id":108549863,"node_id":"MDU6TGFiZWwxMDg1NDk4NjM=","url":"https://api.github.com/repos/scipy/scipy/labels/maintenance","name":"maintenance","color":"fef2c0","default":false},{"id":38890106,"node_id":"MDU6TGFiZWwzODg5MDEwNg==","url":"https://api.github.com/repos/scipy/scipy/labels/query","name":"query","color":"d4c5f9","default":false},{"id":37341011,"node_id":"MDU6TGFiZWwzNzM0MTAxMQ==","url":"https://api.github.com/repos/scipy/scipy/labels/scipy.optimize","name":"scipy.optimize","color":"207de5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-10-18T02:04:31Z","updated_at":"2019-01-05T17:17:56Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/scipy/scipy/pulls/9390","html_url":"https://github.com/scipy/scipy/pull/9390","diff_url":"https://github.com/scipy/scipy/pull/9390.diff","patch_url":"https://github.com/scipy/scipy/pull/9390.patch"},"body":"closes #9268\r\n\r\nThis PR reviews the tests of recent bug fixes in ``linprog(method='simplex')``. \r\n\r\nFurther the PR alters the error checking such that the ``status=4`` (numerical difficulties encountered) instead of raising a `ValueError` when ``status == 2 and is_feasible``. The choice of status is ambiguous and I'd like someone with a little more experience to consider how to handle it (@mdhaber @ilayn @rgommers)\r\n\r\nPhase one of the simplex method fails to find the basic feasible solution if the pseudo-objective function is very slightly greater than `tol`, this isn't really a bug but an issue with the default tolerance (see: #8958). During the conversion back to the original problem via ``_post_solve(...)`` the problem may become feasible again. The resultant solution is sometimes, but not necessarily, optimal.\r\n\r\nMy rational  for choosing ``status=4`` is to be conservative when claiming a successful result. For all cases where this occurs a ``OptimizeWarning`` is raised in ``_apply_pivot(...)`` (see: #9081). Maybe returning a status of 0 (Optimization terminated successfully), with a warning of possible numerical errors is more relevant?\r\n\r\nAn example of this ``TestLinprogSimplexNoPresolve.test_issue_6139`` The pseudo objective function evaluates to ``5.1e-10`` with the tolerance of ``1e-12`` and is therefore not considered close enough to zero to find a basic feasible solution. This is explained in the exit message: \r\n\r\nhttps://github.com/scipy/scipy/blob/1ec1c8ab24d57a5c46adf68b8f6cdae2faa975da/scipy/optimize/_linprog_simplex.py#L595-L603\r\n\r\nThe other failing test  is ``TestLinprogSimplexBland.test_issue_8174``. The test returns a status of 0 and ``success=True``, with the wrong result. A basic feasible solution is correctly found at the end of phase one, however in phase two division by a small pivot value leads to the simplex method \"exploding\".  The pivot value is small enough that a warning is issued:\r\n\r\nhttps://github.com/scipy/scipy/blob/1ec1c8ab24d57a5c46adf68b8f6cdae2faa975da/scipy/optimize/_linprog_simplex.py#L194-L201\r\n\r\nI'm also not quite sure how this should be handled; the test returns the wrong result while claiming it is correct, however a warning is issued notifying the user the solution may be wrong."},"comment":{"url":"https://api.github.com/repos/scipy/scipy/issues/comments/451673275","html_url":"https://github.com/scipy/scipy/pull/9390#issuecomment-451673275","issue_url":"https://api.github.com/repos/scipy/scipy/issues/9390","id":451673275,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTY3MzI3NQ==","user":{"login":"mdhaber","id":6570539,"node_id":"MDQ6VXNlcjY1NzA1Mzk=","avatar_url":"https://avatars1.githubusercontent.com/u/6570539?v=4","gravatar_id":"","url":"https://api.github.com/users/mdhaber","html_url":"https://github.com/mdhaber","followers_url":"https://api.github.com/users/mdhaber/followers","following_url":"https://api.github.com/users/mdhaber/following{/other_user}","gists_url":"https://api.github.com/users/mdhaber/gists{/gist_id}","starred_url":"https://api.github.com/users/mdhaber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdhaber/subscriptions","organizations_url":"https://api.github.com/users/mdhaber/orgs","repos_url":"https://api.github.com/users/mdhaber/repos","events_url":"https://api.github.com/users/mdhaber/events{/privacy}","received_events_url":"https://api.github.com/users/mdhaber/received_events","type":"User","site_admin":false},"created_at":"2019-01-05T17:17:56Z","updated_at":"2019-01-05T17:17:56Z","author_association":"CONTRIBUTOR","body":"@kai-striega yes! Thanks."}}
{"actor":{"display_login":"mdhaber"}}