{"action":"created","comment":{"url":"https://api.github.com/repos/nipy/dipy/pulls/comments/92020279","pull_request_review_id":12523637,"id":92020279,"diff_hunk":"@@ -1374,10 +1427,12 @@ def ols_fit_tensor(design_matrix, data):\n     \"\"\"\n     tol = 1e-6\n     data = np.asarray(data)\n-    return eig_from_lo_tri(\n-        np.einsum('...ij,...j', np.linalg.pinv(design_matrix), np.log(data)),\n-        min_diffusivity=tol / -design_matrix.min(),\n-    )\n+    fit_result = np.einsum('...ij,...j', np.linalg.pinv(design_matrix), np.log(data))\n+    if return_S0_hat:\n+        return (eig_from_lo_tri(fit_result, min_diffusivity=tol / -design_matrix.min()),\n+                np.exp(-fit_result[:, -1]))\n+    else:\n+        return eig_from_lo_tri(fit_result, min_diffusivity=tol / -design_matrix.min())","path":"dipy/reconst/dti.py","position":207,"original_position":207,"commit_id":"04528b4dcd15123e499d77137600a3d69b1273f0","original_commit_id":"04528b4dcd15123e499d77137600a3d69b1273f0","user":{"login":"RafaelNH","id":5492638,"avatar_url":"https://avatars.githubusercontent.com/u/5492638?v=3","gravatar_id":"","url":"https://api.github.com/users/RafaelNH","html_url":"https://github.com/RafaelNH","followers_url":"https://api.github.com/users/RafaelNH/followers","following_url":"https://api.github.com/users/RafaelNH/following{/other_user}","gists_url":"https://api.github.com/users/RafaelNH/gists{/gist_id}","starred_url":"https://api.github.com/users/RafaelNH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RafaelNH/subscriptions","organizations_url":"https://api.github.com/users/RafaelNH/orgs","repos_url":"https://api.github.com/users/RafaelNH/repos","events_url":"https://api.github.com/users/RafaelNH/events{/privacy}","received_events_url":"https://api.github.com/users/RafaelNH/received_events","type":"User","site_admin":false},"body":"PEP8 too long line","created_at":"2016-12-12T19:25:16Z","updated_at":"2016-12-12T19:27:21Z","html_url":"https://github.com/nipy/dipy/pull/1162#discussion_r92020279","pull_request_url":"https://api.github.com/repos/nipy/dipy/pulls/1162","_links":{"self":{"href":"https://api.github.com/repos/nipy/dipy/pulls/comments/92020279"},"html":{"href":"https://github.com/nipy/dipy/pull/1162#discussion_r92020279"},"pull_request":{"href":"https://api.github.com/repos/nipy/dipy/pulls/1162"}}},"pull_request":{"url":"https://api.github.com/repos/nipy/dipy/pulls/1162","id":97407189,"html_url":"https://github.com/nipy/dipy/pull/1162","diff_url":"https://github.com/nipy/dipy/pull/1162.diff","patch_url":"https://github.com/nipy/dipy/pull/1162.patch","issue_url":"https://api.github.com/repos/nipy/dipy/issues/1162","number":1162,"state":"open","locked":false,"title":"Return S0 value for DTI fits","user":{"login":"etpeterson","id":1086934,"avatar_url":"https://avatars.githubusercontent.com/u/1086934?v=3","gravatar_id":"","url":"https://api.github.com/users/etpeterson","html_url":"https://github.com/etpeterson","followers_url":"https://api.github.com/users/etpeterson/followers","following_url":"https://api.github.com/users/etpeterson/following{/other_user}","gists_url":"https://api.github.com/users/etpeterson/gists{/gist_id}","starred_url":"https://api.github.com/users/etpeterson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etpeterson/subscriptions","organizations_url":"https://api.github.com/users/etpeterson/orgs","repos_url":"https://api.github.com/users/etpeterson/repos","events_url":"https://api.github.com/users/etpeterson/events{/privacy}","received_events_url":"https://api.github.com/users/etpeterson/received_events","type":"User","site_admin":false},"body":"The goal of this PR is to optionally return the S0 (b=0) value for DTI fits without negatively impacting performance or memory unless the S0 is requested. It captures the fitted S0 values generated in the DTI fitting routines and allows the user to access them.\r\n\r\nIt's similar in intent to PR [1036](https://github.com/nipy/dipy/pull/1036) but rather than calculating the S0 values from the fits, it captures the values directly in each fit method.\r\n\r\nMy local tests look like the speed is only slightly slower but keeping the S0 values does increase memory usage because it's another image being saved. I'm timing it using time for the whole fit and finding the size by pickling the fit object so if there's a better way to do that let me know.\r\n\r\nI think it's missing a few tests and probably some documentation but I think the major pieces are there.","created_at":"2016-12-10T01:28:06Z","updated_at":"2016-12-12T19:27:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5ec467eefc61195aaac0574f32d020945b0c70f5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/nipy/dipy/pulls/1162/commits","review_comments_url":"https://api.github.com/repos/nipy/dipy/pulls/1162/comments","review_comment_url":"https://api.github.com/repos/nipy/dipy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nipy/dipy/issues/1162/comments","statuses_url":"https://api.github.com/repos/nipy/dipy/statuses/04528b4dcd15123e499d77137600a3d69b1273f0","head":{"label":"etpeterson:dti_S0","ref":"dti_S0","sha":"04528b4dcd15123e499d77137600a3d69b1273f0","user":{"login":"etpeterson","id":1086934,"avatar_url":"https://avatars.githubusercontent.com/u/1086934?v=3","gravatar_id":"","url":"https://api.github.com/users/etpeterson","html_url":"https://github.com/etpeterson","followers_url":"https://api.github.com/users/etpeterson/followers","following_url":"https://api.github.com/users/etpeterson/following{/other_user}","gists_url":"https://api.github.com/users/etpeterson/gists{/gist_id}","starred_url":"https://api.github.com/users/etpeterson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etpeterson/subscriptions","organizations_url":"https://api.github.com/users/etpeterson/orgs","repos_url":"https://api.github.com/users/etpeterson/repos","events_url":"https://api.github.com/users/etpeterson/events{/privacy}","received_events_url":"https://api.github.com/users/etpeterson/received_events","type":"User","site_admin":false},"repo":{"id":73419871,"name":"dipy","full_name":"etpeterson/dipy","owner":{"login":"etpeterson","id":1086934,"avatar_url":"https://avatars.githubusercontent.com/u/1086934?v=3","gravatar_id":"","url":"https://api.github.com/users/etpeterson","html_url":"https://github.com/etpeterson","followers_url":"https://api.github.com/users/etpeterson/followers","following_url":"https://api.github.com/users/etpeterson/following{/other_user}","gists_url":"https://api.github.com/users/etpeterson/gists{/gist_id}","starred_url":"https://api.github.com/users/etpeterson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etpeterson/subscriptions","organizations_url":"https://api.github.com/users/etpeterson/orgs","repos_url":"https://api.github.com/users/etpeterson/repos","events_url":"https://api.github.com/users/etpeterson/events{/privacy}","received_events_url":"https://api.github.com/users/etpeterson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/etpeterson/dipy","description":"Diffusion MR Imaging in Python","fork":true,"url":"https://api.github.com/repos/etpeterson/dipy","forks_url":"https://api.github.com/repos/etpeterson/dipy/forks","keys_url":"https://api.github.com/repos/etpeterson/dipy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/etpeterson/dipy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/etpeterson/dipy/teams","hooks_url":"https://api.github.com/repos/etpeterson/dipy/hooks","issue_events_url":"https://api.github.com/repos/etpeterson/dipy/issues/events{/number}","events_url":"https://api.github.com/repos/etpeterson/dipy/events","assignees_url":"https://api.github.com/repos/etpeterson/dipy/assignees{/user}","branches_url":"https://api.github.com/repos/etpeterson/dipy/branches{/branch}","tags_url":"https://api.github.com/repos/etpeterson/dipy/tags","blobs_url":"https://api.github.com/repos/etpeterson/dipy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/etpeterson/dipy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/etpeterson/dipy/git/refs{/sha}","trees_url":"https://api.github.com/repos/etpeterson/dipy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/etpeterson/dipy/statuses/{sha}","languages_url":"https://api.github.com/repos/etpeterson/dipy/languages","stargazers_url":"https://api.github.com/repos/etpeterson/dipy/stargazers","contributors_url":"https://api.github.com/repos/etpeterson/dipy/contributors","subscribers_url":"https://api.github.com/repos/etpeterson/dipy/subscribers","subscription_url":"https://api.github.com/repos/etpeterson/dipy/subscription","commits_url":"https://api.github.com/repos/etpeterson/dipy/commits{/sha}","git_commits_url":"https://api.github.com/repos/etpeterson/dipy/git/commits{/sha}","comments_url":"https://api.github.com/repos/etpeterson/dipy/comments{/number}","issue_comment_url":"https://api.github.com/repos/etpeterson/dipy/issues/comments{/number}","contents_url":"https://api.github.com/repos/etpeterson/dipy/contents/{+path}","compare_url":"https://api.github.com/repos/etpeterson/dipy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/etpeterson/dipy/merges","archive_url":"https://api.github.com/repos/etpeterson/dipy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/etpeterson/dipy/downloads","issues_url":"https://api.github.com/repos/etpeterson/dipy/issues{/number}","pulls_url":"https://api.github.com/repos/etpeterson/dipy/pulls{/number}","milestones_url":"https://api.github.com/repos/etpeterson/dipy/milestones{/number}","notifications_url":"https://api.github.com/repos/etpeterson/dipy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/etpeterson/dipy/labels{/name}","releases_url":"https://api.github.com/repos/etpeterson/dipy/releases{/id}","deployments_url":"https://api.github.com/repos/etpeterson/dipy/deployments","created_at":"2016-11-10T20:50:53Z","updated_at":"2016-11-10T20:50:56Z","pushed_at":"2016-12-10T00:43:07Z","git_url":"git://github.com/etpeterson/dipy.git","ssh_url":"git@github.com:etpeterson/dipy.git","clone_url":"https://github.com/etpeterson/dipy.git","svn_url":"https://github.com/etpeterson/dipy","homepage":"http://dipy.org","size":31222,"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":"nipy:master","ref":"master","sha":"e1632e2739335e28026d566321690f5d1dc6452e","user":{"login":"nipy","id":233707,"avatar_url":"https://avatars.githubusercontent.com/u/233707?v=3","gravatar_id":"","url":"https://api.github.com/users/nipy","html_url":"https://github.com/nipy","followers_url":"https://api.github.com/users/nipy/followers","following_url":"https://api.github.com/users/nipy/following{/other_user}","gists_url":"https://api.github.com/users/nipy/gists{/gist_id}","starred_url":"https://api.github.com/users/nipy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nipy/subscriptions","organizations_url":"https://api.github.com/users/nipy/orgs","repos_url":"https://api.github.com/users/nipy/repos","events_url":"https://api.github.com/users/nipy/events{/privacy}","received_events_url":"https://api.github.com/users/nipy/received_events","type":"Organization","site_admin":false},"repo":{"id":505209,"name":"dipy","full_name":"nipy/dipy","owner":{"login":"nipy","id":233707,"avatar_url":"https://avatars.githubusercontent.com/u/233707?v=3","gravatar_id":"","url":"https://api.github.com/users/nipy","html_url":"https://github.com/nipy","followers_url":"https://api.github.com/users/nipy/followers","following_url":"https://api.github.com/users/nipy/following{/other_user}","gists_url":"https://api.github.com/users/nipy/gists{/gist_id}","starred_url":"https://api.github.com/users/nipy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nipy/subscriptions","organizations_url":"https://api.github.com/users/nipy/orgs","repos_url":"https://api.github.com/users/nipy/repos","events_url":"https://api.github.com/users/nipy/events{/privacy}","received_events_url":"https://api.github.com/users/nipy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nipy/dipy","description":"Diffusion MR Imaging in Python","fork":false,"url":"https://api.github.com/repos/nipy/dipy","forks_url":"https://api.github.com/repos/nipy/dipy/forks","keys_url":"https://api.github.com/repos/nipy/dipy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nipy/dipy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nipy/dipy/teams","hooks_url":"https://api.github.com/repos/nipy/dipy/hooks","issue_events_url":"https://api.github.com/repos/nipy/dipy/issues/events{/number}","events_url":"https://api.github.com/repos/nipy/dipy/events","assignees_url":"https://api.github.com/repos/nipy/dipy/assignees{/user}","branches_url":"https://api.github.com/repos/nipy/dipy/branches{/branch}","tags_url":"https://api.github.com/repos/nipy/dipy/tags","blobs_url":"https://api.github.com/repos/nipy/dipy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nipy/dipy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nipy/dipy/git/refs{/sha}","trees_url":"https://api.github.com/repos/nipy/dipy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nipy/dipy/statuses/{sha}","languages_url":"https://api.github.com/repos/nipy/dipy/languages","stargazers_url":"https://api.github.com/repos/nipy/dipy/stargazers","contributors_url":"https://api.github.com/repos/nipy/dipy/contributors","subscribers_url":"https://api.github.com/repos/nipy/dipy/subscribers","subscription_url":"https://api.github.com/repos/nipy/dipy/subscription","commits_url":"https://api.github.com/repos/nipy/dipy/commits{/sha}","git_commits_url":"https://api.github.com/repos/nipy/dipy/git/commits{/sha}","comments_url":"https://api.github.com/repos/nipy/dipy/comments{/number}","issue_comment_url":"https://api.github.com/repos/nipy/dipy/issues/comments{/number}","contents_url":"https://api.github.com/repos/nipy/dipy/contents/{+path}","compare_url":"https://api.github.com/repos/nipy/dipy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nipy/dipy/merges","archive_url":"https://api.github.com/repos/nipy/dipy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nipy/dipy/downloads","issues_url":"https://api.github.com/repos/nipy/dipy/issues{/number}","pulls_url":"https://api.github.com/repos/nipy/dipy/pulls{/number}","milestones_url":"https://api.github.com/repos/nipy/dipy/milestones{/number}","notifications_url":"https://api.github.com/repos/nipy/dipy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nipy/dipy/labels{/name}","releases_url":"https://api.github.com/repos/nipy/dipy/releases{/id}","deployments_url":"https://api.github.com/repos/nipy/dipy/deployments","created_at":"2010-02-06T11:43:08Z","updated_at":"2016-11-10T17:53:58Z","pushed_at":"2016-12-11T23:48:05Z","git_url":"git://github.com/nipy/dipy.git","ssh_url":"git@github.com:nipy/dipy.git","clone_url":"https://github.com/nipy/dipy.git","svn_url":"https://github.com/nipy/dipy","homepage":"http://dipy.org","size":42655,"stargazers_count":101,"watchers_count":101,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":149,"mirror_url":null,"open_issues_count":158,"forks":149,"open_issues":158,"watchers":101,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nipy/dipy/pulls/1162"},"html":{"href":"https://github.com/nipy/dipy/pull/1162"},"issue":{"href":"https://api.github.com/repos/nipy/dipy/issues/1162"},"comments":{"href":"https://api.github.com/repos/nipy/dipy/issues/1162/comments"},"review_comments":{"href":"https://api.github.com/repos/nipy/dipy/pulls/1162/comments"},"review_comment":{"href":"https://api.github.com/repos/nipy/dipy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nipy/dipy/pulls/1162/commits"},"statuses":{"href":"https://api.github.com/repos/nipy/dipy/statuses/04528b4dcd15123e499d77137600a3d69b1273f0"}}}}
{"actor":{"display_login":"RafaelNH"}}