GitHub PullRequestReviewCommentEvent at 2014-07-04 10:27:06
Repository: matplotlib
Actor: ianthomas23
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/14554785","id":14554785,"diff_hunk":"@@ -37,66 +39,75 @@ def __init__(self, disp,x,y,type='l'):\n         self.score = 0\n         self.xoffset = 0.3\n         self.yoffset = 0.1\n-        if type=='r':\n+        if type == 'r':\n             self.xoffset *= -1.0\n \n-        if type=='l' or type=='r':\n+        if type == 'l' or type == 'r':\n             self.signx = -1.0\n             self.signy = 1.0\n         else:\n             self.signx = 1.0\n             self.signy = -1.0\n+\n     def contains(self, loc):\n-        return self.disp.get_bbox().contains(loc.x,loc.y)\n+        return self.disp.get_bbox().contains(loc.x, loc.y)\n+\n \n class Puck(object):\n+\n     def __init__(self, disp, pad, field):\n-        self.vmax= .2\n+        self.vmax = .2\n         self.disp = disp\n         self.field = field\n         self._reset(pad)\n-    def _reset(self,pad):\n+\n+    def _reset(self, pad):\n         self.x = pad.x + pad.xoffset\n         if pad.y < 0:\n-            self.y = pad.y +  pad.yoffset\n+            self.y = pad.y + pad.yoffset\n         else:\n             self.y = pad.y - pad.yoffset\n         self.vx = pad.x - self.x\n-        self.vy = pad.y + pad.w/2 - self.y\n+        self.vy = pad.y + pad.w / 2 - self.y\n         self._speedlimit()\n         self._slower()\n         self._slower()\n-    def update(self,pads):\n+\n+    def update(self, pads):\n         self.x += self.vx\n         self.y += self.vy\n         for pad in pads:\n             if pad.contains(self):\n-                self.vx *= 1.2 *pad.signx\n-                self.vy *= 1.2 *pad.signy\n+                self.vx *= 1.2 * pad.signx\n+                self.vy *= 1.2 * pad.signy\n         fudge = .001\n-        #probably cleaner with something like...if not self.field.contains(self.x, self.y):\n-        if self.x < 0+fudge:\n-            #print \"player A loses\"\n-            pads[1].score += 1;\n+        # probably cleaner with something like...if not\n+        # self.field.contains(self.x, self.y):\n+        if self.x < 0 + fudge:\n+            # print \"player A loses\"\n+            pads[1].score += 1\n             self._reset(pads[0])\n             return True\n-        if self.x > 7-fudge:\n-            #print \"player B loses\"\n-            pads[0].score += 1;\n+        if self.x > 7 - fudge:\n+            # print \"player B loses\"\n+            pads[0].score += 1\n             self._reset(pads[1])\n             return True\n-        if self.y < -1+fudge or self.y > 1-fudge:\n+        if self.y < -1 + fudge or self.y > 1 - fudge:\n             self.vy *= -1.0\n             # add some randomness, just to make it interesting\n-            self.vy -= (randn()/300.0 + 1/300.0) * np.sign(self.vy)\n+            self.vy -= (randn() / 300.0 + 1 / 300.0) * np.sign(self.vy)","path":"examples/event_handling/pipong.py","position":92,"original_position":92,"commit_id":"067c037344099bdabbda54f787fcac0f48bef903","original_commit_id":"067c037344099bdabbda54f787fcac0f48bef903","user":{"login":"ianthomas23","id":580326,"avatar_url":"https://avatars.githubusercontent.com/u/580326?","gravatar_id":"4b9239f1f98f12c8392cb4657c75a250","url":"https://api.github.com/users/ianthomas23","html_url":"https://github.com/ianthomas23","followers_url":"https://api.github.com/users/ianthomas23/followers","following_url":"https://api.github.com/users/ianthomas23/following{/other_user}","gists_url":"https://api.github.com/users/ianthomas23/gists{/gist_id}","starred_url":"https://api.github.com/users/ianthomas23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianthomas23/subscriptions","organizations_url":"https://api.github.com/users/ianthomas23/orgs","repos_url":"https://api.github.com/users/ianthomas23/repos","events_url":"https://api.github.com/users/ianthomas23/events{/privacy}","received_events_url":"https://api.github.com/users/ianthomas23/received_events","type":"User","site_admin":false},"body":"Excessive whitespace.","created_at":"2014-07-04T10:27:06Z","updated_at":"2014-07-04T10:27:06Z","html_url":"https://github.com/matplotlib/matplotlib/pull/3183#discussion_r14554785","pull_request_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3183","_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/14554785"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/3183#discussion_r14554785"},"pull_request":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3183"}}},"pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3183","id":17986413,"html_url":"https://github.com/matplotlib/matplotlib/pull/3183","diff_url":"https://github.com/matplotlib/matplotlib/pull/3183.diff","patch_url":"https://github.com/matplotlib/matplotlib/pull/3183.patch","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/3183","number":3183,"state":"open","title":"pep8ify examples/ part 3","user":{"login":"thisch","id":206581,"avatar_url":"https://avatars.githubusercontent.com/u/206581?","gravatar_id":"3707b058f2fed0e3e2e684b86851e9f3","url":"https://api.github.com/users/thisch","html_url":"https://github.com/thisch","followers_url":"https://api.github.com/users/thisch/followers","following_url":"https://api.github.com/users/thisch/following{/other_user}","gists_url":"https://api.github.com/users/thisch/gists{/gist_id}","starred_url":"https://api.github.com/users/thisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thisch/subscriptions","organizations_url":"https://api.github.com/users/thisch/orgs","repos_url":"https://api.github.com/users/thisch/repos","events_url":"https://api.github.com/users/thisch/events{/privacy}","received_events_url":"https://api.github.com/users/thisch/received_events","type":"User","site_admin":false},"body":"``examples/pylab_examples``, ``examples/units`` and ``examples/use_interface`` remain to be done.","created_at":"2014-07-04T09:30:12Z","updated_at":"2014-07-04T10:27:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f337547661a4638f1cfdd091f0b6c89b078aa37","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3183/commits","review_comments_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3183/comments","review_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/{number}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/3183/comments","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/067c037344099bdabbda54f787fcac0f48bef903","head":{"label":"thisch:pep8examplesapiv3","ref":"pep8examplesapiv3","sha":"067c037344099bdabbda54f787fcac0f48bef903","user":{"login":"thisch","id":206581,"avatar_url":"https://avatars.githubusercontent.com/u/206581?","gravatar_id":"3707b058f2fed0e3e2e684b86851e9f3","url":"https://api.github.com/users/thisch","html_url":"https://github.com/thisch","followers_url":"https://api.github.com/users/thisch/followers","following_url":"https://api.github.com/users/thisch/following{/other_user}","gists_url":"https://api.github.com/users/thisch/gists{/gist_id}","starred_url":"https://api.github.com/users/thisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thisch/subscriptions","organizations_url":"https://api.github.com/users/thisch/orgs","repos_url":"https://api.github.com/users/thisch/repos","events_url":"https://api.github.com/users/thisch/events{/privacy}","received_events_url":"https://api.github.com/users/thisch/received_events","type":"User","site_admin":false},"repo":{"id":13892321,"name":"matplotlib","full_name":"thisch/matplotlib","owner":{"login":"thisch","id":206581,"avatar_url":"https://avatars.githubusercontent.com/u/206581?","gravatar_id":"3707b058f2fed0e3e2e684b86851e9f3","url":"https://api.github.com/users/thisch","html_url":"https://github.com/thisch","followers_url":"https://api.github.com/users/thisch/followers","following_url":"https://api.github.com/users/thisch/following{/other_user}","gists_url":"https://api.github.com/users/thisch/gists{/gist_id}","starred_url":"https://api.github.com/users/thisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thisch/subscriptions","organizations_url":"https://api.github.com/users/thisch/orgs","repos_url":"https://api.github.com/users/thisch/repos","events_url":"https://api.github.com/users/thisch/events{/privacy}","received_events_url":"https://api.github.com/users/thisch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thisch/matplotlib","description":"matplotlib: plotting with Python","fork":true,"url":"https://api.github.com/repos/thisch/matplotlib","forks_url":"https://api.github.com/repos/thisch/matplotlib/forks","keys_url":"https://api.github.com/repos/thisch/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thisch/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thisch/matplotlib/teams","hooks_url":"https://api.github.com/repos/thisch/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/thisch/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/thisch/matplotlib/events","assignees_url":"https://api.github.com/repos/thisch/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/thisch/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/thisch/matplotlib/tags","blobs_url":"https://api.github.com/repos/thisch/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thisch/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thisch/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/thisch/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thisch/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/thisch/matplotlib/languages","stargazers_url":"https://api.github.com/repos/thisch/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/thisch/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/thisch/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/thisch/matplotlib/subscription","commits_url":"https://api.github.com/repos/thisch/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/thisch/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/thisch/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/thisch/matplotlib/issues/comments/{number}","contents_url":"https://api.github.com/repos/thisch/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/thisch/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thisch/matplotlib/merges","archive_url":"https://api.github.com/repos/thisch/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thisch/matplotlib/downloads","issues_url":"https://api.github.com/repos/thisch/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/thisch/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/thisch/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/thisch/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thisch/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/thisch/matplotlib/releases{/id}","created_at":"2013-10-26T22:42:10Z","updated_at":"2013-10-26T22:47:26Z","pushed_at":"2014-07-04T09:28:51Z","git_url":"git://github.com/thisch/matplotlib.git","ssh_url":"git@github.com:thisch/matplotlib.git","clone_url":"https://github.com/thisch/matplotlib.git","svn_url":"https://github.com/thisch/matplotlib","homepage":"http://matplotlib.org/","size":180817,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"matplotlib:master","ref":"master","sha":"2ef9cf1a486157b08faf1d279547e7d02d7f611d","user":{"login":"matplotlib","id":215947,"avatar_url":"https://avatars.githubusercontent.com/u/215947?","gravatar_id":"9cb63f8da873ea78bc89d440f9ecb03a","url":"https://api.github.com/users/matplotlib","html_url":"https://github.com/matplotlib","followers_url":"https://api.github.com/users/matplotlib/followers","following_url":"https://api.github.com/users/matplotlib/following{/other_user}","gists_url":"https://api.github.com/users/matplotlib/gists{/gist_id}","starred_url":"https://api.github.com/users/matplotlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matplotlib/subscriptions","organizations_url":"https://api.github.com/users/matplotlib/orgs","repos_url":"https://api.github.com/users/matplotlib/repos","events_url":"https://api.github.com/users/matplotlib/events{/privacy}","received_events_url":"https://api.github.com/users/matplotlib/received_events","type":"Organization","site_admin":false},"repo":{"id":1385122,"name":"matplotlib","full_name":"matplotlib/matplotlib","owner":{"login":"matplotlib","id":215947,"avatar_url":"https://avatars.githubusercontent.com/u/215947?","gravatar_id":"9cb63f8da873ea78bc89d440f9ecb03a","url":"https://api.github.com/users/matplotlib","html_url":"https://github.com/matplotlib","followers_url":"https://api.github.com/users/matplotlib/followers","following_url":"https://api.github.com/users/matplotlib/following{/other_user}","gists_url":"https://api.github.com/users/matplotlib/gists{/gist_id}","starred_url":"https://api.github.com/users/matplotlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matplotlib/subscriptions","organizations_url":"https://api.github.com/users/matplotlib/orgs","repos_url":"https://api.github.com/users/matplotlib/repos","events_url":"https://api.github.com/users/matplotlib/events{/privacy}","received_events_url":"https://api.github.com/users/matplotlib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matplotlib/matplotlib","description":"matplotlib: plotting with Python","fork":false,"url":"https://api.github.com/repos/matplotlib/matplotlib","forks_url":"https://api.github.com/repos/matplotlib/matplotlib/forks","keys_url":"https://api.github.com/repos/matplotlib/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matplotlib/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matplotlib/matplotlib/teams","hooks_url":"https://api.github.com/repos/matplotlib/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/matplotlib/matplotlib/events","assignees_url":"https://api.github.com/repos/matplotlib/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/matplotlib/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/matplotlib/matplotlib/tags","blobs_url":"https://api.github.com/repos/matplotlib/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matplotlib/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matplotlib/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/matplotlib/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/matplotlib/matplotlib/languages","stargazers_url":"https://api.github.com/repos/matplotlib/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/matplotlib/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/matplotlib/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/matplotlib/matplotlib/subscription","commits_url":"https://api.github.com/repos/matplotlib/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/matplotlib/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments/{number}","contents_url":"https://api.github.com/repos/matplotlib/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/matplotlib/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matplotlib/matplotlib/merges","archive_url":"https://api.github.com/repos/matplotlib/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matplotlib/matplotlib/downloads","issues_url":"https://api.github.com/repos/matplotlib/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/matplotlib/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/matplotlib/matplotlib/releases{/id}","created_at":"2011-02-19T03:17:12Z","updated_at":"2014-07-04T10:23:53Z","pushed_at":"2014-07-04T08:19:32Z","git_url":"git://github.com/matplotlib/matplotlib.git","ssh_url":"git@github.com:matplotlib/matplotlib.git","clone_url":"https://github.com/matplotlib/matplotlib.git","svn_url":"https://github.com/matplotlib/matplotlib","homepage":"http://matplotlib.org/","size":224851,"stargazers_count":1679,"watchers_count":1679,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":783,"mirror_url":null,"open_issues_count":360,"forks":783,"open_issues":360,"watchers":1679,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3183"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/3183"},"issue":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/3183"},"comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/3183/comments"},"review_comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3183/comments"},"review_comment":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3183/commits"},"statuses":{"href":"https://api.github.com/repos/matplotlib/matplotlib/statuses/067c037344099bdabbda54f787fcac0f48bef903"}}}}