{"action":"created","comment":{"url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/pulls/comments/73701740","id":73701740,"diff_hunk":"@@ -111,50 +141,129 @@ def get_source(self, data_src):\n \n         return matches[0]\n \n-    def get_pipeline_score(self, pipeline):\n+    def get_pipeline_report_url(self, pipeline):\n+        \"\"\"Return a URL to a report on this data.\"\"\"\n+\n+        return self.config['goodtables']['goodtables_web']\n+\n+    def get_pipeline_score(self, pipeline, source):\n         \"\"\"Return a score for this pipeline run.\"\"\"\n \n         score = self.max_score\n-        results = pipeline.report.generate()['results']\n-\n-        if not results:\n-            pass\n+        report = pipeline.report.generate()\n+        error_stats = self.get_error_stats(report)\n+        total_no_rows = report['meta']['row_count']\n+        base_errors = {err: stats for err, stats in error_stats.items()\n+                       if stats['processor'] == 'base'}\n+        if base_errors:\n+            score = 0\n         else:\n-            result_count = len(results)\n-\n-            if result_count > score:\n-                score = 0\n+            if self.scoring_algorithm == 1:\n+                score = self.score_by_affected_rows(error_stats, total_no_rows+1)\n+            elif self.scoring_algorithm == 2:\n+                score = self.score_by_error_occurences(error_stats)\n             else:\n-                score = score - result_count\n-\n+                score = self.score_by_affected_rows(error_stats, total_no_rows+1,\n+                                                    weighted=True)\n+            if self.assess_timeliness:\n+                publication_delay = self.get_publication_delay(source)\n+                score -= publication_delay","path":"data_quality/tasks/aggregate.py","position":null,"original_position":122,"commit_id":"a9e7eb64b3c70a84b67540dcc911df86de9e0d64","original_commit_id":"80e922ed329291b047259c19c0e5eb85e0f52923","user":{"login":"georgiana-b","id":8862002,"avatar_url":"https://avatars.githubusercontent.com/u/8862002?v=3","gravatar_id":"","url":"https://api.github.com/users/georgiana-b","html_url":"https://github.com/georgiana-b","followers_url":"https://api.github.com/users/georgiana-b/followers","following_url":"https://api.github.com/users/georgiana-b/following{/other_user}","gists_url":"https://api.github.com/users/georgiana-b/gists{/gist_id}","starred_url":"https://api.github.com/users/georgiana-b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgiana-b/subscriptions","organizations_url":"https://api.github.com/users/georgiana-b/orgs","repos_url":"https://api.github.com/users/georgiana-b/repos","events_url":"https://api.github.com/users/georgiana-b/events{/privacy}","received_events_url":"https://api.github.com/users/georgiana-b/received_events","type":"User","site_admin":false},"body":"I settled on subtracting 1 for each month of delay because treating it like a normal error in the scoring algorithms doesn't make much sense: in `score_by_error_occurrences`, the impact would decrease as more months of delay accumulate, which is not the case; in `score_by_affected_rows` the effect would be the same as this. ","created_at":"2016-08-05T14:32:46Z","updated_at":"2016-08-05T14:32:46Z","html_url":"https://github.com/frictionlessdata/data-quality-cli/pull/31#discussion_r73701740","pull_request_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/pulls/31","_links":{"self":{"href":"https://api.github.com/repos/frictionlessdata/data-quality-cli/pulls/comments/73701740"},"html":{"href":"https://github.com/frictionlessdata/data-quality-cli/pull/31#discussion_r73701740"},"pull_request":{"href":"https://api.github.com/repos/frictionlessdata/data-quality-cli/pulls/31"}}},"pull_request":{"url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/pulls/31","id":78716720,"html_url":"https://github.com/frictionlessdata/data-quality-cli/pull/31","diff_url":"https://github.com/frictionlessdata/data-quality-cli/pull/31.diff","patch_url":"https://github.com/frictionlessdata/data-quality-cli/pull/31.patch","issue_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/issues/31","number":31,"state":"open","locked":false,"title":"Feature/new scoring algorithms","user":{"login":"georgiana-b","id":8862002,"avatar_url":"https://avatars.githubusercontent.com/u/8862002?v=3","gravatar_id":"","url":"https://api.github.com/users/georgiana-b","html_url":"https://github.com/georgiana-b","followers_url":"https://api.github.com/users/georgiana-b/followers","following_url":"https://api.github.com/users/georgiana-b/following{/other_user}","gists_url":"https://api.github.com/users/georgiana-b/gists{/gist_id}","starred_url":"https://api.github.com/users/georgiana-b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgiana-b/subscriptions","organizations_url":"https://api.github.com/users/georgiana-b/orgs","repos_url":"https://api.github.com/users/georgiana-b/repos","events_url":"https://api.github.com/users/georgiana-b/events{/privacy}","received_events_url":"https://api.github.com/users/georgiana-b/received_events","type":"User","site_admin":false},"body":"This pull request fixes #5 .\r\n\r\nEverything has been implemented but I assume it will be ready for merge after I deploy instances with each scoring algorithm and we settle on one. \r\n","created_at":"2016-07-25T17:04:04Z","updated_at":"2016-08-05T14:32:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3d53f4bb54b616a5d8ece450f8038dd62f25399f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/pulls/31/commits","review_comments_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/pulls/31/comments","review_comment_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/issues/31/comments","statuses_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/statuses/a9e7eb64b3c70a84b67540dcc911df86de9e0d64","head":{"label":"frictionlessdata:feature/new-scoring-algorithms","ref":"feature/new-scoring-algorithms","sha":"a9e7eb64b3c70a84b67540dcc911df86de9e0d64","user":{"login":"frictionlessdata","id":5912125,"avatar_url":"https://avatars.githubusercontent.com/u/5912125?v=3","gravatar_id":"","url":"https://api.github.com/users/frictionlessdata","html_url":"https://github.com/frictionlessdata","followers_url":"https://api.github.com/users/frictionlessdata/followers","following_url":"https://api.github.com/users/frictionlessdata/following{/other_user}","gists_url":"https://api.github.com/users/frictionlessdata/gists{/gist_id}","starred_url":"https://api.github.com/users/frictionlessdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frictionlessdata/subscriptions","organizations_url":"https://api.github.com/users/frictionlessdata/orgs","repos_url":"https://api.github.com/users/frictionlessdata/repos","events_url":"https://api.github.com/users/frictionlessdata/events{/privacy}","received_events_url":"https://api.github.com/users/frictionlessdata/received_events","type":"Organization","site_admin":false},"repo":{"id":31886648,"name":"data-quality-cli","full_name":"frictionlessdata/data-quality-cli","owner":{"login":"frictionlessdata","id":5912125,"avatar_url":"https://avatars.githubusercontent.com/u/5912125?v=3","gravatar_id":"","url":"https://api.github.com/users/frictionlessdata","html_url":"https://github.com/frictionlessdata","followers_url":"https://api.github.com/users/frictionlessdata/followers","following_url":"https://api.github.com/users/frictionlessdata/following{/other_user}","gists_url":"https://api.github.com/users/frictionlessdata/gists{/gist_id}","starred_url":"https://api.github.com/users/frictionlessdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frictionlessdata/subscriptions","organizations_url":"https://api.github.com/users/frictionlessdata/orgs","repos_url":"https://api.github.com/users/frictionlessdata/repos","events_url":"https://api.github.com/users/frictionlessdata/events{/privacy}","received_events_url":"https://api.github.com/users/frictionlessdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/frictionlessdata/data-quality-cli","description":"CLI for creating databases for Data Quality Dashboards.","fork":false,"url":"https://api.github.com/repos/frictionlessdata/data-quality-cli","forks_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/forks","keys_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/teams","hooks_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/hooks","issue_events_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/issues/events{/number}","events_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/events","assignees_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/assignees{/user}","branches_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/branches{/branch}","tags_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/tags","blobs_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/languages","stargazers_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/stargazers","contributors_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/contributors","subscribers_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/subscribers","subscription_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/subscription","commits_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/contents/{+path}","compare_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/merges","archive_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/downloads","issues_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/issues{/number}","pulls_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/labels{/name}","releases_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/releases{/id}","deployments_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/deployments","created_at":"2015-03-09T08:28:05Z","updated_at":"2016-07-08T16:48:49Z","pushed_at":"2016-08-05T14:26:30Z","git_url":"git://github.com/frictionlessdata/data-quality-cli.git","ssh_url":"git@github.com:frictionlessdata/data-quality-cli.git","clone_url":"https://github.com/frictionlessdata/data-quality-cli.git","svn_url":"https://github.com/frictionlessdata/data-quality-cli","homepage":"https://github.com/okfn/data-quality-dashboard","size":210,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":6,"default_branch":"master"}},"base":{"label":"frictionlessdata:master","ref":"master","sha":"cd119e2495e99f7996a4e6681bb4d3799e7ca907","user":{"login":"frictionlessdata","id":5912125,"avatar_url":"https://avatars.githubusercontent.com/u/5912125?v=3","gravatar_id":"","url":"https://api.github.com/users/frictionlessdata","html_url":"https://github.com/frictionlessdata","followers_url":"https://api.github.com/users/frictionlessdata/followers","following_url":"https://api.github.com/users/frictionlessdata/following{/other_user}","gists_url":"https://api.github.com/users/frictionlessdata/gists{/gist_id}","starred_url":"https://api.github.com/users/frictionlessdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frictionlessdata/subscriptions","organizations_url":"https://api.github.com/users/frictionlessdata/orgs","repos_url":"https://api.github.com/users/frictionlessdata/repos","events_url":"https://api.github.com/users/frictionlessdata/events{/privacy}","received_events_url":"https://api.github.com/users/frictionlessdata/received_events","type":"Organization","site_admin":false},"repo":{"id":31886648,"name":"data-quality-cli","full_name":"frictionlessdata/data-quality-cli","owner":{"login":"frictionlessdata","id":5912125,"avatar_url":"https://avatars.githubusercontent.com/u/5912125?v=3","gravatar_id":"","url":"https://api.github.com/users/frictionlessdata","html_url":"https://github.com/frictionlessdata","followers_url":"https://api.github.com/users/frictionlessdata/followers","following_url":"https://api.github.com/users/frictionlessdata/following{/other_user}","gists_url":"https://api.github.com/users/frictionlessdata/gists{/gist_id}","starred_url":"https://api.github.com/users/frictionlessdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frictionlessdata/subscriptions","organizations_url":"https://api.github.com/users/frictionlessdata/orgs","repos_url":"https://api.github.com/users/frictionlessdata/repos","events_url":"https://api.github.com/users/frictionlessdata/events{/privacy}","received_events_url":"https://api.github.com/users/frictionlessdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/frictionlessdata/data-quality-cli","description":"CLI for creating databases for Data Quality Dashboards.","fork":false,"url":"https://api.github.com/repos/frictionlessdata/data-quality-cli","forks_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/forks","keys_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/teams","hooks_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/hooks","issue_events_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/issues/events{/number}","events_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/events","assignees_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/assignees{/user}","branches_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/branches{/branch}","tags_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/tags","blobs_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/languages","stargazers_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/stargazers","contributors_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/contributors","subscribers_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/subscribers","subscription_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/subscription","commits_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/contents/{+path}","compare_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/merges","archive_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/downloads","issues_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/issues{/number}","pulls_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/labels{/name}","releases_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/releases{/id}","deployments_url":"https://api.github.com/repos/frictionlessdata/data-quality-cli/deployments","created_at":"2015-03-09T08:28:05Z","updated_at":"2016-07-08T16:48:49Z","pushed_at":"2016-08-05T14:26:30Z","git_url":"git://github.com/frictionlessdata/data-quality-cli.git","ssh_url":"git@github.com:frictionlessdata/data-quality-cli.git","clone_url":"https://github.com/frictionlessdata/data-quality-cli.git","svn_url":"https://github.com/frictionlessdata/data-quality-cli","homepage":"https://github.com/okfn/data-quality-dashboard","size":210,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/frictionlessdata/data-quality-cli/pulls/31"},"html":{"href":"https://github.com/frictionlessdata/data-quality-cli/pull/31"},"issue":{"href":"https://api.github.com/repos/frictionlessdata/data-quality-cli/issues/31"},"comments":{"href":"https://api.github.com/repos/frictionlessdata/data-quality-cli/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/frictionlessdata/data-quality-cli/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/frictionlessdata/data-quality-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/frictionlessdata/data-quality-cli/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/frictionlessdata/data-quality-cli/statuses/a9e7eb64b3c70a84b67540dcc911df86de9e0d64"}}}}
{"actor":{"display_login":"georgiana-b"}}