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

Side by Side Diff: appengine/findit/crash/suspect.py

Issue 2613153006: [Predator] Add TouchCrashedFileMetaFeature. (Closed)
Patch Set: Add comments. Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « appengine/findit/crash/predator.py ('k') | appengine/findit/crash/test/crash_util_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 from collections import namedtuple 5 from collections import namedtuple
6 6
7 from libs.gitiles.commit_util import DistanceBetweenLineRanges 7 from libs.gitiles.commit_util import DistanceBetweenLineRanges
8 8
9 9
10 # TODO(wrengr): we should change things to use integers with None as 10 # TODO(wrengr): we should change things to use integers with None as
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 raise TypeError( 51 raise TypeError(
52 'In the ``confidence`` argument to the Result constructor, ' 52 'In the ``confidence`` argument to the Result constructor, '
53 'expected a number or None, but got a %s object instead.' 53 'expected a number or None, but got a %s object instead.'
54 % confidence.__class__.__name__) 54 % confidence.__class__.__name__)
55 self.changelog = changelog 55 self.changelog = changelog
56 self.dep_path = dep_path 56 self.dep_path = dep_path
57 self.confidence = None if confidence is None else float(confidence) 57 self.confidence = None if confidence is None else float(confidence)
58 self.reasons = reasons 58 self.reasons = reasons
59 self.changed_files = changed_files 59 self.changed_files = changed_files
60 60
61 # TODO(katesonia): These file_to_* should be deprecated once we deprecate
62 # the scorer-based changelist_classifier.
61 # TODO(wrengr): (a) make these two fields private/readonly 63 # TODO(wrengr): (a) make these two fields private/readonly
62 # TODO(wrengr): (b) zip them together. 64 # TODO(wrengr): (b) zip them together.
63 # TODO(wrengr): (c) move them to the relevant features instead. 65 # TODO(wrengr): (c) move them to the relevant features instead.
64 self.file_to_stack_infos = {} 66 self.file_to_stack_infos = {}
65 self.file_to_analysis_info = {} 67 self.file_to_analysis_info = {}
66 68
67 def ToDict(self): 69 def ToDict(self):
68 return { 70 return {
69 'url': self.changelog.commit_url, 71 'url': self.changelog.commit_url,
70 'review_url': self.changelog.code_review_url, 72 'review_url': self.changelog.code_review_url,
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 if self._ignore_cls and changelog.revision in self._ignore_cls: 177 if self._ignore_cls and changelog.revision in self._ignore_cls:
176 continue 178 continue
177 179
178 try: 180 try:
179 suspect = self[changelog.revision] 181 suspect = self[changelog.revision]
180 except KeyError: 182 except KeyError:
181 suspect = Suspect(changelog, dep_path) 183 suspect = Suspect(changelog, dep_path)
182 self[changelog.revision] = suspect 184 self[changelog.revision] = suspect
183 185
184 suspect._UpdateSuspect(file_path, stack_infos, blame) 186 suspect._UpdateSuspect(file_path, stack_infos, blame)
OLDNEW
« no previous file with comments | « appengine/findit/crash/predator.py ('k') | appengine/findit/crash/test/crash_util_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698