{"action":"created","comment":{"url":"https://api.github.com/repos/uber/pyro/pulls/comments/171682250","pull_request_review_id":100579273,"id":171682250,"diff_hunk":"@@ -101,13 +100,31 @@ def __init__(self, a, b):\n     if _Dist is torch.distributions.Distribution:\n         continue\n \n+    try:\n+        _PyroDist = locals()[_name]\n+    except KeyError:\n+\n+        class _PyroDist(_Dist, TorchDistributionMixin):\n+            pass\n+\n+        _PyroDist.__name__ = _name\n+        locals()[_name] = _PyroDist\n+\n+    _PyroDist.__doc__ = '''\n+    Wraps :class:`torch.distributions.{}` with\n+    :class:`~pyro.distributions.torch_distribution.TorchDistributionMixin`.\n+    '''.format(_Dist.__name__)\n+\n     __all__.append(_name)\n-    if _name in dir():\n-        continue\n \n-    class _PyroDist(_Dist, TorchDistributionMixin):\n-        pass\n \n-    _PyroDist.__name__ = _name\n-    locals()[_name] = _PyroDist\n-    del _PyroDist, _name, _Dist\n+# Create sphinx documentation.\n+__doc__ = '\\n\\n'.join([","path":"pyro/distributions/torch.py","position":47,"original_position":47,"commit_id":"78f904120334a0adaf4eda79a067ffad1dcb0732","original_commit_id":"78f904120334a0adaf4eda79a067ffad1dcb0732","user":{"login":"fritzo","id":648532,"avatar_url":"https://avatars0.githubusercontent.com/u/648532?v=4","gravatar_id":"","url":"https://api.github.com/users/fritzo","html_url":"https://github.com/fritzo","followers_url":"https://api.github.com/users/fritzo/followers","following_url":"https://api.github.com/users/fritzo/following{/other_user}","gists_url":"https://api.github.com/users/fritzo/gists{/gist_id}","starred_url":"https://api.github.com/users/fritzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fritzo/subscriptions","organizations_url":"https://api.github.com/users/fritzo/orgs","repos_url":"https://api.github.com/users/fritzo/repos","events_url":"https://api.github.com/users/fritzo/events{/privacy}","received_events_url":"https://api.github.com/users/fritzo/received_events","type":"User","site_admin":false},"body":"This was the only way I was able to get these distributions to show up in our sphinx toc.","created_at":"2018-03-01T20:20:37Z","updated_at":"2018-03-01T20:20:38Z","html_url":"https://github.com/uber/pyro/pull/837#discussion_r171682250","pull_request_url":"https://api.github.com/repos/uber/pyro/pulls/837","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/uber/pyro/pulls/comments/171682250"},"html":{"href":"https://github.com/uber/pyro/pull/837#discussion_r171682250"},"pull_request":{"href":"https://api.github.com/repos/uber/pyro/pulls/837"}}},"pull_request":{"url":"https://api.github.com/repos/uber/pyro/pulls/837","id":172319759,"html_url":"https://github.com/uber/pyro/pull/837","diff_url":"https://github.com/uber/pyro/pull/837.diff","patch_url":"https://github.com/uber/pyro/pull/837.patch","issue_url":"https://api.github.com/repos/uber/pyro/issues/837","number":837,"state":"open","locked":false,"title":"Improve documentation for distributions","user":{"login":"fritzo","id":648532,"avatar_url":"https://avatars0.githubusercontent.com/u/648532?v=4","gravatar_id":"","url":"https://api.github.com/users/fritzo","html_url":"https://github.com/fritzo","followers_url":"https://api.github.com/users/fritzo/followers","following_url":"https://api.github.com/users/fritzo/following{/other_user}","gists_url":"https://api.github.com/users/fritzo/gists{/gist_id}","starred_url":"https://api.github.com/users/fritzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fritzo/subscriptions","organizations_url":"https://api.github.com/users/fritzo/orgs","repos_url":"https://api.github.com/users/fritzo/repos","events_url":"https://api.github.com/users/fritzo/events{/privacy}","received_events_url":"https://api.github.com/users/fritzo/received_events","type":"User","site_admin":false},"body":"This makes a few improvements to our distributions documentation, as promised to @karalets .\r\n- uses intersphinx to link to PyTorch documentation (master)\r\n- adds all PyTorch distributions to the TOC\r\n- adds the `__call__` method to sphinx documentation\r\n- documents a couple properties\r\n\r\nSee the results at http://fritzo.org/temp/pyro/html/distributions.html","created_at":"2018-03-01T18:43:03Z","updated_at":"2018-03-01T20:20:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"30411fb60c8094d6efcdb9c500bb2dc669608b31","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jpchen","id":1869641,"avatar_url":"https://avatars2.githubusercontent.com/u/1869641?v=4","gravatar_id":"","url":"https://api.github.com/users/jpchen","html_url":"https://github.com/jpchen","followers_url":"https://api.github.com/users/jpchen/followers","following_url":"https://api.github.com/users/jpchen/following{/other_user}","gists_url":"https://api.github.com/users/jpchen/gists{/gist_id}","starred_url":"https://api.github.com/users/jpchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpchen/subscriptions","organizations_url":"https://api.github.com/users/jpchen/orgs","repos_url":"https://api.github.com/users/jpchen/repos","events_url":"https://api.github.com/users/jpchen/events{/privacy}","received_events_url":"https://api.github.com/users/jpchen/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":704871691,"url":"https://api.github.com/repos/uber/pyro/labels/awaiting%20review","name":"awaiting review","color":"fbca04","default":false},{"id":664693175,"url":"https://api.github.com/repos/uber/pyro/labels/documentation","name":"documentation","color":"006b75","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/uber/pyro/pulls/837/commits","review_comments_url":"https://api.github.com/repos/uber/pyro/pulls/837/comments","review_comment_url":"https://api.github.com/repos/uber/pyro/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uber/pyro/issues/837/comments","statuses_url":"https://api.github.com/repos/uber/pyro/statuses/78f904120334a0adaf4eda79a067ffad1dcb0732","head":{"label":"uber:distribution-docs","ref":"distribution-docs","sha":"78f904120334a0adaf4eda79a067ffad1dcb0732","user":{"login":"uber","id":538264,"avatar_url":"https://avatars3.githubusercontent.com/u/538264?v=4","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":94506832,"name":"pyro","full_name":"uber/pyro","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars3.githubusercontent.com/u/538264?v=4","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/pyro","description":"Deep universal probabilistic programming with Python and PyTorch","fork":false,"url":"https://api.github.com/repos/uber/pyro","forks_url":"https://api.github.com/repos/uber/pyro/forks","keys_url":"https://api.github.com/repos/uber/pyro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/pyro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/pyro/teams","hooks_url":"https://api.github.com/repos/uber/pyro/hooks","issue_events_url":"https://api.github.com/repos/uber/pyro/issues/events{/number}","events_url":"https://api.github.com/repos/uber/pyro/events","assignees_url":"https://api.github.com/repos/uber/pyro/assignees{/user}","branches_url":"https://api.github.com/repos/uber/pyro/branches{/branch}","tags_url":"https://api.github.com/repos/uber/pyro/tags","blobs_url":"https://api.github.com/repos/uber/pyro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/pyro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/pyro/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/pyro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/pyro/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/pyro/languages","stargazers_url":"https://api.github.com/repos/uber/pyro/stargazers","contributors_url":"https://api.github.com/repos/uber/pyro/contributors","subscribers_url":"https://api.github.com/repos/uber/pyro/subscribers","subscription_url":"https://api.github.com/repos/uber/pyro/subscription","commits_url":"https://api.github.com/repos/uber/pyro/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/pyro/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/pyro/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/pyro/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/pyro/contents/{+path}","compare_url":"https://api.github.com/repos/uber/pyro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/pyro/merges","archive_url":"https://api.github.com/repos/uber/pyro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/pyro/downloads","issues_url":"https://api.github.com/repos/uber/pyro/issues{/number}","pulls_url":"https://api.github.com/repos/uber/pyro/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/pyro/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/pyro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/pyro/labels{/name}","releases_url":"https://api.github.com/repos/uber/pyro/releases{/id}","deployments_url":"https://api.github.com/repos/uber/pyro/deployments","created_at":"2017-06-16T05:03:47Z","updated_at":"2018-03-01T15:33:48Z","pushed_at":"2018-03-01T20:17:37Z","git_url":"git://github.com/uber/pyro.git","ssh_url":"git@github.com:uber/pyro.git","clone_url":"https://github.com/uber/pyro.git","svn_url":"https://github.com/uber/pyro","homepage":"http://pyro.ai","size":50289,"stargazers_count":2958,"watchers_count":2958,"language":"Jupyter Notebook","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":295,"mirror_url":null,"archived":false,"open_issues_count":71,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":295,"open_issues":71,"watchers":2958,"default_branch":"dev"}},"base":{"label":"uber:dev","ref":"dev","sha":"18a08c1e99ff1edcd6026c56c6d83a9ac8f1c31d","user":{"login":"uber","id":538264,"avatar_url":"https://avatars3.githubusercontent.com/u/538264?v=4","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":94506832,"name":"pyro","full_name":"uber/pyro","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars3.githubusercontent.com/u/538264?v=4","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/pyro","description":"Deep universal probabilistic programming with Python and PyTorch","fork":false,"url":"https://api.github.com/repos/uber/pyro","forks_url":"https://api.github.com/repos/uber/pyro/forks","keys_url":"https://api.github.com/repos/uber/pyro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/pyro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/pyro/teams","hooks_url":"https://api.github.com/repos/uber/pyro/hooks","issue_events_url":"https://api.github.com/repos/uber/pyro/issues/events{/number}","events_url":"https://api.github.com/repos/uber/pyro/events","assignees_url":"https://api.github.com/repos/uber/pyro/assignees{/user}","branches_url":"https://api.github.com/repos/uber/pyro/branches{/branch}","tags_url":"https://api.github.com/repos/uber/pyro/tags","blobs_url":"https://api.github.com/repos/uber/pyro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/pyro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/pyro/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/pyro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/pyro/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/pyro/languages","stargazers_url":"https://api.github.com/repos/uber/pyro/stargazers","contributors_url":"https://api.github.com/repos/uber/pyro/contributors","subscribers_url":"https://api.github.com/repos/uber/pyro/subscribers","subscription_url":"https://api.github.com/repos/uber/pyro/subscription","commits_url":"https://api.github.com/repos/uber/pyro/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/pyro/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/pyro/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/pyro/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/pyro/contents/{+path}","compare_url":"https://api.github.com/repos/uber/pyro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/pyro/merges","archive_url":"https://api.github.com/repos/uber/pyro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/pyro/downloads","issues_url":"https://api.github.com/repos/uber/pyro/issues{/number}","pulls_url":"https://api.github.com/repos/uber/pyro/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/pyro/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/pyro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/pyro/labels{/name}","releases_url":"https://api.github.com/repos/uber/pyro/releases{/id}","deployments_url":"https://api.github.com/repos/uber/pyro/deployments","created_at":"2017-06-16T05:03:47Z","updated_at":"2018-03-01T15:33:48Z","pushed_at":"2018-03-01T20:17:37Z","git_url":"git://github.com/uber/pyro.git","ssh_url":"git@github.com:uber/pyro.git","clone_url":"https://github.com/uber/pyro.git","svn_url":"https://github.com/uber/pyro","homepage":"http://pyro.ai","size":50289,"stargazers_count":2958,"watchers_count":2958,"language":"Jupyter Notebook","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":295,"mirror_url":null,"archived":false,"open_issues_count":71,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":295,"open_issues":71,"watchers":2958,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/uber/pyro/pulls/837"},"html":{"href":"https://github.com/uber/pyro/pull/837"},"issue":{"href":"https://api.github.com/repos/uber/pyro/issues/837"},"comments":{"href":"https://api.github.com/repos/uber/pyro/issues/837/comments"},"review_comments":{"href":"https://api.github.com/repos/uber/pyro/pulls/837/comments"},"review_comment":{"href":"https://api.github.com/repos/uber/pyro/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uber/pyro/pulls/837/commits"},"statuses":{"href":"https://api.github.com/repos/uber/pyro/statuses/78f904120334a0adaf4eda79a067ffad1dcb0732"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"fritzo"}}