{"action":"created","comment":{"url":"https://api.github.com/repos/pymc-devs/pymc3/pulls/comments/195924595","pull_request_review_id":129385151,"id":195924595,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTkyNDU5NQ==","diff_hunk":"@@ -154,13 +153,20 @@ def __init__(self, alpha, beta, n, *args, **kwargs):\n \n     def _random(self, alpha, beta, n, size=None):\n         size = size or 1\n-        p = np.atleast_1d(stats.beta.rvs(a=alpha, b=beta, size=np.prod(size)))\n+        p = stats.beta.rvs(a=alpha, b=beta, size=size).flatten()\n         # Sometimes scipy.beta returns nan. Ugh.\n         while np.any(np.isnan(p)):\n             i = np.isnan(p)\n             p[i] = stats.beta.rvs(a=alpha, b=beta, size=np.sum(i))\n         # Sigh...\n-        _n, _p, _size = np.atleast_1d(n).flatten(), p.flatten(), np.prod(size)\n+        _n, _p, _size = np.atleast_1d(n).flatten(), p.flatten(), p.shape[0]\n+\n+        quotient, remainder = divmod(_p.shape[0], _n.shape[0])","path":"pymc3/distributions/discrete.py","position":28,"original_position":28,"commit_id":"9f2db8938edda5cea53f840fc2ad65b785393cd9","original_commit_id":"9f2db8938edda5cea53f840fc2ad65b785393cd9","user":{"login":"ColCarroll","id":2295568,"node_id":"MDQ6VXNlcjIyOTU1Njg=","avatar_url":"https://avatars3.githubusercontent.com/u/2295568?v=4","gravatar_id":"","url":"https://api.github.com/users/ColCarroll","html_url":"https://github.com/ColCarroll","followers_url":"https://api.github.com/users/ColCarroll/followers","following_url":"https://api.github.com/users/ColCarroll/following{/other_user}","gists_url":"https://api.github.com/users/ColCarroll/gists{/gist_id}","starred_url":"https://api.github.com/users/ColCarroll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ColCarroll/subscriptions","organizations_url":"https://api.github.com/users/ColCarroll/orgs","repos_url":"https://api.github.com/users/ColCarroll/repos","events_url":"https://api.github.com/users/ColCarroll/events{/privacy}","received_events_url":"https://api.github.com/users/ColCarroll/received_events","type":"User","site_admin":false},"body":"oddly, it is a built-in!  so long as `_p` and `_n` are integers, this should be fine (and they are `flatten`ed just above, so this should be fine).  ","created_at":"2018-06-17T10:20:31Z","updated_at":"2018-06-17T10:20:31Z","html_url":"https://github.com/pymc-devs/pymc3/pull/2983#discussion_r195924595","pull_request_url":"https://api.github.com/repos/pymc-devs/pymc3/pulls/2983","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/pymc-devs/pymc3/pulls/comments/195924595"},"html":{"href":"https://github.com/pymc-devs/pymc3/pull/2983#discussion_r195924595"},"pull_request":{"href":"https://api.github.com/repos/pymc-devs/pymc3/pulls/2983"}},"in_reply_to_id":195919313},"pull_request":{"url":"https://api.github.com/repos/pymc-devs/pymc3/pulls/2983","id":189152765,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg5MTUyNzY1","html_url":"https://github.com/pymc-devs/pymc3/pull/2983","diff_url":"https://github.com/pymc-devs/pymc3/pull/2983.diff","patch_url":"https://github.com/pymc-devs/pymc3/pull/2983.patch","issue_url":"https://api.github.com/repos/pymc-devs/pymc3/issues/2983","number":2983,"state":"open","locked":false,"title":"Add sample_generative function","user":{"login":"ColCarroll","id":2295568,"node_id":"MDQ6VXNlcjIyOTU1Njg=","avatar_url":"https://avatars3.githubusercontent.com/u/2295568?v=4","gravatar_id":"","url":"https://api.github.com/users/ColCarroll","html_url":"https://github.com/ColCarroll","followers_url":"https://api.github.com/users/ColCarroll/followers","following_url":"https://api.github.com/users/ColCarroll/following{/other_user}","gists_url":"https://api.github.com/users/ColCarroll/gists{/gist_id}","starred_url":"https://api.github.com/users/ColCarroll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ColCarroll/subscriptions","organizations_url":"https://api.github.com/users/ColCarroll/orgs","repos_url":"https://api.github.com/users/ColCarroll/repos","events_url":"https://api.github.com/users/ColCarroll/events{/privacy}","received_events_url":"https://api.github.com/users/ColCarroll/received_events","type":"User","site_admin":false},"body":"This replaces #2876, since @springcoil's recent improvements to `draw_values` (#2979) makes this somewhat easier.  Includes a test, plus two more I had written for `draw_values`.  Both of them actually failed without changes here.\r\n\r\nThis method is quite fast now.","created_at":"2018-05-18T23:02:20Z","updated_at":"2018-06-17T10:20:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b74ff99c4c931760b39e7d7d9bf0cfcd90a35b24","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":818212053,"node_id":"MDU6TGFiZWw4MTgyMTIwNTM=","url":"https://api.github.com/repos/pymc-devs/pymc3/labels/request_review/discussion","name":"request_review/discussion","color":"dbef5b","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/pymc-devs/pymc3/pulls/2983/commits","review_comments_url":"https://api.github.com/repos/pymc-devs/pymc3/pulls/2983/comments","review_comment_url":"https://api.github.com/repos/pymc-devs/pymc3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pymc-devs/pymc3/issues/2983/comments","statuses_url":"https://api.github.com/repos/pymc-devs/pymc3/statuses/9f2db8938edda5cea53f840fc2ad65b785393cd9","head":{"label":"ColCarroll:sample_generative","ref":"sample_generative","sha":"9f2db8938edda5cea53f840fc2ad65b785393cd9","user":{"login":"ColCarroll","id":2295568,"node_id":"MDQ6VXNlcjIyOTU1Njg=","avatar_url":"https://avatars3.githubusercontent.com/u/2295568?v=4","gravatar_id":"","url":"https://api.github.com/users/ColCarroll","html_url":"https://github.com/ColCarroll","followers_url":"https://api.github.com/users/ColCarroll/followers","following_url":"https://api.github.com/users/ColCarroll/following{/other_user}","gists_url":"https://api.github.com/users/ColCarroll/gists{/gist_id}","starred_url":"https://api.github.com/users/ColCarroll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ColCarroll/subscriptions","organizations_url":"https://api.github.com/users/ColCarroll/orgs","repos_url":"https://api.github.com/users/ColCarroll/repos","events_url":"https://api.github.com/users/ColCarroll/events{/privacy}","received_events_url":"https://api.github.com/users/ColCarroll/received_events","type":"User","site_admin":false},"repo":{"id":67369742,"node_id":"MDEwOlJlcG9zaXRvcnk2NzM2OTc0Mg==","name":"pymc3","full_name":"ColCarroll/pymc3","owner":{"login":"ColCarroll","id":2295568,"node_id":"MDQ6VXNlcjIyOTU1Njg=","avatar_url":"https://avatars3.githubusercontent.com/u/2295568?v=4","gravatar_id":"","url":"https://api.github.com/users/ColCarroll","html_url":"https://github.com/ColCarroll","followers_url":"https://api.github.com/users/ColCarroll/followers","following_url":"https://api.github.com/users/ColCarroll/following{/other_user}","gists_url":"https://api.github.com/users/ColCarroll/gists{/gist_id}","starred_url":"https://api.github.com/users/ColCarroll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ColCarroll/subscriptions","organizations_url":"https://api.github.com/users/ColCarroll/orgs","repos_url":"https://api.github.com/users/ColCarroll/repos","events_url":"https://api.github.com/users/ColCarroll/events{/privacy}","received_events_url":"https://api.github.com/users/ColCarroll/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ColCarroll/pymc3","description":"Probabilistic Programming in Python. Uses Theano as a backend, supports NUTS and ADVI.","fork":true,"url":"https://api.github.com/repos/ColCarroll/pymc3","forks_url":"https://api.github.com/repos/ColCarroll/pymc3/forks","keys_url":"https://api.github.com/repos/ColCarroll/pymc3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ColCarroll/pymc3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ColCarroll/pymc3/teams","hooks_url":"https://api.github.com/repos/ColCarroll/pymc3/hooks","issue_events_url":"https://api.github.com/repos/ColCarroll/pymc3/issues/events{/number}","events_url":"https://api.github.com/repos/ColCarroll/pymc3/events","assignees_url":"https://api.github.com/repos/ColCarroll/pymc3/assignees{/user}","branches_url":"https://api.github.com/repos/ColCarroll/pymc3/branches{/branch}","tags_url":"https://api.github.com/repos/ColCarroll/pymc3/tags","blobs_url":"https://api.github.com/repos/ColCarroll/pymc3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ColCarroll/pymc3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ColCarroll/pymc3/git/refs{/sha}","trees_url":"https://api.github.com/repos/ColCarroll/pymc3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ColCarroll/pymc3/statuses/{sha}","languages_url":"https://api.github.com/repos/ColCarroll/pymc3/languages","stargazers_url":"https://api.github.com/repos/ColCarroll/pymc3/stargazers","contributors_url":"https://api.github.com/repos/ColCarroll/pymc3/contributors","subscribers_url":"https://api.github.com/repos/ColCarroll/pymc3/subscribers","subscription_url":"https://api.github.com/repos/ColCarroll/pymc3/subscription","commits_url":"https://api.github.com/repos/ColCarroll/pymc3/commits{/sha}","git_commits_url":"https://api.github.com/repos/ColCarroll/pymc3/git/commits{/sha}","comments_url":"https://api.github.com/repos/ColCarroll/pymc3/comments{/number}","issue_comment_url":"https://api.github.com/repos/ColCarroll/pymc3/issues/comments{/number}","contents_url":"https://api.github.com/repos/ColCarroll/pymc3/contents/{+path}","compare_url":"https://api.github.com/repos/ColCarroll/pymc3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ColCarroll/pymc3/merges","archive_url":"https://api.github.com/repos/ColCarroll/pymc3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ColCarroll/pymc3/downloads","issues_url":"https://api.github.com/repos/ColCarroll/pymc3/issues{/number}","pulls_url":"https://api.github.com/repos/ColCarroll/pymc3/pulls{/number}","milestones_url":"https://api.github.com/repos/ColCarroll/pymc3/milestones{/number}","notifications_url":"https://api.github.com/repos/ColCarroll/pymc3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ColCarroll/pymc3/labels{/name}","releases_url":"https://api.github.com/repos/ColCarroll/pymc3/releases{/id}","deployments_url":"https://api.github.com/repos/ColCarroll/pymc3/deployments","created_at":"2016-09-04T21:42:03Z","updated_at":"2018-05-10T00:24:19Z","pushed_at":"2018-06-16T23:39:19Z","git_url":"git://github.com/ColCarroll/pymc3.git","ssh_url":"git@github.com:ColCarroll/pymc3.git","clone_url":"https://github.com/ColCarroll/pymc3.git","svn_url":"https://github.com/ColCarroll/pymc3","homepage":"http://pymc-devs.github.io/pymc3/","size":227500,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"pymc-devs:master","ref":"master","sha":"260a0f79f6eb64372ea7a604fdda020a81cc0373","user":{"login":"pymc-devs","id":81121,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxMTIx","avatar_url":"https://avatars3.githubusercontent.com/u/81121?v=4","gravatar_id":"","url":"https://api.github.com/users/pymc-devs","html_url":"https://github.com/pymc-devs","followers_url":"https://api.github.com/users/pymc-devs/followers","following_url":"https://api.github.com/users/pymc-devs/following{/other_user}","gists_url":"https://api.github.com/users/pymc-devs/gists{/gist_id}","starred_url":"https://api.github.com/users/pymc-devs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pymc-devs/subscriptions","organizations_url":"https://api.github.com/users/pymc-devs/orgs","repos_url":"https://api.github.com/users/pymc-devs/repos","events_url":"https://api.github.com/users/pymc-devs/events{/privacy}","received_events_url":"https://api.github.com/users/pymc-devs/received_events","type":"Organization","site_admin":false},"repo":{"id":192904,"node_id":"MDEwOlJlcG9zaXRvcnkxOTI5MDQ=","name":"pymc3","full_name":"pymc-devs/pymc3","owner":{"login":"pymc-devs","id":81121,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxMTIx","avatar_url":"https://avatars3.githubusercontent.com/u/81121?v=4","gravatar_id":"","url":"https://api.github.com/users/pymc-devs","html_url":"https://github.com/pymc-devs","followers_url":"https://api.github.com/users/pymc-devs/followers","following_url":"https://api.github.com/users/pymc-devs/following{/other_user}","gists_url":"https://api.github.com/users/pymc-devs/gists{/gist_id}","starred_url":"https://api.github.com/users/pymc-devs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pymc-devs/subscriptions","organizations_url":"https://api.github.com/users/pymc-devs/orgs","repos_url":"https://api.github.com/users/pymc-devs/repos","events_url":"https://api.github.com/users/pymc-devs/events{/privacy}","received_events_url":"https://api.github.com/users/pymc-devs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pymc-devs/pymc3","description":"Probabilistic Programming in Python: Bayesian Modeling and Probabilistic Machine Learning with Theano","fork":false,"url":"https://api.github.com/repos/pymc-devs/pymc3","forks_url":"https://api.github.com/repos/pymc-devs/pymc3/forks","keys_url":"https://api.github.com/repos/pymc-devs/pymc3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pymc-devs/pymc3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pymc-devs/pymc3/teams","hooks_url":"https://api.github.com/repos/pymc-devs/pymc3/hooks","issue_events_url":"https://api.github.com/repos/pymc-devs/pymc3/issues/events{/number}","events_url":"https://api.github.com/repos/pymc-devs/pymc3/events","assignees_url":"https://api.github.com/repos/pymc-devs/pymc3/assignees{/user}","branches_url":"https://api.github.com/repos/pymc-devs/pymc3/branches{/branch}","tags_url":"https://api.github.com/repos/pymc-devs/pymc3/tags","blobs_url":"https://api.github.com/repos/pymc-devs/pymc3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pymc-devs/pymc3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pymc-devs/pymc3/git/refs{/sha}","trees_url":"https://api.github.com/repos/pymc-devs/pymc3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pymc-devs/pymc3/statuses/{sha}","languages_url":"https://api.github.com/repos/pymc-devs/pymc3/languages","stargazers_url":"https://api.github.com/repos/pymc-devs/pymc3/stargazers","contributors_url":"https://api.github.com/repos/pymc-devs/pymc3/contributors","subscribers_url":"https://api.github.com/repos/pymc-devs/pymc3/subscribers","subscription_url":"https://api.github.com/repos/pymc-devs/pymc3/subscription","commits_url":"https://api.github.com/repos/pymc-devs/pymc3/commits{/sha}","git_commits_url":"https://api.github.com/repos/pymc-devs/pymc3/git/commits{/sha}","comments_url":"https://api.github.com/repos/pymc-devs/pymc3/comments{/number}","issue_comment_url":"https://api.github.com/repos/pymc-devs/pymc3/issues/comments{/number}","contents_url":"https://api.github.com/repos/pymc-devs/pymc3/contents/{+path}","compare_url":"https://api.github.com/repos/pymc-devs/pymc3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pymc-devs/pymc3/merges","archive_url":"https://api.github.com/repos/pymc-devs/pymc3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pymc-devs/pymc3/downloads","issues_url":"https://api.github.com/repos/pymc-devs/pymc3/issues{/number}","pulls_url":"https://api.github.com/repos/pymc-devs/pymc3/pulls{/number}","milestones_url":"https://api.github.com/repos/pymc-devs/pymc3/milestones{/number}","notifications_url":"https://api.github.com/repos/pymc-devs/pymc3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pymc-devs/pymc3/labels{/name}","releases_url":"https://api.github.com/repos/pymc-devs/pymc3/releases{/id}","deployments_url":"https://api.github.com/repos/pymc-devs/pymc3/deployments","created_at":"2009-05-05T09:43:50Z","updated_at":"2018-06-17T10:01:33Z","pushed_at":"2018-06-16T23:39:21Z","git_url":"git://github.com/pymc-devs/pymc3.git","ssh_url":"git@github.com:pymc-devs/pymc3.git","clone_url":"https://github.com/pymc-devs/pymc3.git","svn_url":"https://github.com/pymc-devs/pymc3","homepage":"http://pymc-devs.github.io/pymc3/","size":229804,"stargazers_count":3352,"watchers_count":3352,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":829,"mirror_url":null,"archived":false,"open_issues_count":253,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":829,"open_issues":253,"watchers":3352,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pymc-devs/pymc3/pulls/2983"},"html":{"href":"https://github.com/pymc-devs/pymc3/pull/2983"},"issue":{"href":"https://api.github.com/repos/pymc-devs/pymc3/issues/2983"},"comments":{"href":"https://api.github.com/repos/pymc-devs/pymc3/issues/2983/comments"},"review_comments":{"href":"https://api.github.com/repos/pymc-devs/pymc3/pulls/2983/comments"},"review_comment":{"href":"https://api.github.com/repos/pymc-devs/pymc3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pymc-devs/pymc3/pulls/2983/commits"},"statuses":{"href":"https://api.github.com/repos/pymc-devs/pymc3/statuses/9f2db8938edda5cea53f840fc2ad65b785393cd9"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ColCarroll"}}