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

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

Issue 2595263003: [Predator] Making the Y sets conditional for loglinear models (Closed)
Patch Set: minor clarification in crash/suspect.py Created 4 years 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/loglinear/training.py ('k') | no next file » | 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 7
8 # TODO(wrengr): we should change things to use integers with None as 8 # TODO(wrengr): we should change things to use integers with None as
9 # \"infinity\", rather than using floats. 9 # \"infinity\", rather than using floats.
10 # TODO(http://crbug.com/644476): this class needs a better name. 10 # TODO(http://crbug.com/644476): this class needs a better name.
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 stack_infos (list of StackInfo): List of the frames of this file 115 stack_infos (list of StackInfo): List of the frames of this file
116 together with their callstack priorities. 116 together with their callstack priorities.
117 blame (Blame): Blame oject of this file. 117 blame (Blame): Blame oject of this file.
118 """ 118 """
119 suspect.file_to_stack_infos[file_path] = stack_infos 119 suspect.file_to_stack_infos[file_path] = stack_infos
120 120
121 if not blame: 121 if not blame:
122 return 122 return
123 123
124 min_distance = float('inf') 124 min_distance = float('inf')
125 min_distance_frame = stack_infos[0][0] 125 min_distance_frame = stack_infos[0].frame
126 for region in blame: 126 for region in blame:
127 if region.revision != suspect.changelog.revision: 127 if region.revision != suspect.changelog.revision:
128 continue 128 continue
129 129
130 region_start = region.start 130 region_start = region.start
131 region_end = region_start + region.count - 1 131 region_end = region_start + region.count - 1
132 for frame, _ in stack_infos: 132 for frame, _ in stack_infos:
133 frame_start = frame.crashed_line_numbers[0] 133 frame_start = frame.crashed_line_numbers[0]
134 frame_end = frame.crashed_line_numbers[-1] 134 frame_end = frame.crashed_line_numbers[-1]
135 distance = _DistanceBetweenLineRanges((frame_start, frame_end), 135 distance = _DistanceBetweenLineRanges((frame_start, frame_end),
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 blame (Blame): Blame of the file. 191 blame (Blame): Blame of the file.
192 """ 192 """
193 for changelog in changelogs: 193 for changelog in changelogs:
194 if self._ignore_cls and changelog.revision in self._ignore_cls: 194 if self._ignore_cls and changelog.revision in self._ignore_cls:
195 continue 195 continue
196 196
197 if changelog.revision not in self: 197 if changelog.revision not in self:
198 self[changelog.revision] = Suspect(changelog, dep_path) 198 self[changelog.revision] = Suspect(changelog, dep_path)
199 199
200 _UpdateSuspect(self[changelog.revision], file_path, stack_infos, blame) 200 _UpdateSuspect(self[changelog.revision], file_path, stack_infos, blame)
OLDNEW
« no previous file with comments | « appengine/findit/crash/loglinear/training.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698