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

Side by Side Diff: dashboard/dashboard/pinpoint/models/job.py

Issue 3011393002: [pinpoint] Docstrings for models/change/repository.py. (Closed)
Patch Set: "current canonical" Created 3 years, 2 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 | « dashboard/dashboard/pinpoint/models/change/repository.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 import collections 5 import collections
6 import logging 6 import logging
7 import os 7 import os
8 import traceback 8 import traceback
9 9
10 from google.appengine.api import taskqueue 10 from google.appengine.api import taskqueue
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 For every pair of adjacent Changes, compare their results as probability 242 For every pair of adjacent Changes, compare their results as probability
243 distributions. If the results are different, find the midpoint of the 243 distributions. If the results are different, find the midpoint of the
244 Changes and add it to the Job. 244 Changes and add it to the Job.
245 245
246 The midpoint can only be added if the second Change represents a commit that 246 The midpoint can only be added if the second Change represents a commit that
247 comes after the first Change. Otherwise, this method won't explore further. 247 comes after the first Change. Otherwise, this method won't explore further.
248 For example, if Change A is repo@abc, and Change B is repo@abc + patch, 248 For example, if Change A is repo@abc, and Change B is repo@abc + patch,
249 there's no way to pick additional Changes to try. 249 there's no way to pick additional Changes to try.
250 """ 250 """
251 # This loop adds Changes to the _changes list while looping through it. 251 # This loop adds Changes to the _changes list while looping through it.
252 # The Change insertion simultaneously uses and modifies the list indices.
252 # However, the loop index goes in reverse order and Changes are only added 253 # However, the loop index goes in reverse order and Changes are only added
253 # after the loop index, so the loop never encounters the modified items. 254 # after the loop index, so the loop never encounters the modified items.
254 for index, change_b in reversed(tuple(self.Differences())): 255 for index, change_b in reversed(tuple(self.Differences())):
255 change_a = self._changes[index - 1] 256 change_a = self._changes[index - 1]
256 257
257 try: 258 try:
258 midpoint = change_module.Change.Midpoint(change_a, change_b) 259 midpoint = change_module.Change.Midpoint(change_a, change_b)
259 except change_module.NonLinearError: 260 except change_module.NonLinearError:
260 continue 261 continue
261 262
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 387
387 try: 388 try:
388 p_value = mann_whitney_u.MannWhitneyU(values_a, values_b) 389 p_value = mann_whitney_u.MannWhitneyU(values_a, values_b)
389 except ValueError: 390 except ValueError:
390 return _UNKNOWN 391 return _UNKNOWN
391 392
392 if p_value < _SIGNIFICANCE_LEVEL: 393 if p_value < _SIGNIFICANCE_LEVEL:
393 return _DIFFERENT 394 return _DIFFERENT
394 else: 395 else:
395 return _UNKNOWN 396 return _UNKNOWN
OLDNEW
« no previous file with comments | « dashboard/dashboard/pinpoint/models/change/repository.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698