{"action":"created","comment":{"url":"https://api.github.com/repos/garaud/jitenshea/pulls/comments/190578566","pull_request_review_id":122982934,"id":190578566,"diff_hunk":"@@ -387,25 +469,29 @@ def run(self):\n         clusters['labels'].to_hdf(path, '/clusters')\n         clusters['centroids'].to_hdf(path, '/centroids')\n \n-class BordeauxStoreClustersToDatabase(CopyToTable):\n-    \"\"\"Read the cluster labels from `DATADIR/bordeaux-clustering.h5` file and store\n+class StoreClustersToDatabase(CopyToTable):\n+    \"\"\"Read the cluster labels from `DATADIR/<city>/clustering.h5` file and store\n     them into `clustered_stations`\n \n     \"\"\"\n+    city = luigi.Parameter()\n     start = luigi.DateParameter(default=yesterday())\n     stop = luigi.DateParameter(default=date.today())\n \n-    host = 'localhost'\n+    host = config['database']['host']\n     database = config['database']['dbname']\n     user = config['database']['user']\n     password = None\n-    table = '{schema}.{tablename}'.format(schema=config['bordeaux']['schema'],\n-                                          tablename=config['bordeaux']['clustering'])\n+\n     columns = [('station_id', 'INT'),\n                ('start', 'DATE'),\n                ('stop', 'DATE'),\n                ('cluster_id', 'INT')]\n \n+    @property\n+    def table(self):\n+        return '{schema}.clustered_stations'.format(schema=self.city)","path":"jitenshea/tasks/city.py","position":646,"original_position":646,"commit_id":"40fff3bef638aadf82f87d223f879c607618ac90","original_commit_id":"40fff3bef638aadf82f87d223f879c607618ac90","user":{"login":"garaud","id":98194,"avatar_url":"https://avatars0.githubusercontent.com/u/98194?v=4","gravatar_id":"","url":"https://api.github.com/users/garaud","html_url":"https://github.com/garaud","followers_url":"https://api.github.com/users/garaud/followers","following_url":"https://api.github.com/users/garaud/following{/other_user}","gists_url":"https://api.github.com/users/garaud/gists{/gist_id}","starred_url":"https://api.github.com/users/garaud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garaud/subscriptions","organizations_url":"https://api.github.com/users/garaud/orgs","repos_url":"https://api.github.com/users/garaud/repos","events_url":"https://api.github.com/users/garaud/events{/privacy}","received_events_url":"https://api.github.com/users/garaud/received_events","type":"User","site_admin":false},"body":"the name of the cluster table should come from the configuration file.","created_at":"2018-05-24T13:08:53Z","updated_at":"2018-05-24T13:08:57Z","html_url":"https://github.com/garaud/jitenshea/pull/24#discussion_r190578566","pull_request_url":"https://api.github.com/repos/garaud/jitenshea/pulls/24","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/garaud/jitenshea/pulls/comments/190578566"},"html":{"href":"https://github.com/garaud/jitenshea/pull/24#discussion_r190578566"},"pull_request":{"href":"https://api.github.com/repos/garaud/jitenshea/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/garaud/jitenshea/pulls/24","id":189088892,"html_url":"https://github.com/garaud/jitenshea/pull/24","diff_url":"https://github.com/garaud/jitenshea/pull/24.diff","patch_url":"https://github.com/garaud/jitenshea/pull/24.patch","issue_url":"https://api.github.com/repos/garaud/jitenshea/issues/24","number":24,"state":"open","locked":false,"title":"Factorize tasks","user":{"login":"delhomer","id":15051098,"avatar_url":"https://avatars1.githubusercontent.com/u/15051098?v=4","gravatar_id":"","url":"https://api.github.com/users/delhomer","html_url":"https://github.com/delhomer","followers_url":"https://api.github.com/users/delhomer/followers","following_url":"https://api.github.com/users/delhomer/following{/other_user}","gists_url":"https://api.github.com/users/delhomer/gists{/gist_id}","starred_url":"https://api.github.com/users/delhomer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/delhomer/subscriptions","organizations_url":"https://api.github.com/users/delhomer/orgs","repos_url":"https://api.github.com/users/delhomer/repos","events_url":"https://api.github.com/users/delhomer/events{/privacy}","received_events_url":"https://api.github.com/users/delhomer/received_events","type":"User","site_admin":false},"body":"This PR aims at factorizing `bordeaux.py` and `lyon.py` into a unified `city.py`, and as a consequence, to make the addition of a new city easier.\r\n\r\nThe whole Luigi pipeline has been reviewed in this view, from station data dowloading to machine learning algorithm execution.\r\n\r\nSome improvements are still possible, especially regarding the downloading URLs handling. I suggest to open a further PR to address such points, if necessary.\r\n\r\nThis PR fixes issue #5 , by definition, and #14 as database table features as well as `csv` intermediary file features have been normalized.","created_at":"2018-05-18T17:29:08Z","updated_at":"2018-05-24T13:08:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3324c7de980c52aa6759f1cebe947a4e740125c2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/garaud/jitenshea/pulls/24/commits","review_comments_url":"https://api.github.com/repos/garaud/jitenshea/pulls/24/comments","review_comment_url":"https://api.github.com/repos/garaud/jitenshea/pulls/comments{/number}","comments_url":"https://api.github.com/repos/garaud/jitenshea/issues/24/comments","statuses_url":"https://api.github.com/repos/garaud/jitenshea/statuses/40fff3bef638aadf82f87d223f879c607618ac90","head":{"label":"garaud:factorize_tasks","ref":"factorize_tasks","sha":"40fff3bef638aadf82f87d223f879c607618ac90","user":{"login":"garaud","id":98194,"avatar_url":"https://avatars0.githubusercontent.com/u/98194?v=4","gravatar_id":"","url":"https://api.github.com/users/garaud","html_url":"https://github.com/garaud","followers_url":"https://api.github.com/users/garaud/followers","following_url":"https://api.github.com/users/garaud/following{/other_user}","gists_url":"https://api.github.com/users/garaud/gists{/gist_id}","starred_url":"https://api.github.com/users/garaud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garaud/subscriptions","organizations_url":"https://api.github.com/users/garaud/orgs","repos_url":"https://api.github.com/users/garaud/repos","events_url":"https://api.github.com/users/garaud/events{/privacy}","received_events_url":"https://api.github.com/users/garaud/received_events","type":"User","site_admin":false},"repo":{"id":112846561,"name":"jitenshea","full_name":"garaud/jitenshea","owner":{"login":"garaud","id":98194,"avatar_url":"https://avatars0.githubusercontent.com/u/98194?v=4","gravatar_id":"","url":"https://api.github.com/users/garaud","html_url":"https://github.com/garaud","followers_url":"https://api.github.com/users/garaud/followers","following_url":"https://api.github.com/users/garaud/following{/other_user}","gists_url":"https://api.github.com/users/garaud/gists{/gist_id}","starred_url":"https://api.github.com/users/garaud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garaud/subscriptions","organizations_url":"https://api.github.com/users/garaud/orgs","repos_url":"https://api.github.com/users/garaud/repos","events_url":"https://api.github.com/users/garaud/events{/privacy}","received_events_url":"https://api.github.com/users/garaud/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/garaud/jitenshea","description":"Bicycle-sharing data analysis","fork":false,"url":"https://api.github.com/repos/garaud/jitenshea","forks_url":"https://api.github.com/repos/garaud/jitenshea/forks","keys_url":"https://api.github.com/repos/garaud/jitenshea/keys{/key_id}","collaborators_url":"https://api.github.com/repos/garaud/jitenshea/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/garaud/jitenshea/teams","hooks_url":"https://api.github.com/repos/garaud/jitenshea/hooks","issue_events_url":"https://api.github.com/repos/garaud/jitenshea/issues/events{/number}","events_url":"https://api.github.com/repos/garaud/jitenshea/events","assignees_url":"https://api.github.com/repos/garaud/jitenshea/assignees{/user}","branches_url":"https://api.github.com/repos/garaud/jitenshea/branches{/branch}","tags_url":"https://api.github.com/repos/garaud/jitenshea/tags","blobs_url":"https://api.github.com/repos/garaud/jitenshea/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/garaud/jitenshea/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/garaud/jitenshea/git/refs{/sha}","trees_url":"https://api.github.com/repos/garaud/jitenshea/git/trees{/sha}","statuses_url":"https://api.github.com/repos/garaud/jitenshea/statuses/{sha}","languages_url":"https://api.github.com/repos/garaud/jitenshea/languages","stargazers_url":"https://api.github.com/repos/garaud/jitenshea/stargazers","contributors_url":"https://api.github.com/repos/garaud/jitenshea/contributors","subscribers_url":"https://api.github.com/repos/garaud/jitenshea/subscribers","subscription_url":"https://api.github.com/repos/garaud/jitenshea/subscription","commits_url":"https://api.github.com/repos/garaud/jitenshea/commits{/sha}","git_commits_url":"https://api.github.com/repos/garaud/jitenshea/git/commits{/sha}","comments_url":"https://api.github.com/repos/garaud/jitenshea/comments{/number}","issue_comment_url":"https://api.github.com/repos/garaud/jitenshea/issues/comments{/number}","contents_url":"https://api.github.com/repos/garaud/jitenshea/contents/{+path}","compare_url":"https://api.github.com/repos/garaud/jitenshea/compare/{base}...{head}","merges_url":"https://api.github.com/repos/garaud/jitenshea/merges","archive_url":"https://api.github.com/repos/garaud/jitenshea/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/garaud/jitenshea/downloads","issues_url":"https://api.github.com/repos/garaud/jitenshea/issues{/number}","pulls_url":"https://api.github.com/repos/garaud/jitenshea/pulls{/number}","milestones_url":"https://api.github.com/repos/garaud/jitenshea/milestones{/number}","notifications_url":"https://api.github.com/repos/garaud/jitenshea/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/garaud/jitenshea/labels{/name}","releases_url":"https://api.github.com/repos/garaud/jitenshea/releases{/id}","deployments_url":"https://api.github.com/repos/garaud/jitenshea/deployments","created_at":"2017-12-02T14:01:35Z","updated_at":"2018-05-20T17:16:59Z","pushed_at":"2018-05-18T17:29:08Z","git_url":"git://github.com/garaud/jitenshea.git","ssh_url":"git@github.com:garaud/jitenshea.git","clone_url":"https://github.com/garaud/jitenshea.git","svn_url":"https://github.com/garaud/jitenshea","homepage":null,"size":1275,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":12,"watchers":9,"default_branch":"master"}},"base":{"label":"garaud:master","ref":"master","sha":"d9e48bd6e515ceb99f68d55f47a9f2ff5c820d53","user":{"login":"garaud","id":98194,"avatar_url":"https://avatars0.githubusercontent.com/u/98194?v=4","gravatar_id":"","url":"https://api.github.com/users/garaud","html_url":"https://github.com/garaud","followers_url":"https://api.github.com/users/garaud/followers","following_url":"https://api.github.com/users/garaud/following{/other_user}","gists_url":"https://api.github.com/users/garaud/gists{/gist_id}","starred_url":"https://api.github.com/users/garaud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garaud/subscriptions","organizations_url":"https://api.github.com/users/garaud/orgs","repos_url":"https://api.github.com/users/garaud/repos","events_url":"https://api.github.com/users/garaud/events{/privacy}","received_events_url":"https://api.github.com/users/garaud/received_events","type":"User","site_admin":false},"repo":{"id":112846561,"name":"jitenshea","full_name":"garaud/jitenshea","owner":{"login":"garaud","id":98194,"avatar_url":"https://avatars0.githubusercontent.com/u/98194?v=4","gravatar_id":"","url":"https://api.github.com/users/garaud","html_url":"https://github.com/garaud","followers_url":"https://api.github.com/users/garaud/followers","following_url":"https://api.github.com/users/garaud/following{/other_user}","gists_url":"https://api.github.com/users/garaud/gists{/gist_id}","starred_url":"https://api.github.com/users/garaud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garaud/subscriptions","organizations_url":"https://api.github.com/users/garaud/orgs","repos_url":"https://api.github.com/users/garaud/repos","events_url":"https://api.github.com/users/garaud/events{/privacy}","received_events_url":"https://api.github.com/users/garaud/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/garaud/jitenshea","description":"Bicycle-sharing data analysis","fork":false,"url":"https://api.github.com/repos/garaud/jitenshea","forks_url":"https://api.github.com/repos/garaud/jitenshea/forks","keys_url":"https://api.github.com/repos/garaud/jitenshea/keys{/key_id}","collaborators_url":"https://api.github.com/repos/garaud/jitenshea/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/garaud/jitenshea/teams","hooks_url":"https://api.github.com/repos/garaud/jitenshea/hooks","issue_events_url":"https://api.github.com/repos/garaud/jitenshea/issues/events{/number}","events_url":"https://api.github.com/repos/garaud/jitenshea/events","assignees_url":"https://api.github.com/repos/garaud/jitenshea/assignees{/user}","branches_url":"https://api.github.com/repos/garaud/jitenshea/branches{/branch}","tags_url":"https://api.github.com/repos/garaud/jitenshea/tags","blobs_url":"https://api.github.com/repos/garaud/jitenshea/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/garaud/jitenshea/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/garaud/jitenshea/git/refs{/sha}","trees_url":"https://api.github.com/repos/garaud/jitenshea/git/trees{/sha}","statuses_url":"https://api.github.com/repos/garaud/jitenshea/statuses/{sha}","languages_url":"https://api.github.com/repos/garaud/jitenshea/languages","stargazers_url":"https://api.github.com/repos/garaud/jitenshea/stargazers","contributors_url":"https://api.github.com/repos/garaud/jitenshea/contributors","subscribers_url":"https://api.github.com/repos/garaud/jitenshea/subscribers","subscription_url":"https://api.github.com/repos/garaud/jitenshea/subscription","commits_url":"https://api.github.com/repos/garaud/jitenshea/commits{/sha}","git_commits_url":"https://api.github.com/repos/garaud/jitenshea/git/commits{/sha}","comments_url":"https://api.github.com/repos/garaud/jitenshea/comments{/number}","issue_comment_url":"https://api.github.com/repos/garaud/jitenshea/issues/comments{/number}","contents_url":"https://api.github.com/repos/garaud/jitenshea/contents/{+path}","compare_url":"https://api.github.com/repos/garaud/jitenshea/compare/{base}...{head}","merges_url":"https://api.github.com/repos/garaud/jitenshea/merges","archive_url":"https://api.github.com/repos/garaud/jitenshea/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/garaud/jitenshea/downloads","issues_url":"https://api.github.com/repos/garaud/jitenshea/issues{/number}","pulls_url":"https://api.github.com/repos/garaud/jitenshea/pulls{/number}","milestones_url":"https://api.github.com/repos/garaud/jitenshea/milestones{/number}","notifications_url":"https://api.github.com/repos/garaud/jitenshea/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/garaud/jitenshea/labels{/name}","releases_url":"https://api.github.com/repos/garaud/jitenshea/releases{/id}","deployments_url":"https://api.github.com/repos/garaud/jitenshea/deployments","created_at":"2017-12-02T14:01:35Z","updated_at":"2018-05-20T17:16:59Z","pushed_at":"2018-05-18T17:29:08Z","git_url":"git://github.com/garaud/jitenshea.git","ssh_url":"git@github.com:garaud/jitenshea.git","clone_url":"https://github.com/garaud/jitenshea.git","svn_url":"https://github.com/garaud/jitenshea","homepage":null,"size":1275,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":12,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/garaud/jitenshea/pulls/24"},"html":{"href":"https://github.com/garaud/jitenshea/pull/24"},"issue":{"href":"https://api.github.com/repos/garaud/jitenshea/issues/24"},"comments":{"href":"https://api.github.com/repos/garaud/jitenshea/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/garaud/jitenshea/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/garaud/jitenshea/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/garaud/jitenshea/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/garaud/jitenshea/statuses/40fff3bef638aadf82f87d223f879c607618ac90"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"garaud"}}