{"action":"created","comment":{"url":"https://api.github.com/repos/e-mission/e-mission-server/pulls/comments/27361305","id":27361305,"diff_hunk":"@@ -0,0 +1,105 @@\n+import get_trips\n+from common import store_trip_in_db, find_perturbed_trips\n+from trip import E_Mission_Trip\n+from get_database import get_alternative_trips_db, get_perturbed_trips_db\n+\n+#import Profiles\n+\n+\"\"\"\n+\n+High level overivew of alternative_trips_pipeline\n+\n+The main method for this pipeline is calc_perturbed_trips\n+We first construct a trip iterator, and look at each trip where the pipelineFlags attribte \"alternativesStarted\" is False\n+For each of these trips, we create an array of trip objects, which are modifications to the original trip object with perturbed times\n+We also have a database collection that associates each original trip, with all of its perturbed trips\n+\n+For each array of perturbed trip objects, we schedule those queries via CRON jobs\n+We initialize each perturbed trip as None, and we update the collection as the queries are being made\n+\n+\n+Overview of helper files relevant to this pipeline:\n+    -query.py -> makes a google maps query immediately to get the directions\n+              -> will also store the query into the database collection\n+    -perturb.py -> schedules calls to query.py on cron jobs\n+\n+    @TODO: this doesn't exist yet, but it would make more sense than to put it in here in order to keep the code clean\n+    -database_util.py -> contains all the helper methods to abstract out interaction with the database\n+\n+\n+\"\"\"\n+\n+\n+# Invoked in recommendation pipeline to get perturbed trips user should consider\n+def calc_alternative_trips(trip_iterator):\n+    while (trip_iterator.next() != None):\n+        curr_trip = trip_iterator.next()\n+        if not curr_trip.getPipelineFlags().alternativesStarted:\n+            curr_trip.getPipelineFlags().startAlternatives()\n+            curr_unique_id = curr_trip._id\n+            list_of_perturbed_trips = find_perturbed_trips(curr_unique_id)\n+            \n+            #@TODO: need a method that initializes the relationship bewteen a trip, and its perturbations","path":"CFC_DataCollector/recommender/alternative_trips_module.py","position":42,"original_position":42,"commit_id":"8a0c954ecc3f095673227708d6775c68d485ef13","original_commit_id":"6d93bee1287a293ad4e2e28924b43931671bd256","user":{"login":"shankari","id":2423263,"avatar_url":"https://avatars.githubusercontent.com/u/2423263?v=3","gravatar_id":"","url":"https://api.github.com/users/shankari","html_url":"https://github.com/shankari","followers_url":"https://api.github.com/users/shankari/followers","following_url":"https://api.github.com/users/shankari/following{/other_user}","gists_url":"https://api.github.com/users/shankari/gists{/gist_id}","starred_url":"https://api.github.com/users/shankari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shankari/subscriptions","organizations_url":"https://api.github.com/users/shankari/orgs","repos_url":"https://api.github.com/users/shankari/repos","events_url":"https://api.github.com/users/shankari/events{/privacy}","received_events_url":"https://api.github.com/users/shankari/received_events","type":"User","site_admin":false},"body":"@jeffdh5, ok so who's going to do this?","created_at":"2015-03-30T00:21:21Z","updated_at":"2015-03-30T00:21:21Z","html_url":"https://github.com/e-mission/e-mission-server/pull/103#discussion_r27361305","pull_request_url":"https://api.github.com/repos/e-mission/e-mission-server/pulls/103","_links":{"self":{"href":"https://api.github.com/repos/e-mission/e-mission-server/pulls/comments/27361305"},"html":{"href":"https://github.com/e-mission/e-mission-server/pull/103#discussion_r27361305"},"pull_request":{"href":"https://api.github.com/repos/e-mission/e-mission-server/pulls/103"}}},"pull_request":{"url":"https://api.github.com/repos/e-mission/e-mission-server/pulls/103","id":30917734,"html_url":"https://github.com/e-mission/e-mission-server/pull/103","diff_url":"https://github.com/e-mission/e-mission-server/pull/103.diff","patch_url":"https://github.com/e-mission/e-mission-server/pull/103.patch","issue_url":"https://api.github.com/repos/e-mission/e-mission-server/issues/103","number":103,"state":"open","locked":false,"title":"[WIP] Recommender System","user":{"login":"jimmydief","id":4480230,"avatar_url":"https://avatars.githubusercontent.com/u/4480230?v=3","gravatar_id":"","url":"https://api.github.com/users/jimmydief","html_url":"https://github.com/jimmydief","followers_url":"https://api.github.com/users/jimmydief/followers","following_url":"https://api.github.com/users/jimmydief/following{/other_user}","gists_url":"https://api.github.com/users/jimmydief/gists{/gist_id}","starred_url":"https://api.github.com/users/jimmydief/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimmydief/subscriptions","organizations_url":"https://api.github.com/users/jimmydief/orgs","repos_url":"https://api.github.com/users/jimmydief/repos","events_url":"https://api.github.com/users/jimmydief/events{/privacy}","received_events_url":"https://api.github.com/users/jimmydief/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-11T06:08:20Z","updated_at":"2015-03-30T00:21:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9f98349e613076a3ef3c8c6c526cac056f36986a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/e-mission/e-mission-server/pulls/103/commits","review_comments_url":"https://api.github.com/repos/e-mission/e-mission-server/pulls/103/comments","review_comment_url":"https://api.github.com/repos/e-mission/e-mission-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/e-mission/e-mission-server/issues/103/comments","statuses_url":"https://api.github.com/repos/e-mission/e-mission-server/statuses/8a0c954ecc3f095673227708d6775c68d485ef13","head":{"label":"jimmydief:recommender","ref":"recommender","sha":"8a0c954ecc3f095673227708d6775c68d485ef13","user":{"login":"jimmydief","id":4480230,"avatar_url":"https://avatars.githubusercontent.com/u/4480230?v=3","gravatar_id":"","url":"https://api.github.com/users/jimmydief","html_url":"https://github.com/jimmydief","followers_url":"https://api.github.com/users/jimmydief/followers","following_url":"https://api.github.com/users/jimmydief/following{/other_user}","gists_url":"https://api.github.com/users/jimmydief/gists{/gist_id}","starred_url":"https://api.github.com/users/jimmydief/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimmydief/subscriptions","organizations_url":"https://api.github.com/users/jimmydief/orgs","repos_url":"https://api.github.com/users/jimmydief/repos","events_url":"https://api.github.com/users/jimmydief/events{/privacy}","received_events_url":"https://api.github.com/users/jimmydief/received_events","type":"User","site_admin":false},"repo":{"id":30278632,"name":"e-mission-server","full_name":"jimmydief/e-mission-server","owner":{"login":"jimmydief","id":4480230,"avatar_url":"https://avatars.githubusercontent.com/u/4480230?v=3","gravatar_id":"","url":"https://api.github.com/users/jimmydief","html_url":"https://github.com/jimmydief","followers_url":"https://api.github.com/users/jimmydief/followers","following_url":"https://api.github.com/users/jimmydief/following{/other_user}","gists_url":"https://api.github.com/users/jimmydief/gists{/gist_id}","starred_url":"https://api.github.com/users/jimmydief/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimmydief/subscriptions","organizations_url":"https://api.github.com/users/jimmydief/orgs","repos_url":"https://api.github.com/users/jimmydief/repos","events_url":"https://api.github.com/users/jimmydief/events{/privacy}","received_events_url":"https://api.github.com/users/jimmydief/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jimmydief/e-mission-server","description":"The backend (server) code for the e-mission server","fork":true,"url":"https://api.github.com/repos/jimmydief/e-mission-server","forks_url":"https://api.github.com/repos/jimmydief/e-mission-server/forks","keys_url":"https://api.github.com/repos/jimmydief/e-mission-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jimmydief/e-mission-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jimmydief/e-mission-server/teams","hooks_url":"https://api.github.com/repos/jimmydief/e-mission-server/hooks","issue_events_url":"https://api.github.com/repos/jimmydief/e-mission-server/issues/events{/number}","events_url":"https://api.github.com/repos/jimmydief/e-mission-server/events","assignees_url":"https://api.github.com/repos/jimmydief/e-mission-server/assignees{/user}","branches_url":"https://api.github.com/repos/jimmydief/e-mission-server/branches{/branch}","tags_url":"https://api.github.com/repos/jimmydief/e-mission-server/tags","blobs_url":"https://api.github.com/repos/jimmydief/e-mission-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jimmydief/e-mission-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jimmydief/e-mission-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/jimmydief/e-mission-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jimmydief/e-mission-server/statuses/{sha}","languages_url":"https://api.github.com/repos/jimmydief/e-mission-server/languages","stargazers_url":"https://api.github.com/repos/jimmydief/e-mission-server/stargazers","contributors_url":"https://api.github.com/repos/jimmydief/e-mission-server/contributors","subscribers_url":"https://api.github.com/repos/jimmydief/e-mission-server/subscribers","subscription_url":"https://api.github.com/repos/jimmydief/e-mission-server/subscription","commits_url":"https://api.github.com/repos/jimmydief/e-mission-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/jimmydief/e-mission-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/jimmydief/e-mission-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/jimmydief/e-mission-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/jimmydief/e-mission-server/contents/{+path}","compare_url":"https://api.github.com/repos/jimmydief/e-mission-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jimmydief/e-mission-server/merges","archive_url":"https://api.github.com/repos/jimmydief/e-mission-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jimmydief/e-mission-server/downloads","issues_url":"https://api.github.com/repos/jimmydief/e-mission-server/issues{/number}","pulls_url":"https://api.github.com/repos/jimmydief/e-mission-server/pulls{/number}","milestones_url":"https://api.github.com/repos/jimmydief/e-mission-server/milestones{/number}","notifications_url":"https://api.github.com/repos/jimmydief/e-mission-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jimmydief/e-mission-server/labels{/name}","releases_url":"https://api.github.com/repos/jimmydief/e-mission-server/releases{/id}","created_at":"2015-02-04T03:10:50Z","updated_at":"2015-03-15T23:04:49Z","pushed_at":"2015-03-29T23:13:44Z","git_url":"git://github.com/jimmydief/e-mission-server.git","ssh_url":"git@github.com:jimmydief/e-mission-server.git","clone_url":"https://github.com/jimmydief/e-mission-server.git","svn_url":"https://github.com/jimmydief/e-mission-server","homepage":"https://e-mission.eecs.berkeley.edu","size":31315,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"e-mission:recommender","ref":"recommender","sha":"2bb91764a41be29aefd1d99d58fdd11dcdcc70d4","user":{"login":"e-mission","id":10713694,"avatar_url":"https://avatars.githubusercontent.com/u/10713694?v=3","gravatar_id":"","url":"https://api.github.com/users/e-mission","html_url":"https://github.com/e-mission","followers_url":"https://api.github.com/users/e-mission/followers","following_url":"https://api.github.com/users/e-mission/following{/other_user}","gists_url":"https://api.github.com/users/e-mission/gists{/gist_id}","starred_url":"https://api.github.com/users/e-mission/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e-mission/subscriptions","organizations_url":"https://api.github.com/users/e-mission/orgs","repos_url":"https://api.github.com/users/e-mission/repos","events_url":"https://api.github.com/users/e-mission/events{/privacy}","received_events_url":"https://api.github.com/users/e-mission/received_events","type":"Organization","site_admin":false},"repo":{"id":26307245,"name":"e-mission-server","full_name":"e-mission/e-mission-server","owner":{"login":"e-mission","id":10713694,"avatar_url":"https://avatars.githubusercontent.com/u/10713694?v=3","gravatar_id":"","url":"https://api.github.com/users/e-mission","html_url":"https://github.com/e-mission","followers_url":"https://api.github.com/users/e-mission/followers","following_url":"https://api.github.com/users/e-mission/following{/other_user}","gists_url":"https://api.github.com/users/e-mission/gists{/gist_id}","starred_url":"https://api.github.com/users/e-mission/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e-mission/subscriptions","organizations_url":"https://api.github.com/users/e-mission/orgs","repos_url":"https://api.github.com/users/e-mission/repos","events_url":"https://api.github.com/users/e-mission/events{/privacy}","received_events_url":"https://api.github.com/users/e-mission/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/e-mission/e-mission-server","description":"The backend (server) code for the e-mission server","fork":false,"url":"https://api.github.com/repos/e-mission/e-mission-server","forks_url":"https://api.github.com/repos/e-mission/e-mission-server/forks","keys_url":"https://api.github.com/repos/e-mission/e-mission-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/e-mission/e-mission-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/e-mission/e-mission-server/teams","hooks_url":"https://api.github.com/repos/e-mission/e-mission-server/hooks","issue_events_url":"https://api.github.com/repos/e-mission/e-mission-server/issues/events{/number}","events_url":"https://api.github.com/repos/e-mission/e-mission-server/events","assignees_url":"https://api.github.com/repos/e-mission/e-mission-server/assignees{/user}","branches_url":"https://api.github.com/repos/e-mission/e-mission-server/branches{/branch}","tags_url":"https://api.github.com/repos/e-mission/e-mission-server/tags","blobs_url":"https://api.github.com/repos/e-mission/e-mission-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/e-mission/e-mission-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/e-mission/e-mission-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/e-mission/e-mission-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/e-mission/e-mission-server/statuses/{sha}","languages_url":"https://api.github.com/repos/e-mission/e-mission-server/languages","stargazers_url":"https://api.github.com/repos/e-mission/e-mission-server/stargazers","contributors_url":"https://api.github.com/repos/e-mission/e-mission-server/contributors","subscribers_url":"https://api.github.com/repos/e-mission/e-mission-server/subscribers","subscription_url":"https://api.github.com/repos/e-mission/e-mission-server/subscription","commits_url":"https://api.github.com/repos/e-mission/e-mission-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/e-mission/e-mission-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/e-mission/e-mission-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/e-mission/e-mission-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/e-mission/e-mission-server/contents/{+path}","compare_url":"https://api.github.com/repos/e-mission/e-mission-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/e-mission/e-mission-server/merges","archive_url":"https://api.github.com/repos/e-mission/e-mission-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/e-mission/e-mission-server/downloads","issues_url":"https://api.github.com/repos/e-mission/e-mission-server/issues{/number}","pulls_url":"https://api.github.com/repos/e-mission/e-mission-server/pulls{/number}","milestones_url":"https://api.github.com/repos/e-mission/e-mission-server/milestones{/number}","notifications_url":"https://api.github.com/repos/e-mission/e-mission-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/e-mission/e-mission-server/labels{/name}","releases_url":"https://api.github.com/repos/e-mission/e-mission-server/releases{/id}","created_at":"2014-11-07T06:39:02Z","updated_at":"2015-03-07T18:00:17Z","pushed_at":"2015-03-29T23:13:45Z","git_url":"git://github.com/e-mission/e-mission-server.git","ssh_url":"git@github.com:e-mission/e-mission-server.git","clone_url":"https://github.com/e-mission/e-mission-server.git","svn_url":"https://github.com/e-mission/e-mission-server","homepage":"https://e-mission.eecs.berkeley.edu","size":32473,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":27,"forks":20,"open_issues":27,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/e-mission/e-mission-server/pulls/103"},"html":{"href":"https://github.com/e-mission/e-mission-server/pull/103"},"issue":{"href":"https://api.github.com/repos/e-mission/e-mission-server/issues/103"},"comments":{"href":"https://api.github.com/repos/e-mission/e-mission-server/issues/103/comments"},"review_comments":{"href":"https://api.github.com/repos/e-mission/e-mission-server/pulls/103/comments"},"review_comment":{"href":"https://api.github.com/repos/e-mission/e-mission-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/e-mission/e-mission-server/pulls/103/commits"},"statuses":{"href":"https://api.github.com/repos/e-mission/e-mission-server/statuses/8a0c954ecc3f095673227708d6775c68d485ef13"}}}}