{"action":"created","comment":{"url":"https://api.github.com/repos/UHERO/udaman/pulls/comments/168059647","pull_request_review_id":96365945,"id":168059647,"diff_hunk":"@@ -109,8 +109,10 @@ def rebase(year=nil)\n       end\n       new_base = self.at(Date.new(year)).to_f\n     end\n-    data.sort.each do |inner_date, value|\n-      new_series_data[inner_date] = value / new_base * 100","path":"lib/series_arithmetic.rb","position":5,"original_position":5,"commit_id":"b927d0fc892ae2280149b9161659a12f8aad679b","original_commit_id":"b927d0fc892ae2280149b9161659a12f8aad679b","user":{"login":"kotodharma","id":1517832,"avatar_url":"https://avatars0.githubusercontent.com/u/1517832?v=4","gravatar_id":"","url":"https://api.github.com/users/kotodharma","html_url":"https://github.com/kotodharma","followers_url":"https://api.github.com/users/kotodharma/followers","following_url":"https://api.github.com/users/kotodharma/following{/other_user}","gists_url":"https://api.github.com/users/kotodharma/gists{/gist_id}","starred_url":"https://api.github.com/users/kotodharma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kotodharma/subscriptions","organizations_url":"https://api.github.com/users/kotodharma/orgs","repos_url":"https://api.github.com/users/kotodharma/repos","events_url":"https://api.github.com/users/kotodharma/events{/privacy}","received_events_url":"https://api.github.com/users/kotodharma/received_events","type":"User","site_admin":false},"body":"It occurs to me (esp since I don't really know what the code is doing) that in this place, if `new_base` can be nil or zero, we might rather that the code blow up than quietly return wrong results. If this is the case, please advise and I'll put it back the way it was.","created_at":"2018-02-14T01:57:41Z","updated_at":"2018-02-14T01:57:42Z","html_url":"https://github.com/UHERO/udaman/pull/361#discussion_r168059647","pull_request_url":"https://api.github.com/repos/UHERO/udaman/pulls/361","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/UHERO/udaman/pulls/comments/168059647"},"html":{"href":"https://github.com/UHERO/udaman/pull/361#discussion_r168059647"},"pull_request":{"href":"https://api.github.com/repos/UHERO/udaman/pulls/361"}}},"pull_request":{"url":"https://api.github.com/repos/UHERO/udaman/pulls/361","id":169004487,"html_url":"https://github.com/UHERO/udaman/pull/361","diff_url":"https://github.com/UHERO/udaman/pull/361.diff","patch_url":"https://github.com/UHERO/udaman/pull/361.patch","issue_url":"https://api.github.com/repos/UHERO/udaman/issues/361","number":361,"state":"open","locked":false,"title":"Inf(inity) should not be generated by Series mtd method (UA-859)","user":{"login":"kotodharma","id":1517832,"avatar_url":"https://avatars0.githubusercontent.com/u/1517832?v=4","gravatar_id":"","url":"https://api.github.com/users/kotodharma","html_url":"https://github.com/kotodharma","followers_url":"https://api.github.com/users/kotodharma/followers","following_url":"https://api.github.com/users/kotodharma/following{/other_user}","gists_url":"https://api.github.com/users/kotodharma/gists{/gist_id}","starred_url":"https://api.github.com/users/kotodharma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kotodharma/subscriptions","organizations_url":"https://api.github.com/users/kotodharma/orgs","repos_url":"https://api.github.com/users/kotodharma/repos","events_url":"https://api.github.com/users/kotodharma/events{/privacy}","received_events_url":"https://api.github.com/users/kotodharma/received_events","type":"User","site_admin":false},"body":"Bug caused by the fact that the one-year-previous datapoint was zero (not nil), and thus division exception was thrown. Seems to be fixed based on test with this expression:\r\n```\r\n\"VAPITJPNS@HI.D\".ts.mtd\r\n```\r\nFound a few other examples of code in the same file where division-by-zero could happen in similar way, and put in the same solution. Assuming that returning zero for these cases rather than omitting the data point is the right behavior. If not, please advise. See comment below for another question, too.\r\n\r\nCleaned up an old unused method.","created_at":"2018-02-14T01:55:07Z","updated_at":"2018-02-14T01:57:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e2fe3b9c82ebf567c62e4c7abf3f4da13b622cd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/UHERO/udaman/pulls/361/commits","review_comments_url":"https://api.github.com/repos/UHERO/udaman/pulls/361/comments","review_comment_url":"https://api.github.com/repos/UHERO/udaman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UHERO/udaman/issues/361/comments","statuses_url":"https://api.github.com/repos/UHERO/udaman/statuses/b927d0fc892ae2280149b9161659a12f8aad679b","head":{"label":"UHERO:bugfix/UA-859","ref":"bugfix/UA-859","sha":"b927d0fc892ae2280149b9161659a12f8aad679b","user":{"login":"UHERO","id":7133488,"avatar_url":"https://avatars3.githubusercontent.com/u/7133488?v=4","gravatar_id":"","url":"https://api.github.com/users/UHERO","html_url":"https://github.com/UHERO","followers_url":"https://api.github.com/users/UHERO/followers","following_url":"https://api.github.com/users/UHERO/following{/other_user}","gists_url":"https://api.github.com/users/UHERO/gists{/gist_id}","starred_url":"https://api.github.com/users/UHERO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UHERO/subscriptions","organizations_url":"https://api.github.com/users/UHERO/orgs","repos_url":"https://api.github.com/users/UHERO/repos","events_url":"https://api.github.com/users/UHERO/events{/privacy}","received_events_url":"https://api.github.com/users/UHERO/received_events","type":"Organization","site_admin":false},"repo":{"id":20576664,"name":"udaman","full_name":"UHERO/udaman","owner":{"login":"UHERO","id":7133488,"avatar_url":"https://avatars3.githubusercontent.com/u/7133488?v=4","gravatar_id":"","url":"https://api.github.com/users/UHERO","html_url":"https://github.com/UHERO","followers_url":"https://api.github.com/users/UHERO/followers","following_url":"https://api.github.com/users/UHERO/following{/other_user}","gists_url":"https://api.github.com/users/UHERO/gists{/gist_id}","starred_url":"https://api.github.com/users/UHERO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UHERO/subscriptions","organizations_url":"https://api.github.com/users/UHERO/orgs","repos_url":"https://api.github.com/users/UHERO/repos","events_url":"https://api.github.com/users/UHERO/events{/privacy}","received_events_url":"https://api.github.com/users/UHERO/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UHERO/udaman","description":"UHERO Data Manager","fork":false,"url":"https://api.github.com/repos/UHERO/udaman","forks_url":"https://api.github.com/repos/UHERO/udaman/forks","keys_url":"https://api.github.com/repos/UHERO/udaman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UHERO/udaman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UHERO/udaman/teams","hooks_url":"https://api.github.com/repos/UHERO/udaman/hooks","issue_events_url":"https://api.github.com/repos/UHERO/udaman/issues/events{/number}","events_url":"https://api.github.com/repos/UHERO/udaman/events","assignees_url":"https://api.github.com/repos/UHERO/udaman/assignees{/user}","branches_url":"https://api.github.com/repos/UHERO/udaman/branches{/branch}","tags_url":"https://api.github.com/repos/UHERO/udaman/tags","blobs_url":"https://api.github.com/repos/UHERO/udaman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UHERO/udaman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UHERO/udaman/git/refs{/sha}","trees_url":"https://api.github.com/repos/UHERO/udaman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UHERO/udaman/statuses/{sha}","languages_url":"https://api.github.com/repos/UHERO/udaman/languages","stargazers_url":"https://api.github.com/repos/UHERO/udaman/stargazers","contributors_url":"https://api.github.com/repos/UHERO/udaman/contributors","subscribers_url":"https://api.github.com/repos/UHERO/udaman/subscribers","subscription_url":"https://api.github.com/repos/UHERO/udaman/subscription","commits_url":"https://api.github.com/repos/UHERO/udaman/commits{/sha}","git_commits_url":"https://api.github.com/repos/UHERO/udaman/git/commits{/sha}","comments_url":"https://api.github.com/repos/UHERO/udaman/comments{/number}","issue_comment_url":"https://api.github.com/repos/UHERO/udaman/issues/comments{/number}","contents_url":"https://api.github.com/repos/UHERO/udaman/contents/{+path}","compare_url":"https://api.github.com/repos/UHERO/udaman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UHERO/udaman/merges","archive_url":"https://api.github.com/repos/UHERO/udaman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UHERO/udaman/downloads","issues_url":"https://api.github.com/repos/UHERO/udaman/issues{/number}","pulls_url":"https://api.github.com/repos/UHERO/udaman/pulls{/number}","milestones_url":"https://api.github.com/repos/UHERO/udaman/milestones{/number}","notifications_url":"https://api.github.com/repos/UHERO/udaman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UHERO/udaman/labels{/name}","releases_url":"https://api.github.com/repos/UHERO/udaman/releases{/id}","deployments_url":"https://api.github.com/repos/UHERO/udaman/deployments","created_at":"2014-06-06T20:10:21Z","updated_at":"2016-04-06T02:21:59Z","pushed_at":"2018-02-14T01:55:08Z","git_url":"git://github.com/UHERO/udaman.git","ssh_url":"git@github.com:UHERO/udaman.git","clone_url":"https://github.com/UHERO/udaman.git","svn_url":"https://github.com/UHERO/udaman","homepage":null,"size":47608,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":27,"license":null,"forks":0,"open_issues":27,"watchers":0,"default_branch":"master"}},"base":{"label":"UHERO:master","ref":"master","sha":"93bbf2b5efa407b6214c1ce6373e4b3dbf74a23d","user":{"login":"UHERO","id":7133488,"avatar_url":"https://avatars3.githubusercontent.com/u/7133488?v=4","gravatar_id":"","url":"https://api.github.com/users/UHERO","html_url":"https://github.com/UHERO","followers_url":"https://api.github.com/users/UHERO/followers","following_url":"https://api.github.com/users/UHERO/following{/other_user}","gists_url":"https://api.github.com/users/UHERO/gists{/gist_id}","starred_url":"https://api.github.com/users/UHERO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UHERO/subscriptions","organizations_url":"https://api.github.com/users/UHERO/orgs","repos_url":"https://api.github.com/users/UHERO/repos","events_url":"https://api.github.com/users/UHERO/events{/privacy}","received_events_url":"https://api.github.com/users/UHERO/received_events","type":"Organization","site_admin":false},"repo":{"id":20576664,"name":"udaman","full_name":"UHERO/udaman","owner":{"login":"UHERO","id":7133488,"avatar_url":"https://avatars3.githubusercontent.com/u/7133488?v=4","gravatar_id":"","url":"https://api.github.com/users/UHERO","html_url":"https://github.com/UHERO","followers_url":"https://api.github.com/users/UHERO/followers","following_url":"https://api.github.com/users/UHERO/following{/other_user}","gists_url":"https://api.github.com/users/UHERO/gists{/gist_id}","starred_url":"https://api.github.com/users/UHERO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UHERO/subscriptions","organizations_url":"https://api.github.com/users/UHERO/orgs","repos_url":"https://api.github.com/users/UHERO/repos","events_url":"https://api.github.com/users/UHERO/events{/privacy}","received_events_url":"https://api.github.com/users/UHERO/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UHERO/udaman","description":"UHERO Data Manager","fork":false,"url":"https://api.github.com/repos/UHERO/udaman","forks_url":"https://api.github.com/repos/UHERO/udaman/forks","keys_url":"https://api.github.com/repos/UHERO/udaman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UHERO/udaman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UHERO/udaman/teams","hooks_url":"https://api.github.com/repos/UHERO/udaman/hooks","issue_events_url":"https://api.github.com/repos/UHERO/udaman/issues/events{/number}","events_url":"https://api.github.com/repos/UHERO/udaman/events","assignees_url":"https://api.github.com/repos/UHERO/udaman/assignees{/user}","branches_url":"https://api.github.com/repos/UHERO/udaman/branches{/branch}","tags_url":"https://api.github.com/repos/UHERO/udaman/tags","blobs_url":"https://api.github.com/repos/UHERO/udaman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UHERO/udaman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UHERO/udaman/git/refs{/sha}","trees_url":"https://api.github.com/repos/UHERO/udaman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UHERO/udaman/statuses/{sha}","languages_url":"https://api.github.com/repos/UHERO/udaman/languages","stargazers_url":"https://api.github.com/repos/UHERO/udaman/stargazers","contributors_url":"https://api.github.com/repos/UHERO/udaman/contributors","subscribers_url":"https://api.github.com/repos/UHERO/udaman/subscribers","subscription_url":"https://api.github.com/repos/UHERO/udaman/subscription","commits_url":"https://api.github.com/repos/UHERO/udaman/commits{/sha}","git_commits_url":"https://api.github.com/repos/UHERO/udaman/git/commits{/sha}","comments_url":"https://api.github.com/repos/UHERO/udaman/comments{/number}","issue_comment_url":"https://api.github.com/repos/UHERO/udaman/issues/comments{/number}","contents_url":"https://api.github.com/repos/UHERO/udaman/contents/{+path}","compare_url":"https://api.github.com/repos/UHERO/udaman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UHERO/udaman/merges","archive_url":"https://api.github.com/repos/UHERO/udaman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UHERO/udaman/downloads","issues_url":"https://api.github.com/repos/UHERO/udaman/issues{/number}","pulls_url":"https://api.github.com/repos/UHERO/udaman/pulls{/number}","milestones_url":"https://api.github.com/repos/UHERO/udaman/milestones{/number}","notifications_url":"https://api.github.com/repos/UHERO/udaman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UHERO/udaman/labels{/name}","releases_url":"https://api.github.com/repos/UHERO/udaman/releases{/id}","deployments_url":"https://api.github.com/repos/UHERO/udaman/deployments","created_at":"2014-06-06T20:10:21Z","updated_at":"2016-04-06T02:21:59Z","pushed_at":"2018-02-14T01:55:08Z","git_url":"git://github.com/UHERO/udaman.git","ssh_url":"git@github.com:UHERO/udaman.git","clone_url":"https://github.com/UHERO/udaman.git","svn_url":"https://github.com/UHERO/udaman","homepage":null,"size":47608,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":27,"license":null,"forks":0,"open_issues":27,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/UHERO/udaman/pulls/361"},"html":{"href":"https://github.com/UHERO/udaman/pull/361"},"issue":{"href":"https://api.github.com/repos/UHERO/udaman/issues/361"},"comments":{"href":"https://api.github.com/repos/UHERO/udaman/issues/361/comments"},"review_comments":{"href":"https://api.github.com/repos/UHERO/udaman/pulls/361/comments"},"review_comment":{"href":"https://api.github.com/repos/UHERO/udaman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UHERO/udaman/pulls/361/commits"},"statuses":{"href":"https://api.github.com/repos/UHERO/udaman/statuses/b927d0fc892ae2280149b9161659a12f8aad679b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"kotodharma"}}