{"action":"created","comment":{"url":"https://api.github.com/repos/scipy/scipy/pulls/comments/207440127","pull_request_review_id":143052962,"id":207440127,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNzQ0MDEyNw==","diff_hunk":"@@ -802,6 +802,39 @@ def test_bug_5400(self):\n                     method=self.method, options=self.options)\n             _assert_success(res, desired_fun=-106.63507541835018)\n \n+    def test_issue_8174_stackoverflow(self):\n+        # Test supplementary example from issue 8174.\n+        # https://github.com/scipy/scipy/issues/8174\n+        # https://stackoverflow.com/questions/47717012/linprog-in-scipy-optimize-checking-solution\n+        c = np.array([1, 0, 0, 0, 0, 0, 0])\n+        A_ub = -np.identity(7)\n+        b_ub = np.array([[-2],[-2],[-2],[-2],[-2],[-2],[-2]])\n+        A_eq = np.array([\n+            [1, 1, 1, 1, 1, 1, 0],\n+            [0.3, 1.3, 0.9, 0, 0, 0, -1],\n+            [0.3, 0, 0, 0, 0, 0, -2/3],\n+            [0, 0.65, 0, 0, 0, 0, -1/15],\n+            [0, 0, 0.3, 0, 0, 0, -1/15]\n+        ])\n+        b_eq = np.array([[100],[0],[0],[0],[0]])\n+\n+        if self.method == 'interior-point':\n+            # Warning is raised in presolve method,\n+            # which is not yet implemented in the simplex method.\n+            with pytest.warns(OptimizeWarning):\n+                res = linprog(\n+                    c=c, A_ub=A_ub, b_ub=b_ub, A_eq=A_eq, b_eq=b_eq,\n+                    method=self.method, options=self.options\n+                )\n+            _assert_success(res, desired_fun=43.3333333331385)\n+\n+        elif self.method == 'interior-point':","path":"scipy/optimize/tests/test_linprog.py","position":30,"original_position":30,"commit_id":"863d0ed00ceb624f067445ddba580e3b2a9b8d69","original_commit_id":"863d0ed00ceb624f067445ddba580e3b2a9b8d69","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},"body":"@Kai-Striega Shouldn't this just be an `else`? In any case, certainly not `self.method == 'interior-point'`!","created_at":"2018-08-03T04:50:04Z","updated_at":"2018-08-03T04:50:05Z","html_url":"https://github.com/scipy/scipy/pull/9096#discussion_r207440127","pull_request_url":"https://api.github.com/repos/scipy/scipy/pulls/9096","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/scipy/scipy/pulls/comments/207440127"},"html":{"href":"https://github.com/scipy/scipy/pull/9096#discussion_r207440127"},"pull_request":{"href":"https://api.github.com/repos/scipy/scipy/pulls/9096"}}},"pull_request":{"url":"https://api.github.com/repos/scipy/scipy/pulls/9096","id":204991232,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0OTkxMjMy","html_url":"https://github.com/scipy/scipy/pull/9096","diff_url":"https://github.com/scipy/scipy/pull/9096.diff","patch_url":"https://github.com/scipy/scipy/pull/9096.patch","issue_url":"https://api.github.com/repos/scipy/scipy/issues/9096","number":9096,"state":"open","locked":false,"title":"BUG: Add test for Stackoverflow example from issue 8174.","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},"body":"Test of the [stackoverflow issue](https://stackoverflow.com/questions/47717012/linprog-in-scipy-optimize-checking-solution) in issue #8174 as suggested by @mdhaber. The result returned from `linprog(method='simplex')` now matches that of `linprog(method='interior-point')`:\r\n\r\n```python\r\nimport numpy as np\r\nfrom scipy.optimize import linprog\r\nc = np.array([1,0,0,0,0,0,0])\r\nA_ub = np.identity(7)*(-1)\r\nb_ub = np.array([[-2],[-2],[-2],[-2],[-2],[-2],[-2]])\r\nA_eq = np.array([[1,1,1,1,1,1,0],[0.3,1.3,0.9,0,0,0,-1],[0.3,0,0,0,0,0,-2/3],\r\n                 [0,0.65,0,0,0,0,-1/15],[0,0,0.3,0,0,0,-1/15]])\r\nb_eq = np.array([[100],[0],[0],[0],[0]])\r\nres = linprog(c = c, A_ub=A_ub, b_ub=b_ub, A_eq = A_eq, b_eq = b_eq)\r\nprint('Simplex method:')\r\nprint(res)\r\n\r\nprint()\r\nprint('Interior-Point method')\r\nres_ip = linprog(c = c, A_ub=A_ub, b_ub=b_ub, A_eq = A_eq, b_eq = b_eq, method='interior-point')\r\nprint(res_ip)\r\n```\r\n\r\n```python\r\nSimplex method:\r\n     fun: 43.33333333333336\r\n message: 'Optimization terminated successfully.'\r\n     nit: 15\r\n   slack: array([41.33333333,  0.        ,  2.33333333, 44.33333333,  0.        ,\r\n        0.        , 17.5       ])\r\n  status: 0\r\n success: True\r\n       x: array([43.33333333,  2.        ,  4.33333333, 46.33333333,  2.        ,\r\n        2.        , 19.5       ])\r\n\r\nInterior-Point method\r\n     con: array([ 2.79356982e-10, -1.52451385e-11,  3.71258579e-12, -5.92437210e-12,\r\n       -2.36921593e-12])\r\n     fun: 43.33333333313849\r\n message: 'Optimization terminated successfully.'\r\n     nit: 5\r\n   slack: array([4.13333333e+01, 6.92779167e-13, 2.33333333e+00, 1.47777778e+01,\r\n       1.47777778e+01, 1.47777778e+01, 1.75000000e+01])\r\n  status: 0\r\n success: True\r\n       x: array([43.33333333,  2.        ,  4.33333333, 16.77777778, 16.77777778,\r\n       16.77777778, 19.5       ])\r\n```","created_at":"2018-07-31T04:13:45Z","updated_at":"2018-08-03T04:50:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c63befc8d4b63ed894b2325dda6c17767543661e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":37341011,"node_id":"MDU6TGFiZWwzNzM0MTAxMQ==","url":"https://api.github.com/repos/scipy/scipy/labels/scipy.optimize","name":"scipy.optimize","color":"207de5","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/scipy/scipy/pulls/9096/commits","review_comments_url":"https://api.github.com/repos/scipy/scipy/pulls/9096/comments","review_comment_url":"https://api.github.com/repos/scipy/scipy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scipy/scipy/issues/9096/comments","statuses_url":"https://api.github.com/repos/scipy/scipy/statuses/863d0ed00ceb624f067445ddba580e3b2a9b8d69","head":{"label":"Kai-Striega:test_issue_8174_so","ref":"test_issue_8174_so","sha":"863d0ed00ceb624f067445ddba580e3b2a9b8d69","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},"repo":{"id":136250490,"node_id":"MDEwOlJlcG9zaXRvcnkxMzYyNTA0OTA=","name":"scipy","full_name":"Kai-Striega/scipy","owner":{"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},"private":false,"html_url":"https://github.com/Kai-Striega/scipy","description":"Scipy library main repository","fork":true,"url":"https://api.github.com/repos/Kai-Striega/scipy","forks_url":"https://api.github.com/repos/Kai-Striega/scipy/forks","keys_url":"https://api.github.com/repos/Kai-Striega/scipy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kai-Striega/scipy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kai-Striega/scipy/teams","hooks_url":"https://api.github.com/repos/Kai-Striega/scipy/hooks","issue_events_url":"https://api.github.com/repos/Kai-Striega/scipy/issues/events{/number}","events_url":"https://api.github.com/repos/Kai-Striega/scipy/events","assignees_url":"https://api.github.com/repos/Kai-Striega/scipy/assignees{/user}","branches_url":"https://api.github.com/repos/Kai-Striega/scipy/branches{/branch}","tags_url":"https://api.github.com/repos/Kai-Striega/scipy/tags","blobs_url":"https://api.github.com/repos/Kai-Striega/scipy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kai-Striega/scipy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kai-Striega/scipy/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kai-Striega/scipy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kai-Striega/scipy/statuses/{sha}","languages_url":"https://api.github.com/repos/Kai-Striega/scipy/languages","stargazers_url":"https://api.github.com/repos/Kai-Striega/scipy/stargazers","contributors_url":"https://api.github.com/repos/Kai-Striega/scipy/contributors","subscribers_url":"https://api.github.com/repos/Kai-Striega/scipy/subscribers","subscription_url":"https://api.github.com/repos/Kai-Striega/scipy/subscription","commits_url":"https://api.github.com/repos/Kai-Striega/scipy/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kai-Striega/scipy/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kai-Striega/scipy/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kai-Striega/scipy/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kai-Striega/scipy/contents/{+path}","compare_url":"https://api.github.com/repos/Kai-Striega/scipy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kai-Striega/scipy/merges","archive_url":"https://api.github.com/repos/Kai-Striega/scipy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kai-Striega/scipy/downloads","issues_url":"https://api.github.com/repos/Kai-Striega/scipy/issues{/number}","pulls_url":"https://api.github.com/repos/Kai-Striega/scipy/pulls{/number}","milestones_url":"https://api.github.com/repos/Kai-Striega/scipy/milestones{/number}","notifications_url":"https://api.github.com/repos/Kai-Striega/scipy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kai-Striega/scipy/labels{/name}","releases_url":"https://api.github.com/repos/Kai-Striega/scipy/releases{/id}","deployments_url":"https://api.github.com/repos/Kai-Striega/scipy/deployments","created_at":"2018-06-06T00:37:35Z","updated_at":"2018-07-26T06:20:41Z","pushed_at":"2018-08-03T04:35:28Z","git_url":"git://github.com/Kai-Striega/scipy.git","ssh_url":"git@github.com:Kai-Striega/scipy.git","clone_url":"https://github.com/Kai-Striega/scipy.git","svn_url":"https://github.com/Kai-Striega/scipy","homepage":"http://scipy.org/scipylib/","size":79205,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scipy:master","ref":"master","sha":"69bae85ab3855e78f0b55a87281b6841f873f9cf","user":{"login":"scipy","id":288277,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4ODI3Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/288277?v=4","gravatar_id":"","url":"https://api.github.com/users/scipy","html_url":"https://github.com/scipy","followers_url":"https://api.github.com/users/scipy/followers","following_url":"https://api.github.com/users/scipy/following{/other_user}","gists_url":"https://api.github.com/users/scipy/gists{/gist_id}","starred_url":"https://api.github.com/users/scipy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scipy/subscriptions","organizations_url":"https://api.github.com/users/scipy/orgs","repos_url":"https://api.github.com/users/scipy/repos","events_url":"https://api.github.com/users/scipy/events{/privacy}","received_events_url":"https://api.github.com/users/scipy/received_events","type":"Organization","site_admin":false},"repo":{"id":1460385,"node_id":"MDEwOlJlcG9zaXRvcnkxNDYwMzg1","name":"scipy","full_name":"scipy/scipy","owner":{"login":"scipy","id":288277,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4ODI3Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/288277?v=4","gravatar_id":"","url":"https://api.github.com/users/scipy","html_url":"https://github.com/scipy","followers_url":"https://api.github.com/users/scipy/followers","following_url":"https://api.github.com/users/scipy/following{/other_user}","gists_url":"https://api.github.com/users/scipy/gists{/gist_id}","starred_url":"https://api.github.com/users/scipy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scipy/subscriptions","organizations_url":"https://api.github.com/users/scipy/orgs","repos_url":"https://api.github.com/users/scipy/repos","events_url":"https://api.github.com/users/scipy/events{/privacy}","received_events_url":"https://api.github.com/users/scipy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scipy/scipy","description":"Scipy library main repository","fork":false,"url":"https://api.github.com/repos/scipy/scipy","forks_url":"https://api.github.com/repos/scipy/scipy/forks","keys_url":"https://api.github.com/repos/scipy/scipy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scipy/scipy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scipy/scipy/teams","hooks_url":"https://api.github.com/repos/scipy/scipy/hooks","issue_events_url":"https://api.github.com/repos/scipy/scipy/issues/events{/number}","events_url":"https://api.github.com/repos/scipy/scipy/events","assignees_url":"https://api.github.com/repos/scipy/scipy/assignees{/user}","branches_url":"https://api.github.com/repos/scipy/scipy/branches{/branch}","tags_url":"https://api.github.com/repos/scipy/scipy/tags","blobs_url":"https://api.github.com/repos/scipy/scipy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scipy/scipy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scipy/scipy/git/refs{/sha}","trees_url":"https://api.github.com/repos/scipy/scipy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scipy/scipy/statuses/{sha}","languages_url":"https://api.github.com/repos/scipy/scipy/languages","stargazers_url":"https://api.github.com/repos/scipy/scipy/stargazers","contributors_url":"https://api.github.com/repos/scipy/scipy/contributors","subscribers_url":"https://api.github.com/repos/scipy/scipy/subscribers","subscription_url":"https://api.github.com/repos/scipy/scipy/subscription","commits_url":"https://api.github.com/repos/scipy/scipy/commits{/sha}","git_commits_url":"https://api.github.com/repos/scipy/scipy/git/commits{/sha}","comments_url":"https://api.github.com/repos/scipy/scipy/comments{/number}","issue_comment_url":"https://api.github.com/repos/scipy/scipy/issues/comments{/number}","contents_url":"https://api.github.com/repos/scipy/scipy/contents/{+path}","compare_url":"https://api.github.com/repos/scipy/scipy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scipy/scipy/merges","archive_url":"https://api.github.com/repos/scipy/scipy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scipy/scipy/downloads","issues_url":"https://api.github.com/repos/scipy/scipy/issues{/number}","pulls_url":"https://api.github.com/repos/scipy/scipy/pulls{/number}","milestones_url":"https://api.github.com/repos/scipy/scipy/milestones{/number}","notifications_url":"https://api.github.com/repos/scipy/scipy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scipy/scipy/labels{/name}","releases_url":"https://api.github.com/repos/scipy/scipy/releases{/id}","deployments_url":"https://api.github.com/repos/scipy/scipy/deployments","created_at":"2011-03-09T18:52:03Z","updated_at":"2018-08-03T02:22:46Z","pushed_at":"2018-08-03T04:35:32Z","git_url":"git://github.com/scipy/scipy.git","ssh_url":"git@github.com:scipy/scipy.git","clone_url":"https://github.com/scipy/scipy.git","svn_url":"https://github.com/scipy/scipy","homepage":"https://scipy.org/scipylib/","size":81218,"stargazers_count":4760,"watchers_count":4760,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2436,"mirror_url":null,"archived":false,"open_issues_count":1312,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2436,"open_issues":1312,"watchers":4760,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scipy/scipy/pulls/9096"},"html":{"href":"https://github.com/scipy/scipy/pull/9096"},"issue":{"href":"https://api.github.com/repos/scipy/scipy/issues/9096"},"comments":{"href":"https://api.github.com/repos/scipy/scipy/issues/9096/comments"},"review_comments":{"href":"https://api.github.com/repos/scipy/scipy/pulls/9096/comments"},"review_comment":{"href":"https://api.github.com/repos/scipy/scipy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scipy/scipy/pulls/9096/commits"},"statuses":{"href":"https://api.github.com/repos/scipy/scipy/statuses/863d0ed00ceb624f067445ddba580e3b2a9b8d69"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mdhaber"}}