{"action":"created","comment":{"url":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/comments/181279783","pull_request_review_id":111873366,"id":181279783,"diff_hunk":"@@ -141,6 +142,106 @@ def testDirichletExpectation(self):\n                 self.assertTrue(np.allclose(known_good, test_values), msg)\n \n \n+def manual_unitvec(vec):\n+    # manual unit vector calculation for UnitvecTestCase\n+    vec = vec.astype(np.float)\n+    if sparse.issparse(vec):\n+        vec_sum_of_squares = vec.multiply(vec)\n+        unit = 1. / np.sqrt(vec_sum_of_squares.sum())\n+        return vec.multiply(unit)\n+    elif not sparse.issparse(vec):\n+        sum_vec_squared = np.sum(vec ** 2)\n+        vec /= np.sqrt(sum_vec_squared)\n+        return vec\n+\n+\n+class UnitvecTestCase(unittest.TestCase):","path":"gensim/test/test_matutils.py","position":25,"original_position":25,"commit_id":"a42cf38eb5c7461dc9d4ff08a223c3b30d99905c","original_commit_id":"a42cf38eb5c7461dc9d4ff08a223c3b30d99905c","user":{"login":"jayantj","id":1329532,"avatar_url":"https://avatars0.githubusercontent.com/u/1329532?v=4","gravatar_id":"","url":"https://api.github.com/users/jayantj","html_url":"https://github.com/jayantj","followers_url":"https://api.github.com/users/jayantj/followers","following_url":"https://api.github.com/users/jayantj/following{/other_user}","gists_url":"https://api.github.com/users/jayantj/gists{/gist_id}","starred_url":"https://api.github.com/users/jayantj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayantj/subscriptions","organizations_url":"https://api.github.com/users/jayantj/orgs","repos_url":"https://api.github.com/users/jayantj/repos","events_url":"https://api.github.com/users/jayantj/events{/privacy}","received_events_url":"https://api.github.com/users/jayantj/received_events","type":"User","site_admin":false},"body":"Thanks for reorganizing the tests! Looks much better now IMO","created_at":"2018-04-13T03:45:29Z","updated_at":"2018-04-13T03:45:30Z","html_url":"https://github.com/RaRe-Technologies/gensim/pull/1992#discussion_r181279783","pull_request_url":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1992","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/comments/181279783"},"html":{"href":"https://github.com/RaRe-Technologies/gensim/pull/1992#discussion_r181279783"},"pull_request":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1992"}}},"pull_request":{"url":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1992","id":176589214,"html_url":"https://github.com/RaRe-Technologies/gensim/pull/1992","diff_url":"https://github.com/RaRe-Technologies/gensim/pull/1992.diff","patch_url":"https://github.com/RaRe-Technologies/gensim/pull/1992.patch","issue_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/1992","number":1992,"state":"open","locked":false,"title":"Bug-fix attempt (matutils.unitvec): input float32 returning different dtype","user":{"login":"o-P-o","id":35378674,"avatar_url":"https://avatars3.githubusercontent.com/u/35378674?v=4","gravatar_id":"","url":"https://api.github.com/users/o-P-o","html_url":"https://github.com/o-P-o","followers_url":"https://api.github.com/users/o-P-o/followers","following_url":"https://api.github.com/users/o-P-o/following{/other_user}","gists_url":"https://api.github.com/users/o-P-o/gists{/gist_id}","starred_url":"https://api.github.com/users/o-P-o/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/o-P-o/subscriptions","organizations_url":"https://api.github.com/users/o-P-o/orgs","repos_url":"https://api.github.com/users/o-P-o/repos","events_url":"https://api.github.com/users/o-P-o/events{/privacy}","received_events_url":"https://api.github.com/users/o-P-o/received_events","type":"User","site_admin":false},"body":"This returns the float32 dtypes for float32 inputs for both normal and sparse arrays. The output unit vectors are also the same as those outputted from doing manual unit vector calculations.\r\n\r\nHow does this look? Any further suggestions for improvement or why this isn't acceptable?","created_at":"2018-03-21T19:42:24Z","updated_at":"2018-04-13T03:45:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"577d50bebd7a959e5904cb5ea3c8a377338d2f40","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1992/commits","review_comments_url":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1992/comments","review_comment_url":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/1992/comments","statuses_url":"https://api.github.com/repos/RaRe-Technologies/gensim/statuses/a42cf38eb5c7461dc9d4ff08a223c3b30d99905c","head":{"label":"o-P-o:develop","ref":"develop","sha":"a42cf38eb5c7461dc9d4ff08a223c3b30d99905c","user":{"login":"o-P-o","id":35378674,"avatar_url":"https://avatars3.githubusercontent.com/u/35378674?v=4","gravatar_id":"","url":"https://api.github.com/users/o-P-o","html_url":"https://github.com/o-P-o","followers_url":"https://api.github.com/users/o-P-o/followers","following_url":"https://api.github.com/users/o-P-o/following{/other_user}","gists_url":"https://api.github.com/users/o-P-o/gists{/gist_id}","starred_url":"https://api.github.com/users/o-P-o/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/o-P-o/subscriptions","organizations_url":"https://api.github.com/users/o-P-o/orgs","repos_url":"https://api.github.com/users/o-P-o/repos","events_url":"https://api.github.com/users/o-P-o/events{/privacy}","received_events_url":"https://api.github.com/users/o-P-o/received_events","type":"User","site_admin":false},"repo":{"id":117608482,"name":"gensim","full_name":"o-P-o/gensim","owner":{"login":"o-P-o","id":35378674,"avatar_url":"https://avatars3.githubusercontent.com/u/35378674?v=4","gravatar_id":"","url":"https://api.github.com/users/o-P-o","html_url":"https://github.com/o-P-o","followers_url":"https://api.github.com/users/o-P-o/followers","following_url":"https://api.github.com/users/o-P-o/following{/other_user}","gists_url":"https://api.github.com/users/o-P-o/gists{/gist_id}","starred_url":"https://api.github.com/users/o-P-o/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/o-P-o/subscriptions","organizations_url":"https://api.github.com/users/o-P-o/orgs","repos_url":"https://api.github.com/users/o-P-o/repos","events_url":"https://api.github.com/users/o-P-o/events{/privacy}","received_events_url":"https://api.github.com/users/o-P-o/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/o-P-o/gensim","description":"Topic Modelling for Humans","fork":true,"url":"https://api.github.com/repos/o-P-o/gensim","forks_url":"https://api.github.com/repos/o-P-o/gensim/forks","keys_url":"https://api.github.com/repos/o-P-o/gensim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/o-P-o/gensim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/o-P-o/gensim/teams","hooks_url":"https://api.github.com/repos/o-P-o/gensim/hooks","issue_events_url":"https://api.github.com/repos/o-P-o/gensim/issues/events{/number}","events_url":"https://api.github.com/repos/o-P-o/gensim/events","assignees_url":"https://api.github.com/repos/o-P-o/gensim/assignees{/user}","branches_url":"https://api.github.com/repos/o-P-o/gensim/branches{/branch}","tags_url":"https://api.github.com/repos/o-P-o/gensim/tags","blobs_url":"https://api.github.com/repos/o-P-o/gensim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/o-P-o/gensim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/o-P-o/gensim/git/refs{/sha}","trees_url":"https://api.github.com/repos/o-P-o/gensim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/o-P-o/gensim/statuses/{sha}","languages_url":"https://api.github.com/repos/o-P-o/gensim/languages","stargazers_url":"https://api.github.com/repos/o-P-o/gensim/stargazers","contributors_url":"https://api.github.com/repos/o-P-o/gensim/contributors","subscribers_url":"https://api.github.com/repos/o-P-o/gensim/subscribers","subscription_url":"https://api.github.com/repos/o-P-o/gensim/subscription","commits_url":"https://api.github.com/repos/o-P-o/gensim/commits{/sha}","git_commits_url":"https://api.github.com/repos/o-P-o/gensim/git/commits{/sha}","comments_url":"https://api.github.com/repos/o-P-o/gensim/comments{/number}","issue_comment_url":"https://api.github.com/repos/o-P-o/gensim/issues/comments{/number}","contents_url":"https://api.github.com/repos/o-P-o/gensim/contents/{+path}","compare_url":"https://api.github.com/repos/o-P-o/gensim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/o-P-o/gensim/merges","archive_url":"https://api.github.com/repos/o-P-o/gensim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/o-P-o/gensim/downloads","issues_url":"https://api.github.com/repos/o-P-o/gensim/issues{/number}","pulls_url":"https://api.github.com/repos/o-P-o/gensim/pulls{/number}","milestones_url":"https://api.github.com/repos/o-P-o/gensim/milestones{/number}","notifications_url":"https://api.github.com/repos/o-P-o/gensim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/o-P-o/gensim/labels{/name}","releases_url":"https://api.github.com/repos/o-P-o/gensim/releases{/id}","deployments_url":"https://api.github.com/repos/o-P-o/gensim/deployments","created_at":"2018-01-15T23:59:09Z","updated_at":"2018-04-12T20:21:45Z","pushed_at":"2018-04-12T20:21:43Z","git_url":"git://github.com/o-P-o/gensim.git","ssh_url":"git@github.com:o-P-o/gensim.git","clone_url":"https://github.com/o-P-o/gensim.git","svn_url":"https://github.com/o-P-o/gensim","homepage":"","size":62277,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"RaRe-Technologies:develop","ref":"develop","sha":"2e08f4d3b218c9675d4f842f724af40a4f4ec1ee","user":{"login":"RaRe-Technologies","id":12515886,"avatar_url":"https://avatars3.githubusercontent.com/u/12515886?v=4","gravatar_id":"","url":"https://api.github.com/users/RaRe-Technologies","html_url":"https://github.com/RaRe-Technologies","followers_url":"https://api.github.com/users/RaRe-Technologies/followers","following_url":"https://api.github.com/users/RaRe-Technologies/following{/other_user}","gists_url":"https://api.github.com/users/RaRe-Technologies/gists{/gist_id}","starred_url":"https://api.github.com/users/RaRe-Technologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaRe-Technologies/subscriptions","organizations_url":"https://api.github.com/users/RaRe-Technologies/orgs","repos_url":"https://api.github.com/users/RaRe-Technologies/repos","events_url":"https://api.github.com/users/RaRe-Technologies/events{/privacy}","received_events_url":"https://api.github.com/users/RaRe-Technologies/received_events","type":"Organization","site_admin":false},"repo":{"id":1349775,"name":"gensim","full_name":"RaRe-Technologies/gensim","owner":{"login":"RaRe-Technologies","id":12515886,"avatar_url":"https://avatars3.githubusercontent.com/u/12515886?v=4","gravatar_id":"","url":"https://api.github.com/users/RaRe-Technologies","html_url":"https://github.com/RaRe-Technologies","followers_url":"https://api.github.com/users/RaRe-Technologies/followers","following_url":"https://api.github.com/users/RaRe-Technologies/following{/other_user}","gists_url":"https://api.github.com/users/RaRe-Technologies/gists{/gist_id}","starred_url":"https://api.github.com/users/RaRe-Technologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaRe-Technologies/subscriptions","organizations_url":"https://api.github.com/users/RaRe-Technologies/orgs","repos_url":"https://api.github.com/users/RaRe-Technologies/repos","events_url":"https://api.github.com/users/RaRe-Technologies/events{/privacy}","received_events_url":"https://api.github.com/users/RaRe-Technologies/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RaRe-Technologies/gensim","description":"Topic Modelling for Humans","fork":false,"url":"https://api.github.com/repos/RaRe-Technologies/gensim","forks_url":"https://api.github.com/repos/RaRe-Technologies/gensim/forks","keys_url":"https://api.github.com/repos/RaRe-Technologies/gensim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RaRe-Technologies/gensim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RaRe-Technologies/gensim/teams","hooks_url":"https://api.github.com/repos/RaRe-Technologies/gensim/hooks","issue_events_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/events{/number}","events_url":"https://api.github.com/repos/RaRe-Technologies/gensim/events","assignees_url":"https://api.github.com/repos/RaRe-Technologies/gensim/assignees{/user}","branches_url":"https://api.github.com/repos/RaRe-Technologies/gensim/branches{/branch}","tags_url":"https://api.github.com/repos/RaRe-Technologies/gensim/tags","blobs_url":"https://api.github.com/repos/RaRe-Technologies/gensim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RaRe-Technologies/gensim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RaRe-Technologies/gensim/git/refs{/sha}","trees_url":"https://api.github.com/repos/RaRe-Technologies/gensim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RaRe-Technologies/gensim/statuses/{sha}","languages_url":"https://api.github.com/repos/RaRe-Technologies/gensim/languages","stargazers_url":"https://api.github.com/repos/RaRe-Technologies/gensim/stargazers","contributors_url":"https://api.github.com/repos/RaRe-Technologies/gensim/contributors","subscribers_url":"https://api.github.com/repos/RaRe-Technologies/gensim/subscribers","subscription_url":"https://api.github.com/repos/RaRe-Technologies/gensim/subscription","commits_url":"https://api.github.com/repos/RaRe-Technologies/gensim/commits{/sha}","git_commits_url":"https://api.github.com/repos/RaRe-Technologies/gensim/git/commits{/sha}","comments_url":"https://api.github.com/repos/RaRe-Technologies/gensim/comments{/number}","issue_comment_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/comments{/number}","contents_url":"https://api.github.com/repos/RaRe-Technologies/gensim/contents/{+path}","compare_url":"https://api.github.com/repos/RaRe-Technologies/gensim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RaRe-Technologies/gensim/merges","archive_url":"https://api.github.com/repos/RaRe-Technologies/gensim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RaRe-Technologies/gensim/downloads","issues_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues{/number}","pulls_url":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls{/number}","milestones_url":"https://api.github.com/repos/RaRe-Technologies/gensim/milestones{/number}","notifications_url":"https://api.github.com/repos/RaRe-Technologies/gensim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RaRe-Technologies/gensim/labels{/name}","releases_url":"https://api.github.com/repos/RaRe-Technologies/gensim/releases{/id}","deployments_url":"https://api.github.com/repos/RaRe-Technologies/gensim/deployments","created_at":"2011-02-10T07:43:04Z","updated_at":"2018-04-13T03:33:57Z","pushed_at":"2018-04-13T03:33:52Z","git_url":"git://github.com/RaRe-Technologies/gensim.git","ssh_url":"git@github.com:RaRe-Technologies/gensim.git","clone_url":"https://github.com/RaRe-Technologies/gensim.git","svn_url":"https://github.com/RaRe-Technologies/gensim","homepage":"","size":62836,"stargazers_count":6753,"watchers_count":6753,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2597,"mirror_url":null,"archived":false,"open_issues_count":168,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1"},"forks":2597,"open_issues":168,"watchers":6753,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1992"},"html":{"href":"https://github.com/RaRe-Technologies/gensim/pull/1992"},"issue":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/1992"},"comments":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/1992/comments"},"review_comments":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1992/comments"},"review_comment":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1992/commits"},"statuses":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/statuses/a42cf38eb5c7461dc9d4ff08a223c3b30d99905c"}},"author_association":"NONE"}}
{"actor":{"display_login":"jayantj"}}