{"action":"created","comment":{"url":"https://api.github.com/repos/color/risk-models/pulls/comments/238387667","pull_request_review_id":180917070,"id":238387667,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODM4NzY2Nw==","diff_hunk":"@@ -14,87 +14,107 @@\n VALID_MAX_AGE = 79\n \n \n-def calculate_risk(\n-        patient_age,\n-        mother_onset_age=None,\n-        daughter_onset_ages=None,\n-        full_sister_onset_ages=None,\n-        maternal_aunt_onset_ages=None,\n-        paternal_aunt_onset_ages=None,\n-        maternal_grandmother_onset_ages=None,\n-        paternal_grandmother_onset_ages=None,\n-        maternal_half_sister_onset_ages=None,\n-        paternal_half_sister_onset_ages=None):\n+def calculate_risk(patient_age,\n+                   mother_onset_age=[],\n+                   daughter_onset_ages=[],\n+                   full_sister_onset_ages=[],\n+                   maternal_aunt_onset_ages=[],\n+                   paternal_aunt_onset_ages=[],\n+                   maternal_grandmother_onset_ages=[],\n+                   paternal_grandmother_onset_ages=[],","path":"risk_models/claus/claus.py","position":22,"original_position":22,"commit_id":"1fed365d4511388489417421ebd88a713cbbb314","original_commit_id":"1fed365d4511388489417421ebd88a713cbbb314","user":{"login":"justinwang189","id":7961780,"node_id":"MDQ6VXNlcjc5NjE3ODA=","avatar_url":"https://avatars1.githubusercontent.com/u/7961780?v=4","gravatar_id":"","url":"https://api.github.com/users/justinwang189","html_url":"https://github.com/justinwang189","followers_url":"https://api.github.com/users/justinwang189/followers","following_url":"https://api.github.com/users/justinwang189/following{/other_user}","gists_url":"https://api.github.com/users/justinwang189/gists{/gist_id}","starred_url":"https://api.github.com/users/justinwang189/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinwang189/subscriptions","organizations_url":"https://api.github.com/users/justinwang189/orgs","repos_url":"https://api.github.com/users/justinwang189/repos","events_url":"https://api.github.com/users/justinwang189/events{/privacy}","received_events_url":"https://api.github.com/users/justinwang189/received_events","type":"User","site_admin":false},"body":"Mutable list as default argument has interesting behavior in python https://docs.python-guide.org/writing/gotchas/","created_at":"2018-12-03T18:38:32Z","updated_at":"2018-12-03T18:38:32Z","html_url":"https://github.com/color/risk-models/pull/3#discussion_r238387667","pull_request_url":"https://api.github.com/repos/color/risk-models/pulls/3","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/color/risk-models/pulls/comments/238387667"},"html":{"href":"https://github.com/color/risk-models/pull/3#discussion_r238387667"},"pull_request":{"href":"https://api.github.com/repos/color/risk-models/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/color/risk-models/pulls/3","id":182859578,"node_id":"MDExOlB1bGxSZXF1ZXN0MTgyODU5NTc4","html_url":"https://github.com/color/risk-models/pull/3","diff_url":"https://github.com/color/risk-models/pull/3.diff","patch_url":"https://github.com/color/risk-models/pull/3.patch","issue_url":"https://api.github.com/repos/color/risk-models/issues/3","number":3,"state":"open","locked":false,"title":"Refactor to improve memory usage and performance","user":{"login":"SkyWox","id":29467874,"node_id":"MDQ6VXNlcjI5NDY3ODc0","avatar_url":"https://avatars0.githubusercontent.com/u/29467874?v=4","gravatar_id":"","url":"https://api.github.com/users/SkyWox","html_url":"https://github.com/SkyWox","followers_url":"https://api.github.com/users/SkyWox/followers","following_url":"https://api.github.com/users/SkyWox/following{/other_user}","gists_url":"https://api.github.com/users/SkyWox/gists{/gist_id}","starred_url":"https://api.github.com/users/SkyWox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SkyWox/subscriptions","organizations_url":"https://api.github.com/users/SkyWox/orgs","repos_url":"https://api.github.com/users/SkyWox/repos","events_url":"https://api.github.com/users/SkyWox/events{/privacy}","received_events_url":"https://api.github.com/users/SkyWox/received_events","type":"User","site_admin":false},"body":"Performance Improvements:\r\nOn a test load of 100 function calls with 6 elements in each `onset_age` list\r\n- 10% reduction in memory usage\r\n- 25% reduction in runtime\r\n\r\nRemoves:\r\n- All `relative_indices` lists -> only uses `onset_ages` lists\r\n- `map_ages_to_indices` and `collect_and_map_ages_to_indices` functions  -> each age is matched to an index on demand\r\n- `risk_scores` list -> replaced with a single number\r\n\r\nImprovements:\r\n- Aggregate groups like `first_degree_ages` are filtered and sorted during assignment, removing data processing later on\r\n- Risk assessment is grouped by category, reducing code repetition and improving readability\r\n- Provides for early termination if the user's age is outside the accepted range\r\n- Refers to the last column as a relative `-1` rather than a hard-coded `LIFETIME_AGE_INDEX`","created_at":"2018-04-19T18:24:13Z","updated_at":"2018-12-03T18:38:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"81d4542f761cb5ea48291a16146258624a26816c","assignee":{"login":"justinwang189","id":7961780,"node_id":"MDQ6VXNlcjc5NjE3ODA=","avatar_url":"https://avatars1.githubusercontent.com/u/7961780?v=4","gravatar_id":"","url":"https://api.github.com/users/justinwang189","html_url":"https://github.com/justinwang189","followers_url":"https://api.github.com/users/justinwang189/followers","following_url":"https://api.github.com/users/justinwang189/following{/other_user}","gists_url":"https://api.github.com/users/justinwang189/gists{/gist_id}","starred_url":"https://api.github.com/users/justinwang189/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinwang189/subscriptions","organizations_url":"https://api.github.com/users/justinwang189/orgs","repos_url":"https://api.github.com/users/justinwang189/repos","events_url":"https://api.github.com/users/justinwang189/events{/privacy}","received_events_url":"https://api.github.com/users/justinwang189/received_events","type":"User","site_admin":false},"assignees":[{"login":"justinwang189","id":7961780,"node_id":"MDQ6VXNlcjc5NjE3ODA=","avatar_url":"https://avatars1.githubusercontent.com/u/7961780?v=4","gravatar_id":"","url":"https://api.github.com/users/justinwang189","html_url":"https://github.com/justinwang189","followers_url":"https://api.github.com/users/justinwang189/followers","following_url":"https://api.github.com/users/justinwang189/following{/other_user}","gists_url":"https://api.github.com/users/justinwang189/gists{/gist_id}","starred_url":"https://api.github.com/users/justinwang189/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinwang189/subscriptions","organizations_url":"https://api.github.com/users/justinwang189/orgs","repos_url":"https://api.github.com/users/justinwang189/repos","events_url":"https://api.github.com/users/justinwang189/events{/privacy}","received_events_url":"https://api.github.com/users/justinwang189/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/color/risk-models/pulls/3/commits","review_comments_url":"https://api.github.com/repos/color/risk-models/pulls/3/comments","review_comment_url":"https://api.github.com/repos/color/risk-models/pulls/comments{/number}","comments_url":"https://api.github.com/repos/color/risk-models/issues/3/comments","statuses_url":"https://api.github.com/repos/color/risk-models/statuses/1fed365d4511388489417421ebd88a713cbbb314","head":{"label":"SkyWox:master","ref":"master","sha":"1fed365d4511388489417421ebd88a713cbbb314","user":{"login":"SkyWox","id":29467874,"node_id":"MDQ6VXNlcjI5NDY3ODc0","avatar_url":"https://avatars0.githubusercontent.com/u/29467874?v=4","gravatar_id":"","url":"https://api.github.com/users/SkyWox","html_url":"https://github.com/SkyWox","followers_url":"https://api.github.com/users/SkyWox/followers","following_url":"https://api.github.com/users/SkyWox/following{/other_user}","gists_url":"https://api.github.com/users/SkyWox/gists{/gist_id}","starred_url":"https://api.github.com/users/SkyWox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SkyWox/subscriptions","organizations_url":"https://api.github.com/users/SkyWox/orgs","repos_url":"https://api.github.com/users/SkyWox/repos","events_url":"https://api.github.com/users/SkyWox/events{/privacy}","received_events_url":"https://api.github.com/users/SkyWox/received_events","type":"User","site_admin":false},"repo":{"id":129980289,"node_id":"MDEwOlJlcG9zaXRvcnkxMjk5ODAyODk=","name":"risk-models","full_name":"SkyWox/risk-models","private":false,"owner":{"login":"SkyWox","id":29467874,"node_id":"MDQ6VXNlcjI5NDY3ODc0","avatar_url":"https://avatars0.githubusercontent.com/u/29467874?v=4","gravatar_id":"","url":"https://api.github.com/users/SkyWox","html_url":"https://github.com/SkyWox","followers_url":"https://api.github.com/users/SkyWox/followers","following_url":"https://api.github.com/users/SkyWox/following{/other_user}","gists_url":"https://api.github.com/users/SkyWox/gists{/gist_id}","starred_url":"https://api.github.com/users/SkyWox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SkyWox/subscriptions","organizations_url":"https://api.github.com/users/SkyWox/orgs","repos_url":"https://api.github.com/users/SkyWox/repos","events_url":"https://api.github.com/users/SkyWox/events{/privacy}","received_events_url":"https://api.github.com/users/SkyWox/received_events","type":"User","site_admin":false},"html_url":"https://github.com/SkyWox/risk-models","description":null,"fork":true,"url":"https://api.github.com/repos/SkyWox/risk-models","forks_url":"https://api.github.com/repos/SkyWox/risk-models/forks","keys_url":"https://api.github.com/repos/SkyWox/risk-models/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SkyWox/risk-models/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SkyWox/risk-models/teams","hooks_url":"https://api.github.com/repos/SkyWox/risk-models/hooks","issue_events_url":"https://api.github.com/repos/SkyWox/risk-models/issues/events{/number}","events_url":"https://api.github.com/repos/SkyWox/risk-models/events","assignees_url":"https://api.github.com/repos/SkyWox/risk-models/assignees{/user}","branches_url":"https://api.github.com/repos/SkyWox/risk-models/branches{/branch}","tags_url":"https://api.github.com/repos/SkyWox/risk-models/tags","blobs_url":"https://api.github.com/repos/SkyWox/risk-models/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SkyWox/risk-models/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SkyWox/risk-models/git/refs{/sha}","trees_url":"https://api.github.com/repos/SkyWox/risk-models/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SkyWox/risk-models/statuses/{sha}","languages_url":"https://api.github.com/repos/SkyWox/risk-models/languages","stargazers_url":"https://api.github.com/repos/SkyWox/risk-models/stargazers","contributors_url":"https://api.github.com/repos/SkyWox/risk-models/contributors","subscribers_url":"https://api.github.com/repos/SkyWox/risk-models/subscribers","subscription_url":"https://api.github.com/repos/SkyWox/risk-models/subscription","commits_url":"https://api.github.com/repos/SkyWox/risk-models/commits{/sha}","git_commits_url":"https://api.github.com/repos/SkyWox/risk-models/git/commits{/sha}","comments_url":"https://api.github.com/repos/SkyWox/risk-models/comments{/number}","issue_comment_url":"https://api.github.com/repos/SkyWox/risk-models/issues/comments{/number}","contents_url":"https://api.github.com/repos/SkyWox/risk-models/contents/{+path}","compare_url":"https://api.github.com/repos/SkyWox/risk-models/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SkyWox/risk-models/merges","archive_url":"https://api.github.com/repos/SkyWox/risk-models/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SkyWox/risk-models/downloads","issues_url":"https://api.github.com/repos/SkyWox/risk-models/issues{/number}","pulls_url":"https://api.github.com/repos/SkyWox/risk-models/pulls{/number}","milestones_url":"https://api.github.com/repos/SkyWox/risk-models/milestones{/number}","notifications_url":"https://api.github.com/repos/SkyWox/risk-models/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SkyWox/risk-models/labels{/name}","releases_url":"https://api.github.com/repos/SkyWox/risk-models/releases{/id}","deployments_url":"https://api.github.com/repos/SkyWox/risk-models/deployments","created_at":"2018-04-18T00:24:37Z","updated_at":"2018-04-19T18:20:53Z","pushed_at":"2018-04-19T18:20:52Z","git_url":"git://github.com/SkyWox/risk-models.git","ssh_url":"git@github.com:SkyWox/risk-models.git","clone_url":"https://github.com/SkyWox/risk-models.git","svn_url":"https://github.com/SkyWox/risk-models","homepage":null,"size":20,"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":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"color:master","ref":"master","sha":"f9774dcf6783069e6f3bc47c30104be0f4653a7b","user":{"login":"color","id":4187878,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxODc4Nzg=","avatar_url":"https://avatars0.githubusercontent.com/u/4187878?v=4","gravatar_id":"","url":"https://api.github.com/users/color","html_url":"https://github.com/color","followers_url":"https://api.github.com/users/color/followers","following_url":"https://api.github.com/users/color/following{/other_user}","gists_url":"https://api.github.com/users/color/gists{/gist_id}","starred_url":"https://api.github.com/users/color/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/color/subscriptions","organizations_url":"https://api.github.com/users/color/orgs","repos_url":"https://api.github.com/users/color/repos","events_url":"https://api.github.com/users/color/events{/privacy}","received_events_url":"https://api.github.com/users/color/received_events","type":"Organization","site_admin":false},"repo":{"id":84272594,"node_id":"MDEwOlJlcG9zaXRvcnk4NDI3MjU5NA==","name":"risk-models","full_name":"color/risk-models","private":false,"owner":{"login":"color","id":4187878,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxODc4Nzg=","avatar_url":"https://avatars0.githubusercontent.com/u/4187878?v=4","gravatar_id":"","url":"https://api.github.com/users/color","html_url":"https://github.com/color","followers_url":"https://api.github.com/users/color/followers","following_url":"https://api.github.com/users/color/following{/other_user}","gists_url":"https://api.github.com/users/color/gists{/gist_id}","starred_url":"https://api.github.com/users/color/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/color/subscriptions","organizations_url":"https://api.github.com/users/color/orgs","repos_url":"https://api.github.com/users/color/repos","events_url":"https://api.github.com/users/color/events{/privacy}","received_events_url":"https://api.github.com/users/color/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/color/risk-models","description":null,"fork":false,"url":"https://api.github.com/repos/color/risk-models","forks_url":"https://api.github.com/repos/color/risk-models/forks","keys_url":"https://api.github.com/repos/color/risk-models/keys{/key_id}","collaborators_url":"https://api.github.com/repos/color/risk-models/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/color/risk-models/teams","hooks_url":"https://api.github.com/repos/color/risk-models/hooks","issue_events_url":"https://api.github.com/repos/color/risk-models/issues/events{/number}","events_url":"https://api.github.com/repos/color/risk-models/events","assignees_url":"https://api.github.com/repos/color/risk-models/assignees{/user}","branches_url":"https://api.github.com/repos/color/risk-models/branches{/branch}","tags_url":"https://api.github.com/repos/color/risk-models/tags","blobs_url":"https://api.github.com/repos/color/risk-models/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/color/risk-models/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/color/risk-models/git/refs{/sha}","trees_url":"https://api.github.com/repos/color/risk-models/git/trees{/sha}","statuses_url":"https://api.github.com/repos/color/risk-models/statuses/{sha}","languages_url":"https://api.github.com/repos/color/risk-models/languages","stargazers_url":"https://api.github.com/repos/color/risk-models/stargazers","contributors_url":"https://api.github.com/repos/color/risk-models/contributors","subscribers_url":"https://api.github.com/repos/color/risk-models/subscribers","subscription_url":"https://api.github.com/repos/color/risk-models/subscription","commits_url":"https://api.github.com/repos/color/risk-models/commits{/sha}","git_commits_url":"https://api.github.com/repos/color/risk-models/git/commits{/sha}","comments_url":"https://api.github.com/repos/color/risk-models/comments{/number}","issue_comment_url":"https://api.github.com/repos/color/risk-models/issues/comments{/number}","contents_url":"https://api.github.com/repos/color/risk-models/contents/{+path}","compare_url":"https://api.github.com/repos/color/risk-models/compare/{base}...{head}","merges_url":"https://api.github.com/repos/color/risk-models/merges","archive_url":"https://api.github.com/repos/color/risk-models/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/color/risk-models/downloads","issues_url":"https://api.github.com/repos/color/risk-models/issues{/number}","pulls_url":"https://api.github.com/repos/color/risk-models/pulls{/number}","milestones_url":"https://api.github.com/repos/color/risk-models/milestones{/number}","notifications_url":"https://api.github.com/repos/color/risk-models/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/color/risk-models/labels{/name}","releases_url":"https://api.github.com/repos/color/risk-models/releases{/id}","deployments_url":"https://api.github.com/repos/color/risk-models/deployments","created_at":"2017-03-08T03:09:32Z","updated_at":"2018-04-02T22:09:09Z","pushed_at":"2018-04-19T18:24:14Z","git_url":"git://github.com/color/risk-models.git","ssh_url":"git@github.com:color/risk-models.git","clone_url":"https://github.com/color/risk-models.git","svn_url":"https://github.com/color/risk-models","homepage":null,"size":12,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":2,"open_issues":1,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/color/risk-models/pulls/3"},"html":{"href":"https://github.com/color/risk-models/pull/3"},"issue":{"href":"https://api.github.com/repos/color/risk-models/issues/3"},"comments":{"href":"https://api.github.com/repos/color/risk-models/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/color/risk-models/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/color/risk-models/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/color/risk-models/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/color/risk-models/statuses/1fed365d4511388489417421ebd88a713cbbb314"}},"author_association":"NONE"}}
{"actor":{"display_login":"justinwang189"}}