{"action":"created","comment":{"url":"https://api.github.com/repos/containers-ai/alameda-ai/pulls/comments/242486349","pull_request_review_id":186004806,"id":242486349,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MjQ4NjM0OQ==","diff_hunk":"@@ -0,0 +1,78 @@\n+\"\"\" Unit test for init detector\"\"\"\r\n+import unittest\r\n+import numpy as np\r\n+from services.orchestra.recommendation.init_detector import InitDetector\r\n+\r\n+\r\n+class InitDetectorTestCase(unittest.TestCase):\r\n+    \"\"\" Test cases for init detector  \"\"\"\r\n+    def setUp(self):\r\n+        self.data_case1 = np.array(\r\n+            [0.24, 0.38, 0.51, 0.38, 0.31, 0.3, 0.32, 0.24, 0.37, 0.29])\r\n+        self.init_mean_case1 = 0.34\r\n+        self.init_max_case1 = 0.51\r\n+        self.first_peak_found_case1 = True\r\n+        self.end_index_case1 = 7\r\n+\r\n+        self.data_case2 = np.array(\r\n+            [0.13, 0.03, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.02, 0.02]\r\n+        ).reshape(-1, 1)\r\n+        self.init_mean_case2 = 0.06\r\n+        self.init_max_case2 = 0.13\r\n+        self.first_peak_found_case2 = True\r\n+        self.end_index_case2 = 2\r\n+\r\n+        self.data_case3 = np.array(\r\n+            [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0])\r\n+        self.init_mean_case3 = 0.55\r\n+        self.init_max_case3 = 1.0\r\n+        self.first_peak_found_case3 = False\r\n+        self.end_index_case3 = -1\r\n+\r\n+        self.data_case4 = np.array(\r\n+            [1.0, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1])\r\n+        self.init_mean_case4 = 0.55\r\n+        self.init_max_case4 = 1.0\r\n+        self.first_peak_found_case4 = True\r\n+        self.end_index_case4 = 9\r\n+\r\n+    def tearDown(self):\r\n+        pass\r\n+\r\n+    def test_detect(self):\r\n+        \"\"\" test for detect() \"\"\"\r\n+        init_detector = InitDetector()\r\n+        results = init_detector.detect(self.data_case1)\r\n+        self.assertTupleEqual(\r\n+            (self.init_mean_case1, self.init_max_case1,\r\n+             self.first_peak_found_case1, self.end_index_case1),\r\n+            (np.round(results['init_mean'], 2), np.round(results['init_max'], 2),\r\n+             results['first_peak_found'], results['end_index']))\r\n+\r\n+        init_detector = InitDetector()\r","path":"tests/unittest/services/orchestra/recommendation/test_init_detector.py","position":52,"original_position":52,"commit_id":"74ca7509796114ca545a8f8f38a5f4561b922b7f","original_commit_id":"74ca7509796114ca545a8f8f38a5f4561b922b7f","user":{"login":"susansdb","id":34014771,"node_id":"MDQ6VXNlcjM0MDE0Nzcx","avatar_url":"https://avatars1.githubusercontent.com/u/34014771?v=4","gravatar_id":"","url":"https://api.github.com/users/susansdb","html_url":"https://github.com/susansdb","followers_url":"https://api.github.com/users/susansdb/followers","following_url":"https://api.github.com/users/susansdb/following{/other_user}","gists_url":"https://api.github.com/users/susansdb/gists{/gist_id}","starred_url":"https://api.github.com/users/susansdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/susansdb/subscriptions","organizations_url":"https://api.github.com/users/susansdb/orgs","repos_url":"https://api.github.com/users/susansdb/repos","events_url":"https://api.github.com/users/susansdb/events{/privacy}","received_events_url":"https://api.github.com/users/susansdb/received_events","type":"User","site_admin":false},"body":"Duplicate class instance. InitDetector class can be initialized at setUp().","created_at":"2018-12-18T10:42:12Z","updated_at":"2018-12-18T10:42:13Z","html_url":"https://github.com/containers-ai/alameda-ai/pull/19#discussion_r242486349","pull_request_url":"https://api.github.com/repos/containers-ai/alameda-ai/pulls/19","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/containers-ai/alameda-ai/pulls/comments/242486349"},"html":{"href":"https://github.com/containers-ai/alameda-ai/pull/19#discussion_r242486349"},"pull_request":{"href":"https://api.github.com/repos/containers-ai/alameda-ai/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/containers-ai/alameda-ai/pulls/19","id":239384181,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM5Mzg0MTgx","html_url":"https://github.com/containers-ai/alameda-ai/pull/19","diff_url":"https://github.com/containers-ai/alameda-ai/pull/19.diff","patch_url":"https://github.com/containers-ai/alameda-ai/pull/19.patch","issue_url":"https://api.github.com/repos/containers-ai/alameda-ai/issues/19","number":19,"state":"open","locked":false,"title":"feat: init-stage detector","user":{"login":"sscheng216","id":34641564,"node_id":"MDQ6VXNlcjM0NjQxNTY0","avatar_url":"https://avatars1.githubusercontent.com/u/34641564?v=4","gravatar_id":"","url":"https://api.github.com/users/sscheng216","html_url":"https://github.com/sscheng216","followers_url":"https://api.github.com/users/sscheng216/followers","following_url":"https://api.github.com/users/sscheng216/following{/other_user}","gists_url":"https://api.github.com/users/sscheng216/gists{/gist_id}","starred_url":"https://api.github.com/users/sscheng216/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sscheng216/subscriptions","organizations_url":"https://api.github.com/users/sscheng216/orgs","repos_url":"https://api.github.com/users/sscheng216/repos","events_url":"https://api.github.com/users/sscheng216/events{/privacy}","received_events_url":"https://api.github.com/users/sscheng216/received_events","type":"User","site_admin":false},"body":"Implement the init-stage detector for the container workload\r\n\r\nGithub issue #12","created_at":"2018-12-18T07:03:37Z","updated_at":"2018-12-18T10:42:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8dc0a9bbc31dda46e0a324f18f883479c3bbe7ac","assignee":null,"assignees":[],"requested_reviewers":[{"login":"yamlin","id":5163504,"node_id":"MDQ6VXNlcjUxNjM1MDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/5163504?v=4","gravatar_id":"","url":"https://api.github.com/users/yamlin","html_url":"https://github.com/yamlin","followers_url":"https://api.github.com/users/yamlin/followers","following_url":"https://api.github.com/users/yamlin/following{/other_user}","gists_url":"https://api.github.com/users/yamlin/gists{/gist_id}","starred_url":"https://api.github.com/users/yamlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yamlin/subscriptions","organizations_url":"https://api.github.com/users/yamlin/orgs","repos_url":"https://api.github.com/users/yamlin/repos","events_url":"https://api.github.com/users/yamlin/events{/privacy}","received_events_url":"https://api.github.com/users/yamlin/received_events","type":"User","site_admin":false},{"login":"chinming0822","id":6506993,"node_id":"MDQ6VXNlcjY1MDY5OTM=","avatar_url":"https://avatars0.githubusercontent.com/u/6506993?v=4","gravatar_id":"","url":"https://api.github.com/users/chinming0822","html_url":"https://github.com/chinming0822","followers_url":"https://api.github.com/users/chinming0822/followers","following_url":"https://api.github.com/users/chinming0822/following{/other_user}","gists_url":"https://api.github.com/users/chinming0822/gists{/gist_id}","starred_url":"https://api.github.com/users/chinming0822/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinming0822/subscriptions","organizations_url":"https://api.github.com/users/chinming0822/orgs","repos_url":"https://api.github.com/users/chinming0822/repos","events_url":"https://api.github.com/users/chinming0822/events{/privacy}","received_events_url":"https://api.github.com/users/chinming0822/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/containers-ai/alameda-ai/pulls/19/commits","review_comments_url":"https://api.github.com/repos/containers-ai/alameda-ai/pulls/19/comments","review_comment_url":"https://api.github.com/repos/containers-ai/alameda-ai/pulls/comments{/number}","comments_url":"https://api.github.com/repos/containers-ai/alameda-ai/issues/19/comments","statuses_url":"https://api.github.com/repos/containers-ai/alameda-ai/statuses/74ca7509796114ca545a8f8f38a5f4561b922b7f","head":{"label":"sscheng216:master","ref":"master","sha":"74ca7509796114ca545a8f8f38a5f4561b922b7f","user":{"login":"sscheng216","id":34641564,"node_id":"MDQ6VXNlcjM0NjQxNTY0","avatar_url":"https://avatars1.githubusercontent.com/u/34641564?v=4","gravatar_id":"","url":"https://api.github.com/users/sscheng216","html_url":"https://github.com/sscheng216","followers_url":"https://api.github.com/users/sscheng216/followers","following_url":"https://api.github.com/users/sscheng216/following{/other_user}","gists_url":"https://api.github.com/users/sscheng216/gists{/gist_id}","starred_url":"https://api.github.com/users/sscheng216/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sscheng216/subscriptions","organizations_url":"https://api.github.com/users/sscheng216/orgs","repos_url":"https://api.github.com/users/sscheng216/repos","events_url":"https://api.github.com/users/sscheng216/events{/privacy}","received_events_url":"https://api.github.com/users/sscheng216/received_events","type":"User","site_admin":false},"repo":{"id":161743448,"node_id":"MDEwOlJlcG9zaXRvcnkxNjE3NDM0NDg=","name":"alameda-ai","full_name":"sscheng216/alameda-ai","private":false,"owner":{"login":"sscheng216","id":34641564,"node_id":"MDQ6VXNlcjM0NjQxNTY0","avatar_url":"https://avatars1.githubusercontent.com/u/34641564?v=4","gravatar_id":"","url":"https://api.github.com/users/sscheng216","html_url":"https://github.com/sscheng216","followers_url":"https://api.github.com/users/sscheng216/followers","following_url":"https://api.github.com/users/sscheng216/following{/other_user}","gists_url":"https://api.github.com/users/sscheng216/gists{/gist_id}","starred_url":"https://api.github.com/users/sscheng216/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sscheng216/subscriptions","organizations_url":"https://api.github.com/users/sscheng216/orgs","repos_url":"https://api.github.com/users/sscheng216/repos","events_url":"https://api.github.com/users/sscheng216/events{/privacy}","received_events_url":"https://api.github.com/users/sscheng216/received_events","type":"User","site_admin":false},"html_url":"https://github.com/sscheng216/alameda-ai","description":"AI platform as part of Alameda framework","fork":true,"url":"https://api.github.com/repos/sscheng216/alameda-ai","forks_url":"https://api.github.com/repos/sscheng216/alameda-ai/forks","keys_url":"https://api.github.com/repos/sscheng216/alameda-ai/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sscheng216/alameda-ai/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sscheng216/alameda-ai/teams","hooks_url":"https://api.github.com/repos/sscheng216/alameda-ai/hooks","issue_events_url":"https://api.github.com/repos/sscheng216/alameda-ai/issues/events{/number}","events_url":"https://api.github.com/repos/sscheng216/alameda-ai/events","assignees_url":"https://api.github.com/repos/sscheng216/alameda-ai/assignees{/user}","branches_url":"https://api.github.com/repos/sscheng216/alameda-ai/branches{/branch}","tags_url":"https://api.github.com/repos/sscheng216/alameda-ai/tags","blobs_url":"https://api.github.com/repos/sscheng216/alameda-ai/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sscheng216/alameda-ai/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sscheng216/alameda-ai/git/refs{/sha}","trees_url":"https://api.github.com/repos/sscheng216/alameda-ai/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sscheng216/alameda-ai/statuses/{sha}","languages_url":"https://api.github.com/repos/sscheng216/alameda-ai/languages","stargazers_url":"https://api.github.com/repos/sscheng216/alameda-ai/stargazers","contributors_url":"https://api.github.com/repos/sscheng216/alameda-ai/contributors","subscribers_url":"https://api.github.com/repos/sscheng216/alameda-ai/subscribers","subscription_url":"https://api.github.com/repos/sscheng216/alameda-ai/subscription","commits_url":"https://api.github.com/repos/sscheng216/alameda-ai/commits{/sha}","git_commits_url":"https://api.github.com/repos/sscheng216/alameda-ai/git/commits{/sha}","comments_url":"https://api.github.com/repos/sscheng216/alameda-ai/comments{/number}","issue_comment_url":"https://api.github.com/repos/sscheng216/alameda-ai/issues/comments{/number}","contents_url":"https://api.github.com/repos/sscheng216/alameda-ai/contents/{+path}","compare_url":"https://api.github.com/repos/sscheng216/alameda-ai/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sscheng216/alameda-ai/merges","archive_url":"https://api.github.com/repos/sscheng216/alameda-ai/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sscheng216/alameda-ai/downloads","issues_url":"https://api.github.com/repos/sscheng216/alameda-ai/issues{/number}","pulls_url":"https://api.github.com/repos/sscheng216/alameda-ai/pulls{/number}","milestones_url":"https://api.github.com/repos/sscheng216/alameda-ai/milestones{/number}","notifications_url":"https://api.github.com/repos/sscheng216/alameda-ai/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sscheng216/alameda-ai/labels{/name}","releases_url":"https://api.github.com/repos/sscheng216/alameda-ai/releases{/id}","deployments_url":"https://api.github.com/repos/sscheng216/alameda-ai/deployments","created_at":"2018-12-14T06:46:26Z","updated_at":"2018-12-18T06:57:41Z","pushed_at":"2018-12-18T06:57:40Z","git_url":"git://github.com/sscheng216/alameda-ai.git","ssh_url":"git@github.com:sscheng216/alameda-ai.git","clone_url":"https://github.com/sscheng216/alameda-ai.git","svn_url":"https://github.com/sscheng216/alameda-ai","homepage":null,"size":83,"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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"containers-ai:master","ref":"master","sha":"1ecd2497e6374baa4043bb7e1f93295e182f60a0","user":{"login":"containers-ai","id":43647279,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzNjQ3Mjc5","avatar_url":"https://avatars0.githubusercontent.com/u/43647279?v=4","gravatar_id":"","url":"https://api.github.com/users/containers-ai","html_url":"https://github.com/containers-ai","followers_url":"https://api.github.com/users/containers-ai/followers","following_url":"https://api.github.com/users/containers-ai/following{/other_user}","gists_url":"https://api.github.com/users/containers-ai/gists{/gist_id}","starred_url":"https://api.github.com/users/containers-ai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/containers-ai/subscriptions","organizations_url":"https://api.github.com/users/containers-ai/orgs","repos_url":"https://api.github.com/users/containers-ai/repos","events_url":"https://api.github.com/users/containers-ai/events{/privacy}","received_events_url":"https://api.github.com/users/containers-ai/received_events","type":"Organization","site_admin":false},"repo":{"id":159483160,"node_id":"MDEwOlJlcG9zaXRvcnkxNTk0ODMxNjA=","name":"alameda-ai","full_name":"containers-ai/alameda-ai","private":false,"owner":{"login":"containers-ai","id":43647279,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzNjQ3Mjc5","avatar_url":"https://avatars0.githubusercontent.com/u/43647279?v=4","gravatar_id":"","url":"https://api.github.com/users/containers-ai","html_url":"https://github.com/containers-ai","followers_url":"https://api.github.com/users/containers-ai/followers","following_url":"https://api.github.com/users/containers-ai/following{/other_user}","gists_url":"https://api.github.com/users/containers-ai/gists{/gist_id}","starred_url":"https://api.github.com/users/containers-ai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/containers-ai/subscriptions","organizations_url":"https://api.github.com/users/containers-ai/orgs","repos_url":"https://api.github.com/users/containers-ai/repos","events_url":"https://api.github.com/users/containers-ai/events{/privacy}","received_events_url":"https://api.github.com/users/containers-ai/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/containers-ai/alameda-ai","description":"AI platform as part of Alameda framework","fork":false,"url":"https://api.github.com/repos/containers-ai/alameda-ai","forks_url":"https://api.github.com/repos/containers-ai/alameda-ai/forks","keys_url":"https://api.github.com/repos/containers-ai/alameda-ai/keys{/key_id}","collaborators_url":"https://api.github.com/repos/containers-ai/alameda-ai/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/containers-ai/alameda-ai/teams","hooks_url":"https://api.github.com/repos/containers-ai/alameda-ai/hooks","issue_events_url":"https://api.github.com/repos/containers-ai/alameda-ai/issues/events{/number}","events_url":"https://api.github.com/repos/containers-ai/alameda-ai/events","assignees_url":"https://api.github.com/repos/containers-ai/alameda-ai/assignees{/user}","branches_url":"https://api.github.com/repos/containers-ai/alameda-ai/branches{/branch}","tags_url":"https://api.github.com/repos/containers-ai/alameda-ai/tags","blobs_url":"https://api.github.com/repos/containers-ai/alameda-ai/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/containers-ai/alameda-ai/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/containers-ai/alameda-ai/git/refs{/sha}","trees_url":"https://api.github.com/repos/containers-ai/alameda-ai/git/trees{/sha}","statuses_url":"https://api.github.com/repos/containers-ai/alameda-ai/statuses/{sha}","languages_url":"https://api.github.com/repos/containers-ai/alameda-ai/languages","stargazers_url":"https://api.github.com/repos/containers-ai/alameda-ai/stargazers","contributors_url":"https://api.github.com/repos/containers-ai/alameda-ai/contributors","subscribers_url":"https://api.github.com/repos/containers-ai/alameda-ai/subscribers","subscription_url":"https://api.github.com/repos/containers-ai/alameda-ai/subscription","commits_url":"https://api.github.com/repos/containers-ai/alameda-ai/commits{/sha}","git_commits_url":"https://api.github.com/repos/containers-ai/alameda-ai/git/commits{/sha}","comments_url":"https://api.github.com/repos/containers-ai/alameda-ai/comments{/number}","issue_comment_url":"https://api.github.com/repos/containers-ai/alameda-ai/issues/comments{/number}","contents_url":"https://api.github.com/repos/containers-ai/alameda-ai/contents/{+path}","compare_url":"https://api.github.com/repos/containers-ai/alameda-ai/compare/{base}...{head}","merges_url":"https://api.github.com/repos/containers-ai/alameda-ai/merges","archive_url":"https://api.github.com/repos/containers-ai/alameda-ai/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/containers-ai/alameda-ai/downloads","issues_url":"https://api.github.com/repos/containers-ai/alameda-ai/issues{/number}","pulls_url":"https://api.github.com/repos/containers-ai/alameda-ai/pulls{/number}","milestones_url":"https://api.github.com/repos/containers-ai/alameda-ai/milestones{/number}","notifications_url":"https://api.github.com/repos/containers-ai/alameda-ai/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/containers-ai/alameda-ai/labels{/name}","releases_url":"https://api.github.com/repos/containers-ai/alameda-ai/releases{/id}","deployments_url":"https://api.github.com/repos/containers-ai/alameda-ai/deployments","created_at":"2018-11-28T10:18:28Z","updated_at":"2018-12-18T02:21:39Z","pushed_at":"2018-12-18T07:03:38Z","git_url":"git://github.com/containers-ai/alameda-ai.git","ssh_url":"git@github.com:containers-ai/alameda-ai.git","clone_url":"https://github.com/containers-ai/alameda-ai.git","svn_url":"https://github.com/containers-ai/alameda-ai","homepage":null,"size":80,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":6,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/containers-ai/alameda-ai/pulls/19"},"html":{"href":"https://github.com/containers-ai/alameda-ai/pull/19"},"issue":{"href":"https://api.github.com/repos/containers-ai/alameda-ai/issues/19"},"comments":{"href":"https://api.github.com/repos/containers-ai/alameda-ai/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/containers-ai/alameda-ai/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/containers-ai/alameda-ai/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/containers-ai/alameda-ai/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/containers-ai/alameda-ai/statuses/74ca7509796114ca545a8f8f38a5f4561b922b7f"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"susansdb"}}