{"action":"created","comment":{"url":"https://api.github.com/repos/numba/numba/pulls/comments/67850161","id":67850161,"diff_hunk":"@@ -1261,3 +1266,117 @@ def lstsq_impl(a, b, rcond=-1.0):\n         return (x, res, rank, s[:minmn])\n \n     return lstsq_impl\n+\n+# specialisations for np.linalg.solve\n+\n+\n+def _get_solve_compute_return_impl(b):\n+    # gets an implementation for extracting 'x' (the solution) from\n+    # the 'b' scratch space\n+    ndim = b.ndim\n+    if ndim == 1:\n+        @jit(nopython=True)\n+        def oneD_impl(b):\n+            return b.T.ravel()\n+        return oneD_impl\n+    else:\n+        @jit(nopython=True)\n+        def twoD_impl(b):\n+            return b\n+        return twoD_impl\n+\n+\n+@overload(np.linalg.solve)\n+def solve_impl(a, b):\n+    ensure_lapack()\n+\n+    _check_linalg_matrix(a, \"solve\")\n+    _check_linalg_1_or_2d_matrix(b, \"solve\")\n+\n+    a_F_layout = a.layout == 'F'\n+    b_F_layout = b.layout == 'F'\n+\n+    # the typing context is not easily accessible in `@overload` mode\n+    # so type unification etc. is done manually below\n+    a_np_dt = np_support.as_dtype(a.dtype)\n+    b_np_dt = np_support.as_dtype(b.dtype)\n+\n+    np_shared_dt = np.promote_types(a_np_dt, b_np_dt)","path":"numba/targets/linalg.py","position":246,"original_position":246,"commit_id":"45b3b6f7e6928e3f6a61471d16a49fabecafd119","original_commit_id":"45b3b6f7e6928e3f6a61471d16a49fabecafd119","user":{"login":"pitrou","id":1721820,"avatar_url":"https://avatars.githubusercontent.com/u/1721820?v=3","gravatar_id":"","url":"https://api.github.com/users/pitrou","html_url":"https://github.com/pitrou","followers_url":"https://api.github.com/users/pitrou/followers","following_url":"https://api.github.com/users/pitrou/following{/other_user}","gists_url":"https://api.github.com/users/pitrou/gists{/gist_id}","starred_url":"https://api.github.com/users/pitrou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pitrou/subscriptions","organizations_url":"https://api.github.com/users/pitrou/orgs","repos_url":"https://api.github.com/users/pitrou/repos","events_url":"https://api.github.com/users/pitrou/events{/privacy}","received_events_url":"https://api.github.com/users/pitrou/received_events","type":"User","site_admin":false},"body":"As a matter of fact, `astype` does a copy, so you are copying twice. I would think it's better to let users know that they are doing something suboptimal, but I have no hard feelings about it.","created_at":"2016-06-21T11:19:29Z","updated_at":"2016-06-21T11:19:29Z","html_url":"https://github.com/numba/numba/pull/1947#discussion_r67850161","pull_request_url":"https://api.github.com/repos/numba/numba/pulls/1947","_links":{"self":{"href":"https://api.github.com/repos/numba/numba/pulls/comments/67850161"},"html":{"href":"https://github.com/numba/numba/pull/1947#discussion_r67850161"},"pull_request":{"href":"https://api.github.com/repos/numba/numba/pulls/1947"}}},"pull_request":{"url":"https://api.github.com/repos/numba/numba/pulls/1947","id":74581460,"html_url":"https://github.com/numba/numba/pull/1947","diff_url":"https://github.com/numba/numba/pull/1947.diff","patch_url":"https://github.com/numba/numba/pull/1947.patch","issue_url":"https://api.github.com/repos/numba/numba/issues/1947","number":1947,"state":"open","locked":false,"title":"Implement `numpy.linalg.solve()`.","user":{"login":"stuartarchibald","id":907717,"avatar_url":"https://avatars.githubusercontent.com/u/907717?v=3","gravatar_id":"","url":"https://api.github.com/users/stuartarchibald","html_url":"https://github.com/stuartarchibald","followers_url":"https://api.github.com/users/stuartarchibald/followers","following_url":"https://api.github.com/users/stuartarchibald/following{/other_user}","gists_url":"https://api.github.com/users/stuartarchibald/gists{/gist_id}","starred_url":"https://api.github.com/users/stuartarchibald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stuartarchibald/subscriptions","organizations_url":"https://api.github.com/users/stuartarchibald/orgs","repos_url":"https://api.github.com/users/stuartarchibald/repos","events_url":"https://api.github.com/users/stuartarchibald/events{/privacy}","received_events_url":"https://api.github.com/users/stuartarchibald/received_events","type":"User","site_admin":false},"body":"This implements `numpy.linalg.solve()` and refactors the code in\r\nplaces where functions can be shared with `numpy.linalg.lstsq()`.","created_at":"2016-06-21T09:49:44Z","updated_at":"2016-06-21T11:19:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"604c879c0b6d3e0a1bd11061faacb6e2c38a54af","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/numba/numba/pulls/1947/commits","review_comments_url":"https://api.github.com/repos/numba/numba/pulls/1947/comments","review_comment_url":"https://api.github.com/repos/numba/numba/pulls/comments{/number}","comments_url":"https://api.github.com/repos/numba/numba/issues/1947/comments","statuses_url":"https://api.github.com/repos/numba/numba/statuses/45b3b6f7e6928e3f6a61471d16a49fabecafd119","head":{"label":"stuartarchibald:stage/linalg_solve_impl","ref":"stage/linalg_solve_impl","sha":"45b3b6f7e6928e3f6a61471d16a49fabecafd119","user":{"login":"stuartarchibald","id":907717,"avatar_url":"https://avatars.githubusercontent.com/u/907717?v=3","gravatar_id":"","url":"https://api.github.com/users/stuartarchibald","html_url":"https://github.com/stuartarchibald","followers_url":"https://api.github.com/users/stuartarchibald/followers","following_url":"https://api.github.com/users/stuartarchibald/following{/other_user}","gists_url":"https://api.github.com/users/stuartarchibald/gists{/gist_id}","starred_url":"https://api.github.com/users/stuartarchibald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stuartarchibald/subscriptions","organizations_url":"https://api.github.com/users/stuartarchibald/orgs","repos_url":"https://api.github.com/users/stuartarchibald/repos","events_url":"https://api.github.com/users/stuartarchibald/events{/privacy}","received_events_url":"https://api.github.com/users/stuartarchibald/received_events","type":"User","site_admin":false},"repo":{"id":44982242,"name":"numba","full_name":"stuartarchibald/numba","owner":{"login":"stuartarchibald","id":907717,"avatar_url":"https://avatars.githubusercontent.com/u/907717?v=3","gravatar_id":"","url":"https://api.github.com/users/stuartarchibald","html_url":"https://github.com/stuartarchibald","followers_url":"https://api.github.com/users/stuartarchibald/followers","following_url":"https://api.github.com/users/stuartarchibald/following{/other_user}","gists_url":"https://api.github.com/users/stuartarchibald/gists{/gist_id}","starred_url":"https://api.github.com/users/stuartarchibald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stuartarchibald/subscriptions","organizations_url":"https://api.github.com/users/stuartarchibald/orgs","repos_url":"https://api.github.com/users/stuartarchibald/repos","events_url":"https://api.github.com/users/stuartarchibald/events{/privacy}","received_events_url":"https://api.github.com/users/stuartarchibald/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stuartarchibald/numba","description":"NumPy aware dynamic Python compiler using LLVM","fork":true,"url":"https://api.github.com/repos/stuartarchibald/numba","forks_url":"https://api.github.com/repos/stuartarchibald/numba/forks","keys_url":"https://api.github.com/repos/stuartarchibald/numba/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stuartarchibald/numba/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stuartarchibald/numba/teams","hooks_url":"https://api.github.com/repos/stuartarchibald/numba/hooks","issue_events_url":"https://api.github.com/repos/stuartarchibald/numba/issues/events{/number}","events_url":"https://api.github.com/repos/stuartarchibald/numba/events","assignees_url":"https://api.github.com/repos/stuartarchibald/numba/assignees{/user}","branches_url":"https://api.github.com/repos/stuartarchibald/numba/branches{/branch}","tags_url":"https://api.github.com/repos/stuartarchibald/numba/tags","blobs_url":"https://api.github.com/repos/stuartarchibald/numba/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stuartarchibald/numba/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stuartarchibald/numba/git/refs{/sha}","trees_url":"https://api.github.com/repos/stuartarchibald/numba/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stuartarchibald/numba/statuses/{sha}","languages_url":"https://api.github.com/repos/stuartarchibald/numba/languages","stargazers_url":"https://api.github.com/repos/stuartarchibald/numba/stargazers","contributors_url":"https://api.github.com/repos/stuartarchibald/numba/contributors","subscribers_url":"https://api.github.com/repos/stuartarchibald/numba/subscribers","subscription_url":"https://api.github.com/repos/stuartarchibald/numba/subscription","commits_url":"https://api.github.com/repos/stuartarchibald/numba/commits{/sha}","git_commits_url":"https://api.github.com/repos/stuartarchibald/numba/git/commits{/sha}","comments_url":"https://api.github.com/repos/stuartarchibald/numba/comments{/number}","issue_comment_url":"https://api.github.com/repos/stuartarchibald/numba/issues/comments{/number}","contents_url":"https://api.github.com/repos/stuartarchibald/numba/contents/{+path}","compare_url":"https://api.github.com/repos/stuartarchibald/numba/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stuartarchibald/numba/merges","archive_url":"https://api.github.com/repos/stuartarchibald/numba/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stuartarchibald/numba/downloads","issues_url":"https://api.github.com/repos/stuartarchibald/numba/issues{/number}","pulls_url":"https://api.github.com/repos/stuartarchibald/numba/pulls{/number}","milestones_url":"https://api.github.com/repos/stuartarchibald/numba/milestones{/number}","notifications_url":"https://api.github.com/repos/stuartarchibald/numba/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stuartarchibald/numba/labels{/name}","releases_url":"https://api.github.com/repos/stuartarchibald/numba/releases{/id}","deployments_url":"https://api.github.com/repos/stuartarchibald/numba/deployments","created_at":"2015-10-26T16:36:31Z","updated_at":"2016-01-15T11:19:31Z","pushed_at":"2016-06-21T09:45:53Z","git_url":"git://github.com/stuartarchibald/numba.git","ssh_url":"git@github.com:stuartarchibald/numba.git","clone_url":"https://github.com/stuartarchibald/numba.git","svn_url":"https://github.com/stuartarchibald/numba","homepage":"http://numba.pydata.org/","size":29334,"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":"numba:master","ref":"master","sha":"796cae552035b34dd110fe14b08ac0ade444cd30","user":{"login":"numba","id":1628082,"avatar_url":"https://avatars.githubusercontent.com/u/1628082?v=3","gravatar_id":"","url":"https://api.github.com/users/numba","html_url":"https://github.com/numba","followers_url":"https://api.github.com/users/numba/followers","following_url":"https://api.github.com/users/numba/following{/other_user}","gists_url":"https://api.github.com/users/numba/gists{/gist_id}","starred_url":"https://api.github.com/users/numba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numba/subscriptions","organizations_url":"https://api.github.com/users/numba/orgs","repos_url":"https://api.github.com/users/numba/repos","events_url":"https://api.github.com/users/numba/events{/privacy}","received_events_url":"https://api.github.com/users/numba/received_events","type":"Organization","site_admin":false},"repo":{"id":3659275,"name":"numba","full_name":"numba/numba","owner":{"login":"numba","id":1628082,"avatar_url":"https://avatars.githubusercontent.com/u/1628082?v=3","gravatar_id":"","url":"https://api.github.com/users/numba","html_url":"https://github.com/numba","followers_url":"https://api.github.com/users/numba/followers","following_url":"https://api.github.com/users/numba/following{/other_user}","gists_url":"https://api.github.com/users/numba/gists{/gist_id}","starred_url":"https://api.github.com/users/numba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numba/subscriptions","organizations_url":"https://api.github.com/users/numba/orgs","repos_url":"https://api.github.com/users/numba/repos","events_url":"https://api.github.com/users/numba/events{/privacy}","received_events_url":"https://api.github.com/users/numba/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/numba/numba","description":"NumPy aware dynamic Python compiler using LLVM","fork":false,"url":"https://api.github.com/repos/numba/numba","forks_url":"https://api.github.com/repos/numba/numba/forks","keys_url":"https://api.github.com/repos/numba/numba/keys{/key_id}","collaborators_url":"https://api.github.com/repos/numba/numba/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/numba/numba/teams","hooks_url":"https://api.github.com/repos/numba/numba/hooks","issue_events_url":"https://api.github.com/repos/numba/numba/issues/events{/number}","events_url":"https://api.github.com/repos/numba/numba/events","assignees_url":"https://api.github.com/repos/numba/numba/assignees{/user}","branches_url":"https://api.github.com/repos/numba/numba/branches{/branch}","tags_url":"https://api.github.com/repos/numba/numba/tags","blobs_url":"https://api.github.com/repos/numba/numba/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/numba/numba/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/numba/numba/git/refs{/sha}","trees_url":"https://api.github.com/repos/numba/numba/git/trees{/sha}","statuses_url":"https://api.github.com/repos/numba/numba/statuses/{sha}","languages_url":"https://api.github.com/repos/numba/numba/languages","stargazers_url":"https://api.github.com/repos/numba/numba/stargazers","contributors_url":"https://api.github.com/repos/numba/numba/contributors","subscribers_url":"https://api.github.com/repos/numba/numba/subscribers","subscription_url":"https://api.github.com/repos/numba/numba/subscription","commits_url":"https://api.github.com/repos/numba/numba/commits{/sha}","git_commits_url":"https://api.github.com/repos/numba/numba/git/commits{/sha}","comments_url":"https://api.github.com/repos/numba/numba/comments{/number}","issue_comment_url":"https://api.github.com/repos/numba/numba/issues/comments{/number}","contents_url":"https://api.github.com/repos/numba/numba/contents/{+path}","compare_url":"https://api.github.com/repos/numba/numba/compare/{base}...{head}","merges_url":"https://api.github.com/repos/numba/numba/merges","archive_url":"https://api.github.com/repos/numba/numba/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/numba/numba/downloads","issues_url":"https://api.github.com/repos/numba/numba/issues{/number}","pulls_url":"https://api.github.com/repos/numba/numba/pulls{/number}","milestones_url":"https://api.github.com/repos/numba/numba/milestones{/number}","notifications_url":"https://api.github.com/repos/numba/numba/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/numba/numba/labels{/name}","releases_url":"https://api.github.com/repos/numba/numba/releases{/id}","deployments_url":"https://api.github.com/repos/numba/numba/deployments","created_at":"2012-03-08T11:12:43Z","updated_at":"2016-06-20T08:24:50Z","pushed_at":"2016-06-21T11:17:37Z","git_url":"git://github.com/numba/numba.git","ssh_url":"git@github.com:numba/numba.git","clone_url":"https://github.com/numba/numba.git","svn_url":"https://github.com/numba/numba","homepage":"http://numba.pydata.org/","size":35243,"stargazers_count":1853,"watchers_count":1853,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":202,"mirror_url":null,"open_issues_count":198,"forks":202,"open_issues":198,"watchers":1853,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/numba/numba/pulls/1947"},"html":{"href":"https://github.com/numba/numba/pull/1947"},"issue":{"href":"https://api.github.com/repos/numba/numba/issues/1947"},"comments":{"href":"https://api.github.com/repos/numba/numba/issues/1947/comments"},"review_comments":{"href":"https://api.github.com/repos/numba/numba/pulls/1947/comments"},"review_comment":{"href":"https://api.github.com/repos/numba/numba/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/numba/numba/pulls/1947/commits"},"statuses":{"href":"https://api.github.com/repos/numba/numba/statuses/45b3b6f7e6928e3f6a61471d16a49fabecafd119"}}}}
{"actor":{"display_login":"pitrou"}}