Build each column's mean change without a no-bugs branch
CI / tests (pull_request) Successful in 5m25s
CI / tests (pull_request) Successful in 5m25s
This commit is contained in:
@@ -106,11 +106,11 @@ def change(base: list[Result], head: list[Result], bugs: list[tuple[list[Result]
|
||||
passed = sum(result.passed for result in head) - sum(result.passed for result in base)
|
||||
pairs = [list(zip(medians(was), medians(now))) for was, now in bugs]
|
||||
# Turns and reads are small counts, where a share misleads.
|
||||
means = [mean_change(column, share=index not in (4, 6)) for index, column in enumerate(zip(*pairs))] if pairs else [None] * 7
|
||||
means = [mean_change([pair[column] for pair in pairs], share=column not in (4, 6)) for column in range(7)]
|
||||
return cells(["All", "change", number(passed, signed=True), *(found or "-" for found in means)])
|
||||
|
||||
|
||||
def mean_change(pairs: tuple[tuple[float | None, float | None], ...], share: bool) -> str | None:
|
||||
def mean_change(pairs: list[tuple[float | None, float | None]], share: bool) -> str | None:
|
||||
"""The mean over the (base, head) medians of one figure, one pair per bug; None where no bug has both."""
|
||||
changes = [(now - was) * (100 / was if share else 1) for was, now in pairs if was is not None and now is not None and (was or not share)]
|
||||
if not changes:
|
||||
|
||||
Reference in New Issue
Block a user