Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1254)

Unified Diff: appengine/findit/crash/scorers/scorer.py

Issue 2707603002: [Predator] Generate all changelogs in regression ranges instead of only matched changelogs (Closed)
Patch Set: . Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/findit/crash/scorers/min_distance.py ('k') | appengine/findit/crash/scorers/test/__init__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/crash/scorers/scorer.py
diff --git a/appengine/findit/crash/scorers/scorer.py b/appengine/findit/crash/scorers/scorer.py
deleted file mode 100644
index dfc2ecb74cade57789ee673100f0c4a252ed5e31..0000000000000000000000000000000000000000
--- a/appengine/findit/crash/scorers/scorer.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 2016 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Interface of scorers to score and reason Result.
-
-A Scorer represents a heuristic rule to score a culprit cl result.
-"""
-
-import logging
-
-
-class Scorer(object): # pragma: no cover.
-
- def GetMetric(self, result):
- raise NotImplementedError()
-
- def Score(self, metric):
- """Scores the result based on extracted metric."""
- raise NotImplementedError()
-
- def Reason(self, metric, score):
- """Gives the reason of this score."""
- raise NotImplementedError()
-
- def ChangedFiles(self, result, score):
- """Returns the changed files info dict."""
- raise NotImplementedError()
-
- def __call__(self, result):
- """Returns score and reason of this result."""
- metric = self.GetMetric(result)
- if metric is None:
- logging.warning('Cannot get needed metric of result %s for scorer %s',
- repr(result.ToDict()), self.name)
- return 0, ''
-
- score = self.Score(metric)
- reason = self.Reason(metric, score)
- changed_files = self.ChangedFiles(result, score)
- return score, reason, changed_files
-
- @property
- def name(self):
- return self.__class__.__name__
« no previous file with comments | « appengine/findit/crash/scorers/min_distance.py ('k') | appengine/findit/crash/scorers/test/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698