{"action":"created","comment":{"url":"https://api.github.com/repos/IntelPNI/brainiak/pulls/comments/80993225","pull_request_review_id":2007031,"id":80993225,"diff_hunk":"@@ -0,0 +1,353 @@\n+#  Copyright 2016 Intel Corporation\n+#\n+#  Licensed under the Apache License, Version 2.0 (the \"License\");\n+#  you may not use this file except in compliance with the License.\n+#  You may obtain a copy of the License at\n+#\n+#               http://www.apache.org/licenses/LICENSE-2.0\n+#\n+#  Unless required by applicable law or agreed to in writing, software\n+#  distributed under the License is distributed on an \"AS IS\" BASIS,\n+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+#  See the License for the specific language governing permissions and\n+#  limitations under the License.\n+\n+import logging\n+from mpi4py import MPI\n+import numpy as np\n+from sklearn.base import TransformerMixin\n+\n+\"\"\"Distributed searchlight\n+\n+Given a function and a list of volumes, this applies the function\n+to all voxels.\n+\"\"\"\n+\n+# Author: Michael Anderson\n+\n+__all__ = [\n+    \"Searchlight\",\n+]\n+\n+logger = logging.getLogger(__name__)\n+\n+\n+class Searchlight(TransformerMixin):\n+    \"\"\" Class for searchlight.\n+\n+    A searchlight is a computation that is applied in a sliding\n+    window to subsets of voxels across a volume. The radius of the\n+    searchlight specifies how many voxels are involved in each\n+    computation. A user-provided function is applied to all voxels\n+    within the radius, provided that the mask was non-zero at that\n+    point in the volume. The ouput of the searchlight analysis is\n+    another volume which contains the user-provided function's\n+    output at each point.\n+\n+    Parameters\n+    ----------\n+\n+    rad: Positive integer indicating the radius of the searchlight\n+         cube.\n+\n+    fn: A user-provided function which is applied to the data in a\n+    searchlight.\n+        This user-specified function must accept 2 parameters:\n+            data: A list of 4D numpy.ndarray objects which has the same\n+            structure as the 'data' parameter to the searchlight, but\n+            only includes voxels within a 'rad' radius from the current\n+            searchlight center\n+\n+            mask: A 3D numpy.ndarray object with type np.bool indicating\n+            which includes voxels within a 'rad' radius from the current\n+            searchlight center\n+","path":"brainiak/searchlight/searchlight.py","position":63,"original_position":64,"commit_id":"5ae759fa6cf359aa37d2e48f82c05361de7a705e","original_commit_id":"a8729502561be36206db78b96bd00b01bf226740","user":{"login":"mjanderson09","id":2482318,"avatar_url":"https://avatars.githubusercontent.com/u/2482318?v=3","gravatar_id":"","url":"https://api.github.com/users/mjanderson09","html_url":"https://github.com/mjanderson09","followers_url":"https://api.github.com/users/mjanderson09/followers","following_url":"https://api.github.com/users/mjanderson09/following{/other_user}","gists_url":"https://api.github.com/users/mjanderson09/gists{/gist_id}","starred_url":"https://api.github.com/users/mjanderson09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjanderson09/subscriptions","organizations_url":"https://api.github.com/users/mjanderson09/orgs","repos_url":"https://api.github.com/users/mjanderson09/repos","events_url":"https://api.github.com/users/mjanderson09/events{/privacy}","received_events_url":"https://api.github.com/users/mjanderson09/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2016-09-28T19:01:38Z","updated_at":"2016-09-28T19:01:38Z","html_url":"https://github.com/IntelPNI/brainiak/pull/110#discussion_r80993225","pull_request_url":"https://api.github.com/repos/IntelPNI/brainiak/pulls/110","_links":{"self":{"href":"https://api.github.com/repos/IntelPNI/brainiak/pulls/comments/80993225"},"html":{"href":"https://github.com/IntelPNI/brainiak/pull/110#discussion_r80993225"},"pull_request":{"href":"https://api.github.com/repos/IntelPNI/brainiak/pulls/110"}}},"pull_request":{"url":"https://api.github.com/repos/IntelPNI/brainiak/pulls/110","id":86415703,"html_url":"https://github.com/IntelPNI/brainiak/pull/110","diff_url":"https://github.com/IntelPNI/brainiak/pull/110.diff","patch_url":"https://github.com/IntelPNI/brainiak/pull/110.patch","issue_url":"https://api.github.com/repos/IntelPNI/brainiak/issues/110","number":110,"state":"open","locked":false,"title":"added searchlight","user":{"login":"mjanderson09","id":2482318,"avatar_url":"https://avatars.githubusercontent.com/u/2482318?v=3","gravatar_id":"","url":"https://api.github.com/users/mjanderson09","html_url":"https://github.com/mjanderson09","followers_url":"https://api.github.com/users/mjanderson09/followers","following_url":"https://api.github.com/users/mjanderson09/following{/other_user}","gists_url":"https://api.github.com/users/mjanderson09/gists{/gist_id}","starred_url":"https://api.github.com/users/mjanderson09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjanderson09/subscriptions","organizations_url":"https://api.github.com/users/mjanderson09/orgs","repos_url":"https://api.github.com/users/mjanderson09/repos","events_url":"https://api.github.com/users/mjanderson09/events{/privacy}","received_events_url":"https://api.github.com/users/mjanderson09/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-22T21:13:51Z","updated_at":"2016-09-28T19:01:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b65f89f9aac343e5424832c7c2ccd32accb308a1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/IntelPNI/brainiak/pulls/110/commits","review_comments_url":"https://api.github.com/repos/IntelPNI/brainiak/pulls/110/comments","review_comment_url":"https://api.github.com/repos/IntelPNI/brainiak/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IntelPNI/brainiak/issues/110/comments","statuses_url":"https://api.github.com/repos/IntelPNI/brainiak/statuses/5ae759fa6cf359aa37d2e48f82c05361de7a705e","head":{"label":"mjanderson09:distributed_searchlight","ref":"distributed_searchlight","sha":"5ae759fa6cf359aa37d2e48f82c05361de7a705e","user":{"login":"mjanderson09","id":2482318,"avatar_url":"https://avatars.githubusercontent.com/u/2482318?v=3","gravatar_id":"","url":"https://api.github.com/users/mjanderson09","html_url":"https://github.com/mjanderson09","followers_url":"https://api.github.com/users/mjanderson09/followers","following_url":"https://api.github.com/users/mjanderson09/following{/other_user}","gists_url":"https://api.github.com/users/mjanderson09/gists{/gist_id}","starred_url":"https://api.github.com/users/mjanderson09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjanderson09/subscriptions","organizations_url":"https://api.github.com/users/mjanderson09/orgs","repos_url":"https://api.github.com/users/mjanderson09/repos","events_url":"https://api.github.com/users/mjanderson09/events{/privacy}","received_events_url":"https://api.github.com/users/mjanderson09/received_events","type":"User","site_admin":false},"repo":{"id":63658615,"name":"brainiak","full_name":"mjanderson09/brainiak","owner":{"login":"mjanderson09","id":2482318,"avatar_url":"https://avatars.githubusercontent.com/u/2482318?v=3","gravatar_id":"","url":"https://api.github.com/users/mjanderson09","html_url":"https://github.com/mjanderson09","followers_url":"https://api.github.com/users/mjanderson09/followers","following_url":"https://api.github.com/users/mjanderson09/following{/other_user}","gists_url":"https://api.github.com/users/mjanderson09/gists{/gist_id}","starred_url":"https://api.github.com/users/mjanderson09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjanderson09/subscriptions","organizations_url":"https://api.github.com/users/mjanderson09/orgs","repos_url":"https://api.github.com/users/mjanderson09/repos","events_url":"https://api.github.com/users/mjanderson09/events{/privacy}","received_events_url":"https://api.github.com/users/mjanderson09/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mjanderson09/brainiak","description":"Brain Imaging Analysis Kit","fork":true,"url":"https://api.github.com/repos/mjanderson09/brainiak","forks_url":"https://api.github.com/repos/mjanderson09/brainiak/forks","keys_url":"https://api.github.com/repos/mjanderson09/brainiak/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mjanderson09/brainiak/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mjanderson09/brainiak/teams","hooks_url":"https://api.github.com/repos/mjanderson09/brainiak/hooks","issue_events_url":"https://api.github.com/repos/mjanderson09/brainiak/issues/events{/number}","events_url":"https://api.github.com/repos/mjanderson09/brainiak/events","assignees_url":"https://api.github.com/repos/mjanderson09/brainiak/assignees{/user}","branches_url":"https://api.github.com/repos/mjanderson09/brainiak/branches{/branch}","tags_url":"https://api.github.com/repos/mjanderson09/brainiak/tags","blobs_url":"https://api.github.com/repos/mjanderson09/brainiak/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mjanderson09/brainiak/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mjanderson09/brainiak/git/refs{/sha}","trees_url":"https://api.github.com/repos/mjanderson09/brainiak/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mjanderson09/brainiak/statuses/{sha}","languages_url":"https://api.github.com/repos/mjanderson09/brainiak/languages","stargazers_url":"https://api.github.com/repos/mjanderson09/brainiak/stargazers","contributors_url":"https://api.github.com/repos/mjanderson09/brainiak/contributors","subscribers_url":"https://api.github.com/repos/mjanderson09/brainiak/subscribers","subscription_url":"https://api.github.com/repos/mjanderson09/brainiak/subscription","commits_url":"https://api.github.com/repos/mjanderson09/brainiak/commits{/sha}","git_commits_url":"https://api.github.com/repos/mjanderson09/brainiak/git/commits{/sha}","comments_url":"https://api.github.com/repos/mjanderson09/brainiak/comments{/number}","issue_comment_url":"https://api.github.com/repos/mjanderson09/brainiak/issues/comments{/number}","contents_url":"https://api.github.com/repos/mjanderson09/brainiak/contents/{+path}","compare_url":"https://api.github.com/repos/mjanderson09/brainiak/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mjanderson09/brainiak/merges","archive_url":"https://api.github.com/repos/mjanderson09/brainiak/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mjanderson09/brainiak/downloads","issues_url":"https://api.github.com/repos/mjanderson09/brainiak/issues{/number}","pulls_url":"https://api.github.com/repos/mjanderson09/brainiak/pulls{/number}","milestones_url":"https://api.github.com/repos/mjanderson09/brainiak/milestones{/number}","notifications_url":"https://api.github.com/repos/mjanderson09/brainiak/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mjanderson09/brainiak/labels{/name}","releases_url":"https://api.github.com/repos/mjanderson09/brainiak/releases{/id}","deployments_url":"https://api.github.com/repos/mjanderson09/brainiak/deployments","created_at":"2016-07-19T03:52:24Z","updated_at":"2016-07-19T03:52:25Z","pushed_at":"2016-09-28T19:01:10Z","git_url":"git://github.com/mjanderson09/brainiak.git","ssh_url":"git@github.com:mjanderson09/brainiak.git","clone_url":"https://github.com/mjanderson09/brainiak.git","svn_url":"https://github.com/mjanderson09/brainiak","homepage":"","size":259,"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":"IntelPNI:master","ref":"master","sha":"669f041b411c3e601fa525ebae7d806eeb3eba6a","user":{"login":"IntelPNI","id":10767488,"avatar_url":"https://avatars.githubusercontent.com/u/10767488?v=3","gravatar_id":"","url":"https://api.github.com/users/IntelPNI","html_url":"https://github.com/IntelPNI","followers_url":"https://api.github.com/users/IntelPNI/followers","following_url":"https://api.github.com/users/IntelPNI/following{/other_user}","gists_url":"https://api.github.com/users/IntelPNI/gists{/gist_id}","starred_url":"https://api.github.com/users/IntelPNI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IntelPNI/subscriptions","organizations_url":"https://api.github.com/users/IntelPNI/orgs","repos_url":"https://api.github.com/users/IntelPNI/repos","events_url":"https://api.github.com/users/IntelPNI/events{/privacy}","received_events_url":"https://api.github.com/users/IntelPNI/received_events","type":"Organization","site_admin":false},"repo":{"id":51334498,"name":"brainiak","full_name":"IntelPNI/brainiak","owner":{"login":"IntelPNI","id":10767488,"avatar_url":"https://avatars.githubusercontent.com/u/10767488?v=3","gravatar_id":"","url":"https://api.github.com/users/IntelPNI","html_url":"https://github.com/IntelPNI","followers_url":"https://api.github.com/users/IntelPNI/followers","following_url":"https://api.github.com/users/IntelPNI/following{/other_user}","gists_url":"https://api.github.com/users/IntelPNI/gists{/gist_id}","starred_url":"https://api.github.com/users/IntelPNI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IntelPNI/subscriptions","organizations_url":"https://api.github.com/users/IntelPNI/orgs","repos_url":"https://api.github.com/users/IntelPNI/repos","events_url":"https://api.github.com/users/IntelPNI/events{/privacy}","received_events_url":"https://api.github.com/users/IntelPNI/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/IntelPNI/brainiak","description":"Brain Imaging Analysis Kit","fork":false,"url":"https://api.github.com/repos/IntelPNI/brainiak","forks_url":"https://api.github.com/repos/IntelPNI/brainiak/forks","keys_url":"https://api.github.com/repos/IntelPNI/brainiak/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IntelPNI/brainiak/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IntelPNI/brainiak/teams","hooks_url":"https://api.github.com/repos/IntelPNI/brainiak/hooks","issue_events_url":"https://api.github.com/repos/IntelPNI/brainiak/issues/events{/number}","events_url":"https://api.github.com/repos/IntelPNI/brainiak/events","assignees_url":"https://api.github.com/repos/IntelPNI/brainiak/assignees{/user}","branches_url":"https://api.github.com/repos/IntelPNI/brainiak/branches{/branch}","tags_url":"https://api.github.com/repos/IntelPNI/brainiak/tags","blobs_url":"https://api.github.com/repos/IntelPNI/brainiak/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IntelPNI/brainiak/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IntelPNI/brainiak/git/refs{/sha}","trees_url":"https://api.github.com/repos/IntelPNI/brainiak/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IntelPNI/brainiak/statuses/{sha}","languages_url":"https://api.github.com/repos/IntelPNI/brainiak/languages","stargazers_url":"https://api.github.com/repos/IntelPNI/brainiak/stargazers","contributors_url":"https://api.github.com/repos/IntelPNI/brainiak/contributors","subscribers_url":"https://api.github.com/repos/IntelPNI/brainiak/subscribers","subscription_url":"https://api.github.com/repos/IntelPNI/brainiak/subscription","commits_url":"https://api.github.com/repos/IntelPNI/brainiak/commits{/sha}","git_commits_url":"https://api.github.com/repos/IntelPNI/brainiak/git/commits{/sha}","comments_url":"https://api.github.com/repos/IntelPNI/brainiak/comments{/number}","issue_comment_url":"https://api.github.com/repos/IntelPNI/brainiak/issues/comments{/number}","contents_url":"https://api.github.com/repos/IntelPNI/brainiak/contents/{+path}","compare_url":"https://api.github.com/repos/IntelPNI/brainiak/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IntelPNI/brainiak/merges","archive_url":"https://api.github.com/repos/IntelPNI/brainiak/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IntelPNI/brainiak/downloads","issues_url":"https://api.github.com/repos/IntelPNI/brainiak/issues{/number}","pulls_url":"https://api.github.com/repos/IntelPNI/brainiak/pulls{/number}","milestones_url":"https://api.github.com/repos/IntelPNI/brainiak/milestones{/number}","notifications_url":"https://api.github.com/repos/IntelPNI/brainiak/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IntelPNI/brainiak/labels{/name}","releases_url":"https://api.github.com/repos/IntelPNI/brainiak/releases{/id}","deployments_url":"https://api.github.com/repos/IntelPNI/brainiak/deployments","created_at":"2016-02-08T23:19:27Z","updated_at":"2016-09-26T15:38:23Z","pushed_at":"2016-09-28T19:01:11Z","git_url":"git://github.com/IntelPNI/brainiak.git","ssh_url":"git@github.com:IntelPNI/brainiak.git","clone_url":"https://github.com/IntelPNI/brainiak.git","svn_url":"https://github.com/IntelPNI/brainiak","homepage":"","size":992,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":27,"forks":23,"open_issues":27,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/IntelPNI/brainiak/pulls/110"},"html":{"href":"https://github.com/IntelPNI/brainiak/pull/110"},"issue":{"href":"https://api.github.com/repos/IntelPNI/brainiak/issues/110"},"comments":{"href":"https://api.github.com/repos/IntelPNI/brainiak/issues/110/comments"},"review_comments":{"href":"https://api.github.com/repos/IntelPNI/brainiak/pulls/110/comments"},"review_comment":{"href":"https://api.github.com/repos/IntelPNI/brainiak/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IntelPNI/brainiak/pulls/110/commits"},"statuses":{"href":"https://api.github.com/repos/IntelPNI/brainiak/statuses/5ae759fa6cf359aa37d2e48f82c05361de7a705e"}}}}
{"actor":{"display_login":"mjanderson09"}}