Skip to content

Commit 806def0

Browse files
committed
Pylint cleanup, more comments
1 parent 067f475 commit 806def0

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

benchmark/scripts/compare_perf_tests.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class PerformanceTestResult(object):
4242
It supports log formats emitted by the test driver.
4343
"""
4444

45+
# TODO: Delete after December 2023
4546
@classmethod
4647
def fromOldFormat(cls, header, line):
4748
"""Original format with statistics for normal distribution (MEAN, SD):
@@ -101,6 +102,7 @@ def fromOldFormat(cls, header, line):
101102

102103
return PerformanceTestResult(json_data)
103104

105+
# TODO: Delete after December 2023
104106
@classmethod
105107
def fromQuantileFormat(cls, header, line):
106108
"""Quantiles format with variable number of columns depending on the
@@ -229,9 +231,14 @@ def json(self):
229231
# drop any lingering pre-computed statistics
230232
# (It's better for downstream consumers to just
231233
# compute whatever statistics they need from scratch.)
234+
235+
# After December 2023, uncomment the next line:
236+
# assert len(self.samples) == self.num_samples
232237
if len(self.samples) == self.num_samples:
233238
data["samples"] = self.samples
234239
data.pop("num_samples", None)
240+
# TODO: Delete min/max/mean/sd/q1/median/q3/quantiles
241+
# after December 2023
235242
data.pop("min", None)
236243
data.pop("max", None)
237244
data.pop("mean", None)
@@ -450,17 +457,21 @@ def __init__(self, old, new):
450457
ratio = (new.min_value + 0.001) / (old.min_value + 0.001)
451458
self.delta = (ratio - 1) * 100
452459

453-
454460
# If we have full samples for both old and new...
455-
if (len(old.samples) == old.num_samples
456-
and len(new.samples) == new.num_samples):
461+
if (
462+
len(old.samples) == old.num_samples
463+
and len(new.samples) == new.num_samples
464+
):
457465
# TODO: Use a T-Test or U-Test to determine whether
458466
# one set of samples should be considered reliably better than
459467
# the other.
460468
None
461469

462470
# If we do not have full samples, we'll use the
463471
# legacy calculation for compatibility.
472+
# TODO: After Dec 2023, we should always be using full samples
473+
# everywhere and can delete the following entirely.
474+
#
464475
# Indication of dubious changes: when result's MIN falls inside the
465476
# (MIN, MAX) interval of result they are being compared with.
466477
self.is_dubious = (

0 commit comments

Comments
 (0)