{"action":"created","comment":{"url":"https://api.github.com/repos/numpy/numpy/pulls/comments/90303231","pull_request_review_id":10824527,"id":90303231,"diff_hunk":"@@ -17,6 +17,22 @@ def test_packbits():\n     assert_raises(TypeError, np.packbits, np.array(a, dtype=float))\n \n \n+def test_packbits_empty():\n+    for dtype in [np.bool, np.uint8, np.int]:","path":"numpy/lib/tests/test_packbits.py","position":5,"original_position":5,"commit_id":"41d10b56d437f4aedd2cdd4c68a0ceb4e32b355d","original_commit_id":"41d10b56d437f4aedd2cdd4c68a0ceb4e32b355d","user":{"login":"charris","id":77272,"avatar_url":"https://avatars.githubusercontent.com/u/77272?v=3","gravatar_id":"","url":"https://api.github.com/users/charris","html_url":"https://github.com/charris","followers_url":"https://api.github.com/users/charris/followers","following_url":"https://api.github.com/users/charris/following{/other_user}","gists_url":"https://api.github.com/users/charris/gists{/gist_id}","starred_url":"https://api.github.com/users/charris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charris/subscriptions","organizations_url":"https://api.github.com/users/charris/orgs","repos_url":"https://api.github.com/users/charris/repos","events_url":"https://api.github.com/users/charris/events{/privacy}","received_events_url":"https://api.github.com/users/charris/received_events","type":"User","site_admin":false},"body":"Also not a good idea to shadow the numpy `dtype` variable. Use something like `dt` instead.","created_at":"2016-11-30T19:03:44Z","updated_at":"2016-11-30T19:03:50Z","html_url":"https://github.com/numpy/numpy/pull/8327#discussion_r90303231","pull_request_url":"https://api.github.com/repos/numpy/numpy/pulls/8327","_links":{"self":{"href":"https://api.github.com/repos/numpy/numpy/pulls/comments/90303231"},"html":{"href":"https://github.com/numpy/numpy/pull/8327#discussion_r90303231"},"pull_request":{"href":"https://api.github.com/repos/numpy/numpy/pulls/8327"}}},"pull_request":{"url":"https://api.github.com/repos/numpy/numpy/pulls/8327","id":95636921,"html_url":"https://github.com/numpy/numpy/pull/8327","diff_url":"https://github.com/numpy/numpy/pull/8327.diff","patch_url":"https://github.com/numpy/numpy/pull/8327.patch","issue_url":"https://api.github.com/repos/numpy/numpy/issues/8327","number":8327,"state":"open","locked":false,"title":"BUG: Fix packbits to correctly handle empty arrays","user":{"login":"iwiwi","id":469803,"avatar_url":"https://avatars.githubusercontent.com/u/469803?v=3","gravatar_id":"","url":"https://api.github.com/users/iwiwi","html_url":"https://github.com/iwiwi","followers_url":"https://api.github.com/users/iwiwi/followers","following_url":"https://api.github.com/users/iwiwi/following{/other_user}","gists_url":"https://api.github.com/users/iwiwi/gists{/gist_id}","starred_url":"https://api.github.com/users/iwiwi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwiwi/subscriptions","organizations_url":"https://api.github.com/users/iwiwi/orgs","repos_url":"https://api.github.com/users/iwiwi/repos","events_url":"https://api.github.com/users/iwiwi/events{/privacy}","received_events_url":"https://api.github.com/users/iwiwi/received_events","type":"User","site_admin":false},"body":"This small PR addresses several problems of `numpy.packbits` pointed out in Issue #8324.\r\n\r\nAs discussed in Issue #8324, `numpy.packbits` have problems with regard to empty input arrays. Specifically:\r\n\r\n* the output does not necessarily always have `uint8` dtype,\r\n* the shape of the returned array is inconsistent when `axis` is specified, and\r\n* there is a leak of an object (`new`).\r\n\r\nThe fundamental reason for these problems is common: function `pack_bits` in `compiled_base.c` handles empty arrays separately, in a rough manner. I could not figure out a good reason why we should handle empty arrays separately. Rather, I found that this part is indeed unnecessary, i.e., without this, `pack_bits` can handle empty arrays correctly, as confirmed in my new tests. So, I propose to remove that part to fix these problems.","created_at":"2016-11-29T07:04:04Z","updated_at":"2016-11-30T19:03:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7d4c4d81ddb7941533cf15bc519b1faa2e3152e2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/numpy/numpy/pulls/8327/commits","review_comments_url":"https://api.github.com/repos/numpy/numpy/pulls/8327/comments","review_comment_url":"https://api.github.com/repos/numpy/numpy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/8327/comments","statuses_url":"https://api.github.com/repos/numpy/numpy/statuses/41d10b56d437f4aedd2cdd4c68a0ceb4e32b355d","head":{"label":"iwiwi:fix-packbits-empty","ref":"fix-packbits-empty","sha":"41d10b56d437f4aedd2cdd4c68a0ceb4e32b355d","user":{"login":"iwiwi","id":469803,"avatar_url":"https://avatars.githubusercontent.com/u/469803?v=3","gravatar_id":"","url":"https://api.github.com/users/iwiwi","html_url":"https://github.com/iwiwi","followers_url":"https://api.github.com/users/iwiwi/followers","following_url":"https://api.github.com/users/iwiwi/following{/other_user}","gists_url":"https://api.github.com/users/iwiwi/gists{/gist_id}","starred_url":"https://api.github.com/users/iwiwi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwiwi/subscriptions","organizations_url":"https://api.github.com/users/iwiwi/orgs","repos_url":"https://api.github.com/users/iwiwi/repos","events_url":"https://api.github.com/users/iwiwi/events{/privacy}","received_events_url":"https://api.github.com/users/iwiwi/received_events","type":"User","site_admin":false},"repo":{"id":75051083,"name":"numpy","full_name":"iwiwi/numpy","owner":{"login":"iwiwi","id":469803,"avatar_url":"https://avatars.githubusercontent.com/u/469803?v=3","gravatar_id":"","url":"https://api.github.com/users/iwiwi","html_url":"https://github.com/iwiwi","followers_url":"https://api.github.com/users/iwiwi/followers","following_url":"https://api.github.com/users/iwiwi/following{/other_user}","gists_url":"https://api.github.com/users/iwiwi/gists{/gist_id}","starred_url":"https://api.github.com/users/iwiwi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwiwi/subscriptions","organizations_url":"https://api.github.com/users/iwiwi/orgs","repos_url":"https://api.github.com/users/iwiwi/repos","events_url":"https://api.github.com/users/iwiwi/events{/privacy}","received_events_url":"https://api.github.com/users/iwiwi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iwiwi/numpy","description":"Numpy main repository","fork":true,"url":"https://api.github.com/repos/iwiwi/numpy","forks_url":"https://api.github.com/repos/iwiwi/numpy/forks","keys_url":"https://api.github.com/repos/iwiwi/numpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iwiwi/numpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iwiwi/numpy/teams","hooks_url":"https://api.github.com/repos/iwiwi/numpy/hooks","issue_events_url":"https://api.github.com/repos/iwiwi/numpy/issues/events{/number}","events_url":"https://api.github.com/repos/iwiwi/numpy/events","assignees_url":"https://api.github.com/repos/iwiwi/numpy/assignees{/user}","branches_url":"https://api.github.com/repos/iwiwi/numpy/branches{/branch}","tags_url":"https://api.github.com/repos/iwiwi/numpy/tags","blobs_url":"https://api.github.com/repos/iwiwi/numpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iwiwi/numpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iwiwi/numpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/iwiwi/numpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iwiwi/numpy/statuses/{sha}","languages_url":"https://api.github.com/repos/iwiwi/numpy/languages","stargazers_url":"https://api.github.com/repos/iwiwi/numpy/stargazers","contributors_url":"https://api.github.com/repos/iwiwi/numpy/contributors","subscribers_url":"https://api.github.com/repos/iwiwi/numpy/subscribers","subscription_url":"https://api.github.com/repos/iwiwi/numpy/subscription","commits_url":"https://api.github.com/repos/iwiwi/numpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/iwiwi/numpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/iwiwi/numpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/iwiwi/numpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/iwiwi/numpy/contents/{+path}","compare_url":"https://api.github.com/repos/iwiwi/numpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iwiwi/numpy/merges","archive_url":"https://api.github.com/repos/iwiwi/numpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iwiwi/numpy/downloads","issues_url":"https://api.github.com/repos/iwiwi/numpy/issues{/number}","pulls_url":"https://api.github.com/repos/iwiwi/numpy/pulls{/number}","milestones_url":"https://api.github.com/repos/iwiwi/numpy/milestones{/number}","notifications_url":"https://api.github.com/repos/iwiwi/numpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iwiwi/numpy/labels{/name}","releases_url":"https://api.github.com/repos/iwiwi/numpy/releases{/id}","deployments_url":"https://api.github.com/repos/iwiwi/numpy/deployments","created_at":"2016-11-29T06:35:35Z","updated_at":"2016-11-29T06:35:41Z","pushed_at":"2016-11-30T02:57:29Z","git_url":"git://github.com/iwiwi/numpy.git","ssh_url":"git@github.com:iwiwi/numpy.git","clone_url":"https://github.com/iwiwi/numpy.git","svn_url":"https://github.com/iwiwi/numpy","homepage":"http://www.numpy.org/","size":44510,"stargazers_count":0,"watchers_count":0,"language":"C","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":"numpy:master","ref":"master","sha":"a4dca241647a31a4313238fa183b67e453c1de0f","user":{"login":"numpy","id":288276,"avatar_url":"https://avatars.githubusercontent.com/u/288276?v=3","gravatar_id":"","url":"https://api.github.com/users/numpy","html_url":"https://github.com/numpy","followers_url":"https://api.github.com/users/numpy/followers","following_url":"https://api.github.com/users/numpy/following{/other_user}","gists_url":"https://api.github.com/users/numpy/gists{/gist_id}","starred_url":"https://api.github.com/users/numpy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numpy/subscriptions","organizations_url":"https://api.github.com/users/numpy/orgs","repos_url":"https://api.github.com/users/numpy/repos","events_url":"https://api.github.com/users/numpy/events{/privacy}","received_events_url":"https://api.github.com/users/numpy/received_events","type":"Organization","site_admin":false},"repo":{"id":908607,"name":"numpy","full_name":"numpy/numpy","owner":{"login":"numpy","id":288276,"avatar_url":"https://avatars.githubusercontent.com/u/288276?v=3","gravatar_id":"","url":"https://api.github.com/users/numpy","html_url":"https://github.com/numpy","followers_url":"https://api.github.com/users/numpy/followers","following_url":"https://api.github.com/users/numpy/following{/other_user}","gists_url":"https://api.github.com/users/numpy/gists{/gist_id}","starred_url":"https://api.github.com/users/numpy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numpy/subscriptions","organizations_url":"https://api.github.com/users/numpy/orgs","repos_url":"https://api.github.com/users/numpy/repos","events_url":"https://api.github.com/users/numpy/events{/privacy}","received_events_url":"https://api.github.com/users/numpy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/numpy/numpy","description":"Numpy main repository","fork":false,"url":"https://api.github.com/repos/numpy/numpy","forks_url":"https://api.github.com/repos/numpy/numpy/forks","keys_url":"https://api.github.com/repos/numpy/numpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/numpy/numpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/numpy/numpy/teams","hooks_url":"https://api.github.com/repos/numpy/numpy/hooks","issue_events_url":"https://api.github.com/repos/numpy/numpy/issues/events{/number}","events_url":"https://api.github.com/repos/numpy/numpy/events","assignees_url":"https://api.github.com/repos/numpy/numpy/assignees{/user}","branches_url":"https://api.github.com/repos/numpy/numpy/branches{/branch}","tags_url":"https://api.github.com/repos/numpy/numpy/tags","blobs_url":"https://api.github.com/repos/numpy/numpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/numpy/numpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/numpy/numpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/numpy/numpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/numpy/numpy/statuses/{sha}","languages_url":"https://api.github.com/repos/numpy/numpy/languages","stargazers_url":"https://api.github.com/repos/numpy/numpy/stargazers","contributors_url":"https://api.github.com/repos/numpy/numpy/contributors","subscribers_url":"https://api.github.com/repos/numpy/numpy/subscribers","subscription_url":"https://api.github.com/repos/numpy/numpy/subscription","commits_url":"https://api.github.com/repos/numpy/numpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/numpy/numpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/numpy/numpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/numpy/numpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/numpy/numpy/contents/{+path}","compare_url":"https://api.github.com/repos/numpy/numpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/numpy/numpy/merges","archive_url":"https://api.github.com/repos/numpy/numpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/numpy/numpy/downloads","issues_url":"https://api.github.com/repos/numpy/numpy/issues{/number}","pulls_url":"https://api.github.com/repos/numpy/numpy/pulls{/number}","milestones_url":"https://api.github.com/repos/numpy/numpy/milestones{/number}","notifications_url":"https://api.github.com/repos/numpy/numpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/numpy/numpy/labels{/name}","releases_url":"https://api.github.com/repos/numpy/numpy/releases{/id}","deployments_url":"https://api.github.com/repos/numpy/numpy/deployments","created_at":"2010-09-13T23:02:39Z","updated_at":"2016-11-30T16:34:23Z","pushed_at":"2016-11-30T02:57:33Z","git_url":"git://github.com/numpy/numpy.git","ssh_url":"git@github.com:numpy/numpy.git","clone_url":"https://github.com/numpy/numpy.git","svn_url":"https://github.com/numpy/numpy","homepage":"http://www.numpy.org/","size":82398,"stargazers_count":3601,"watchers_count":3601,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1808,"mirror_url":null,"open_issues_count":1340,"forks":1808,"open_issues":1340,"watchers":3601,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/numpy/numpy/pulls/8327"},"html":{"href":"https://github.com/numpy/numpy/pull/8327"},"issue":{"href":"https://api.github.com/repos/numpy/numpy/issues/8327"},"comments":{"href":"https://api.github.com/repos/numpy/numpy/issues/8327/comments"},"review_comments":{"href":"https://api.github.com/repos/numpy/numpy/pulls/8327/comments"},"review_comment":{"href":"https://api.github.com/repos/numpy/numpy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/numpy/numpy/pulls/8327/commits"},"statuses":{"href":"https://api.github.com/repos/numpy/numpy/statuses/41d10b56d437f4aedd2cdd4c68a0ceb4e32b355d"}}}}
{"actor":{"display_login":"charris"}}