{"action":"created","comment":{"url":"https://api.github.com/repos/nilearn/nilearn/pulls/comments/25240637","id":25240637,"diff_hunk":"@@ -665,7 +665,15 @@ def _unmask_nd(X, mask, order=\"C\"):\n     if mask.dtype != np.bool:\n         raise ValueError(\"mask must be a boolean array\")\n     if X.ndim != 2:\n-        raise ValueError(\"X must be a 2-dimensional array\")\n+        raise TypeError(\"X must be a 2-dimensional array\")\n+    n_features = mask.sum()\n+    if X.shape[-1] != n_features:","path":"nilearn/masking.py","position":16,"original_position":16,"commit_id":"05c420524945de799ebb7bde0f1a1406bde08149","original_commit_id":"05c420524945de799ebb7bde0f1a1406bde08149","user":{"login":"eickenberg","id":1306635,"avatar_url":"https://avatars.githubusercontent.com/u/1306635?v=3","gravatar_id":"","url":"https://api.github.com/users/eickenberg","html_url":"https://github.com/eickenberg","followers_url":"https://api.github.com/users/eickenberg/followers","following_url":"https://api.github.com/users/eickenberg/following{/other_user}","gists_url":"https://api.github.com/users/eickenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/eickenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eickenberg/subscriptions","organizations_url":"https://api.github.com/users/eickenberg/orgs","repos_url":"https://api.github.com/users/eickenberg/repos","events_url":"https://api.github.com/users/eickenberg/events{/privacy}","received_events_url":"https://api.github.com/users/eickenberg/received_events","type":"User","site_admin":false},"body":"Nitpick: Can we have `X.shape[1]` here? (By the previous checks, `X` must be 2D, and it is better to be explicit)","created_at":"2015-02-24T10:02:48Z","updated_at":"2015-02-24T10:02:48Z","html_url":"https://github.com/nilearn/nilearn/pull/459#discussion_r25240637","pull_request_url":"https://api.github.com/repos/nilearn/nilearn/pulls/459","_links":{"self":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/comments/25240637"},"html":{"href":"https://github.com/nilearn/nilearn/pull/459#discussion_r25240637"},"pull_request":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/459"}}},"pull_request":{"url":"https://api.github.com/repos/nilearn/nilearn/pulls/459","id":29883316,"html_url":"https://github.com/nilearn/nilearn/pull/459","diff_url":"https://github.com/nilearn/nilearn/pull/459.diff","patch_url":"https://github.com/nilearn/nilearn/pull/459.patch","issue_url":"https://api.github.com/repos/nilearn/nilearn/issues/459","number":459,"state":"open","locked":false,"title":"Avoid exploding memory on transpose error","user":{"login":"bcipolli","id":4072455,"avatar_url":"https://avatars.githubusercontent.com/u/4072455?v=3","gravatar_id":"","url":"https://api.github.com/users/bcipolli","html_url":"https://github.com/bcipolli","followers_url":"https://api.github.com/users/bcipolli/followers","following_url":"https://api.github.com/users/bcipolli/following{/other_user}","gists_url":"https://api.github.com/users/bcipolli/gists{/gist_id}","starred_url":"https://api.github.com/users/bcipolli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcipolli/subscriptions","organizations_url":"https://api.github.com/users/bcipolli/orgs","repos_url":"https://api.github.com/users/bcipolli/repos","events_url":"https://api.github.com/users/bcipolli/events{/privacy}","received_events_url":"https://api.github.com/users/bcipolli/received_events","type":"User","site_admin":false},"body":"Fix for #458.  Now, a bit more checking occurs before allocating memory:\r\n* If a transposed matrix (n_features, n_slices) is passed in, it is transposed before assignment.\r\n* If a 2D matrix with no dimensions of size `n_features` exists, a friendly error is thrown.\r\n\r\n","created_at":"2015-02-24T09:53:39Z","updated_at":"2015-02-24T10:02:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cb13b958d1093fd25b4b6168255a41ddcaeb221c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nilearn/nilearn/pulls/459/commits","review_comments_url":"https://api.github.com/repos/nilearn/nilearn/pulls/459/comments","review_comment_url":"https://api.github.com/repos/nilearn/nilearn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nilearn/nilearn/issues/459/comments","statuses_url":"https://api.github.com/repos/nilearn/nilearn/statuses/05c420524945de799ebb7bde0f1a1406bde08149","head":{"label":"bcipolli:issue-458","ref":"issue-458","sha":"05c420524945de799ebb7bde0f1a1406bde08149","user":{"login":"bcipolli","id":4072455,"avatar_url":"https://avatars.githubusercontent.com/u/4072455?v=3","gravatar_id":"","url":"https://api.github.com/users/bcipolli","html_url":"https://github.com/bcipolli","followers_url":"https://api.github.com/users/bcipolli/followers","following_url":"https://api.github.com/users/bcipolli/following{/other_user}","gists_url":"https://api.github.com/users/bcipolli/gists{/gist_id}","starred_url":"https://api.github.com/users/bcipolli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcipolli/subscriptions","organizations_url":"https://api.github.com/users/bcipolli/orgs","repos_url":"https://api.github.com/users/bcipolli/repos","events_url":"https://api.github.com/users/bcipolli/events{/privacy}","received_events_url":"https://api.github.com/users/bcipolli/received_events","type":"User","site_admin":false},"repo":{"id":28233031,"name":"nilearn","full_name":"bcipolli/nilearn","owner":{"login":"bcipolli","id":4072455,"avatar_url":"https://avatars.githubusercontent.com/u/4072455?v=3","gravatar_id":"","url":"https://api.github.com/users/bcipolli","html_url":"https://github.com/bcipolli","followers_url":"https://api.github.com/users/bcipolli/followers","following_url":"https://api.github.com/users/bcipolli/following{/other_user}","gists_url":"https://api.github.com/users/bcipolli/gists{/gist_id}","starred_url":"https://api.github.com/users/bcipolli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcipolli/subscriptions","organizations_url":"https://api.github.com/users/bcipolli/orgs","repos_url":"https://api.github.com/users/bcipolli/repos","events_url":"https://api.github.com/users/bcipolli/events{/privacy}","received_events_url":"https://api.github.com/users/bcipolli/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bcipolli/nilearn","description":"Machine learning for NeuroImaging in Python","fork":true,"url":"https://api.github.com/repos/bcipolli/nilearn","forks_url":"https://api.github.com/repos/bcipolli/nilearn/forks","keys_url":"https://api.github.com/repos/bcipolli/nilearn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bcipolli/nilearn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bcipolli/nilearn/teams","hooks_url":"https://api.github.com/repos/bcipolli/nilearn/hooks","issue_events_url":"https://api.github.com/repos/bcipolli/nilearn/issues/events{/number}","events_url":"https://api.github.com/repos/bcipolli/nilearn/events","assignees_url":"https://api.github.com/repos/bcipolli/nilearn/assignees{/user}","branches_url":"https://api.github.com/repos/bcipolli/nilearn/branches{/branch}","tags_url":"https://api.github.com/repos/bcipolli/nilearn/tags","blobs_url":"https://api.github.com/repos/bcipolli/nilearn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bcipolli/nilearn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bcipolli/nilearn/git/refs{/sha}","trees_url":"https://api.github.com/repos/bcipolli/nilearn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bcipolli/nilearn/statuses/{sha}","languages_url":"https://api.github.com/repos/bcipolli/nilearn/languages","stargazers_url":"https://api.github.com/repos/bcipolli/nilearn/stargazers","contributors_url":"https://api.github.com/repos/bcipolli/nilearn/contributors","subscribers_url":"https://api.github.com/repos/bcipolli/nilearn/subscribers","subscription_url":"https://api.github.com/repos/bcipolli/nilearn/subscription","commits_url":"https://api.github.com/repos/bcipolli/nilearn/commits{/sha}","git_commits_url":"https://api.github.com/repos/bcipolli/nilearn/git/commits{/sha}","comments_url":"https://api.github.com/repos/bcipolli/nilearn/comments{/number}","issue_comment_url":"https://api.github.com/repos/bcipolli/nilearn/issues/comments{/number}","contents_url":"https://api.github.com/repos/bcipolli/nilearn/contents/{+path}","compare_url":"https://api.github.com/repos/bcipolli/nilearn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bcipolli/nilearn/merges","archive_url":"https://api.github.com/repos/bcipolli/nilearn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bcipolli/nilearn/downloads","issues_url":"https://api.github.com/repos/bcipolli/nilearn/issues{/number}","pulls_url":"https://api.github.com/repos/bcipolli/nilearn/pulls{/number}","milestones_url":"https://api.github.com/repos/bcipolli/nilearn/milestones{/number}","notifications_url":"https://api.github.com/repos/bcipolli/nilearn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bcipolli/nilearn/labels{/name}","releases_url":"https://api.github.com/repos/bcipolli/nilearn/releases{/id}","created_at":"2014-12-19T14:43:35Z","updated_at":"2015-02-23T21:36:54Z","pushed_at":"2015-02-24T09:42:05Z","git_url":"git://github.com/bcipolli/nilearn.git","ssh_url":"git@github.com:bcipolli/nilearn.git","clone_url":"https://github.com/bcipolli/nilearn.git","svn_url":"https://github.com/bcipolli/nilearn","homepage":"http://nilearn.github.io","size":7185,"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":"nilearn:master","ref":"master","sha":"4805140f9fca73dbee064a334ad038b2233fde06","user":{"login":"nilearn","id":4646912,"avatar_url":"https://avatars.githubusercontent.com/u/4646912?v=3","gravatar_id":"","url":"https://api.github.com/users/nilearn","html_url":"https://github.com/nilearn","followers_url":"https://api.github.com/users/nilearn/followers","following_url":"https://api.github.com/users/nilearn/following{/other_user}","gists_url":"https://api.github.com/users/nilearn/gists{/gist_id}","starred_url":"https://api.github.com/users/nilearn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nilearn/subscriptions","organizations_url":"https://api.github.com/users/nilearn/orgs","repos_url":"https://api.github.com/users/nilearn/repos","events_url":"https://api.github.com/users/nilearn/events{/privacy}","received_events_url":"https://api.github.com/users/nilearn/received_events","type":"Organization","site_admin":false},"repo":{"id":1235740,"name":"nilearn","full_name":"nilearn/nilearn","owner":{"login":"nilearn","id":4646912,"avatar_url":"https://avatars.githubusercontent.com/u/4646912?v=3","gravatar_id":"","url":"https://api.github.com/users/nilearn","html_url":"https://github.com/nilearn","followers_url":"https://api.github.com/users/nilearn/followers","following_url":"https://api.github.com/users/nilearn/following{/other_user}","gists_url":"https://api.github.com/users/nilearn/gists{/gist_id}","starred_url":"https://api.github.com/users/nilearn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nilearn/subscriptions","organizations_url":"https://api.github.com/users/nilearn/orgs","repos_url":"https://api.github.com/users/nilearn/repos","events_url":"https://api.github.com/users/nilearn/events{/privacy}","received_events_url":"https://api.github.com/users/nilearn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nilearn/nilearn","description":"Machine learning for NeuroImaging in Python","fork":false,"url":"https://api.github.com/repos/nilearn/nilearn","forks_url":"https://api.github.com/repos/nilearn/nilearn/forks","keys_url":"https://api.github.com/repos/nilearn/nilearn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nilearn/nilearn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nilearn/nilearn/teams","hooks_url":"https://api.github.com/repos/nilearn/nilearn/hooks","issue_events_url":"https://api.github.com/repos/nilearn/nilearn/issues/events{/number}","events_url":"https://api.github.com/repos/nilearn/nilearn/events","assignees_url":"https://api.github.com/repos/nilearn/nilearn/assignees{/user}","branches_url":"https://api.github.com/repos/nilearn/nilearn/branches{/branch}","tags_url":"https://api.github.com/repos/nilearn/nilearn/tags","blobs_url":"https://api.github.com/repos/nilearn/nilearn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nilearn/nilearn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nilearn/nilearn/git/refs{/sha}","trees_url":"https://api.github.com/repos/nilearn/nilearn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nilearn/nilearn/statuses/{sha}","languages_url":"https://api.github.com/repos/nilearn/nilearn/languages","stargazers_url":"https://api.github.com/repos/nilearn/nilearn/stargazers","contributors_url":"https://api.github.com/repos/nilearn/nilearn/contributors","subscribers_url":"https://api.github.com/repos/nilearn/nilearn/subscribers","subscription_url":"https://api.github.com/repos/nilearn/nilearn/subscription","commits_url":"https://api.github.com/repos/nilearn/nilearn/commits{/sha}","git_commits_url":"https://api.github.com/repos/nilearn/nilearn/git/commits{/sha}","comments_url":"https://api.github.com/repos/nilearn/nilearn/comments{/number}","issue_comment_url":"https://api.github.com/repos/nilearn/nilearn/issues/comments{/number}","contents_url":"https://api.github.com/repos/nilearn/nilearn/contents/{+path}","compare_url":"https://api.github.com/repos/nilearn/nilearn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nilearn/nilearn/merges","archive_url":"https://api.github.com/repos/nilearn/nilearn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nilearn/nilearn/downloads","issues_url":"https://api.github.com/repos/nilearn/nilearn/issues{/number}","pulls_url":"https://api.github.com/repos/nilearn/nilearn/pulls{/number}","milestones_url":"https://api.github.com/repos/nilearn/nilearn/milestones{/number}","notifications_url":"https://api.github.com/repos/nilearn/nilearn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nilearn/nilearn/labels{/name}","releases_url":"https://api.github.com/repos/nilearn/nilearn/releases{/id}","created_at":"2011-01-09T19:02:23Z","updated_at":"2015-02-23T08:08:06Z","pushed_at":"2015-02-23T08:08:05Z","git_url":"git://github.com/nilearn/nilearn.git","ssh_url":"git@github.com:nilearn/nilearn.git","clone_url":"https://github.com/nilearn/nilearn.git","svn_url":"https://github.com/nilearn/nilearn","homepage":"http://nilearn.github.io","size":11248,"stargazers_count":72,"watchers_count":72,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":53,"mirror_url":null,"open_issues_count":70,"forks":53,"open_issues":70,"watchers":72,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/459"},"html":{"href":"https://github.com/nilearn/nilearn/pull/459"},"issue":{"href":"https://api.github.com/repos/nilearn/nilearn/issues/459"},"comments":{"href":"https://api.github.com/repos/nilearn/nilearn/issues/459/comments"},"review_comments":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/459/comments"},"review_comment":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/459/commits"},"statuses":{"href":"https://api.github.com/repos/nilearn/nilearn/statuses/05c420524945de799ebb7bde0f1a1406bde08149"}}}}